Repository navigation
v12.6.6
Patch Changes
-
#242
418979f-CreateApiTokenCommandcan resolve a refused credential instead of rejectingA wrong password or MFA code rejects with a 401, which reaches the
hooks.onErrorcallback of
CcApiBridgeClientand can read as an expired session. SetshouldResolveRefusedCredential: true
to get it as a result instead, never reported. The output is then discriminated ontype:created: the token;invalid-credential: the email address or the password is wrong;invalid-mfa-code: the MFA code is wrong, or missing on an account that has one enrolled.
Every other failure still rejects. Without the option, nothing changes.
const result = await client.send(new CreateApiTokenCommand({ ...input, shouldResolveRefusedCredential: true })); if (result.type === 'created') { store(result.apiToken); }