From b2d3c16da7ffeb8ba1bc3c08f9610bd7fd4ba4c9 Mon Sep 17 00:00:00 2001 From: alpox Date: Tue, 29 Jun 2021 16:44:00 +0200 Subject: [PATCH] Fix "onToken" not called if no idToken found in cache --- lib/src/main.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/main.ts b/lib/src/main.ts index 4f5f111..d1c310d 100644 --- a/lib/src/main.ts +++ b/lib/src/main.ts @@ -151,7 +151,7 @@ export class MSAL implements MSALBasic { this.setToken('accessToken', response.accessToken, response.expiresOn, response.scopes); setCallback = true; } - if(this.data.idToken !== response.idToken.rawIdToken) { + if(response.idToken && this.data.idToken !== response.idToken.rawIdToken) { this.setToken('idToken', response.idToken.rawIdToken, new Date(response.idToken.expiration * 1000), [this.auth.clientId]); setCallback = true; }