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:
parent
4074c2a45f
commit
2341b1907a
|
@ -209,11 +209,8 @@ export class TokenService implements TokenServiceAbstraction {
|
|||
|
||||
async getIsExternal(): Promise<boolean> {
|
||||
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> {
|
||||
|
|
Loading…
Reference in New Issue