From f3edcc489d47789d7be732b1fa02497ce9bd02db Mon Sep 17 00:00:00 2001 From: Vladyslav_Prykhodko Date: Wed, 6 Sep 2023 16:15:33 +0300 Subject: [PATCH] UI: Fixed auth service function updatedAuthUserFromToken when authUser and tokenData in null --- ui-ngx/src/app/core/auth/auth.service.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-ngx/src/app/core/auth/auth.service.ts b/ui-ngx/src/app/core/auth/auth.service.ts index e969c8129a..1253184714 100644 --- a/ui-ngx/src/app/core/auth/auth.service.ts +++ b/ui-ngx/src/app/core/auth/auth.service.ts @@ -502,7 +502,7 @@ export class AuthService { private updatedAuthUserFromToken(token: string) { const authUser = getCurrentAuthUser(this.store); const tokenData = this.jwtHelper.decodeToken(token); - if (['sub', 'firstName', 'lastName'].some(value => authUser[value] !== tokenData[value])) { + if (authUser && tokenData && ['sub', 'firstName', 'lastName'].some(value => authUser[value] !== tokenData[value])) { this.store.dispatch(new ActionAuthUpdateAuthUser({ sub: tokenData.sub, firstName: tokenData.firstName,