MCPcopy Create free account
hub / github.com/SmartThingsCommunity/smartthings-cli / writeCredentialsFile

Function writeCredentialsFile

src/lib/login-authenticator.ts:108–115  ·  view source on GitHub ↗
(credentialsFileData: CredentialsFileData)

Source from the content-addressed store, hash-verified

106 const sha256 = (data: BinaryLike): Buffer => createHash('sha256').update(data).digest()
107
108 const writeCredentialsFile = (credentialsFileData: CredentialsFileData): void => {
109 writeFileSync(credentialsFile, JSON.stringify(credentialsFileData, null, 4))
110 chmod(credentialsFile, 0o600, error => {
111 if (error) {
112 logger.error('failed to set permissions on credentials file', error)
113 }
114 })
115 }
116
117 // eslint-disable-next-line @typescript-eslint/no-explicit-any
118 const updateTokenFromResponse = (response: AxiosResponse<any>): void => {

Callers 2

updateTokenFromResponseFunction · 0.85
logoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected