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

Function handler

src/commands/logout.ts:22–34  ·  view source on GitHub ↗
(argv: ArgumentsCamelCase<CommandArgs>)

Source from the content-addressed store, hash-verified

20 .epilog(buildEpilog({ command }))
21
22const handler = async (argv: ArgumentsCamelCase<CommandArgs>): Promise<void> => {
23 const command = await apiCommand(argv)
24
25 if (command.token || !command.authenticator.logout) {
26 const errorMsg = command.profile.token
27 ? `Profile ${command.profileName} is set up using a bearer token.`
28 : 'Cannot log out with a bearer token.'
29 return fatalError(errorMsg)
30 }
31
32 await command.authenticator.logout()
33 console.log('logged out')
34}
35
36const cmd: CommandModule<object, CommandArgs> = { command, describe, builder, handler }
37export default cmd

Callers

nothing calls this directly

Calls 2

apiCommandFunction · 0.85
fatalErrorFunction · 0.85

Tested by

no test coverage detected