MCPcopy Index your code
hub / github.com/SmartThingsCommunity/smartthings-cli / buildAuthenticator

Function buildAuthenticator

src/lib/command/api-command.ts:133–150  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

131 }
132
133 const buildAuthenticator = (): Authenticator => {
134 if (token) {
135 return newBearerTokenAuthenticator(token)
136 }
137 if ('clientId' in urlProvider) {
138 return loginAuthenticator(
139 `${stCommand.dataDir}/credentials.json`,
140 stCommand.profileName,
141 urlProvider as ClientIdProvider,
142 userAgent,
143 )
144 }
145 return fatalError(
146 environment === 'china'
147 ? 'a token is required for the china environment'
148 : 'no authentication method available',
149 )
150 }
151 const authenticator = buildAuthenticator()
152
153 const warningLogger = (warnings: WarningFromHeader[] | string): void => {

Callers 1

apiCommandFunction · 0.85

Calls 3

loginAuthenticatorFunction · 0.85
fatalErrorFunction · 0.85

Tested by

no test coverage detected