mirror of
https://github.com/bitwarden/jslib
synced 2025-12-17 16:53:20 +00:00
Fix "no amr found" error in bwdc cli (#589)
* Fix amr error when authing with org api key * Fix linting * Return null instead of error if no amr * Return false instead of null
This commit is contained in:
@@ -209,11 +209,8 @@ export class TokenService implements TokenServiceAbstraction {
|
|||||||
|
|
||||||
async getIsExternal(): Promise<boolean> {
|
async getIsExternal(): Promise<boolean> {
|
||||||
const decoded = await this.decodeToken();
|
const decoded = await this.decodeToken();
|
||||||
if (!Array.isArray(decoded.amr)) {
|
|
||||||
throw new Error("No amr found");
|
|
||||||
}
|
|
||||||
|
|
||||||
return decoded.amr.includes("external");
|
return Array.isArray(decoded.amr) && decoded.amr.includes("external");
|
||||||
}
|
}
|
||||||
|
|
||||||
private async skipTokenStorage(): Promise<boolean> {
|
private async skipTokenStorage(): Promise<boolean> {
|
||||||
|
|||||||
Reference in New Issue
Block a user