From 2341b1907ac601f70842e6a405cd641bf2706c06 Mon Sep 17 00:00:00 2001 From: Thomas Rittson <31796059+eliykat@users.noreply.github.com> Date: Tue, 11 Jan 2022 13:22:52 +1000 Subject: [PATCH] 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 --- common/src/services/token.service.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/common/src/services/token.service.ts b/common/src/services/token.service.ts index aa4cab320e..bad5ce620b 100644 --- a/common/src/services/token.service.ts +++ b/common/src/services/token.service.ts @@ -209,11 +209,8 @@ export class TokenService implements TokenServiceAbstraction { async getIsExternal(): Promise { 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 {