|
const register = async () => { |
|
const { username, password } = await getUserCreds(); |
|
await setClientCreds({ |
|
accountName: 'Commander CLI', |
|
username, |
|
password, |
|
client: 'cli', |
|
}); |
|
try { |
|
const res = await invokeCommand('register'); |
|
const text = res.data.attachments |
|
? res.data.attachments[0].text |
Note the credential store is updated first. So if the remote registration fails, the credential store is incorrect.
commander-cli/src/utils/index.js
Lines 59 to 66 in 2166626
commander-cli/src/utils/index.js
Lines 72 to 75 in 2166626
Note the credential store is updated first. So if the remote registration fails, the credential store is incorrect.