Browse Source

UI: Fixed auth service function updatedAuthUserFromToken when authUser and tokenData in null

pull/9205/head
Vladyslav_Prykhodko 3 years ago
parent
commit
f3edcc489d
  1. 2
      ui-ngx/src/app/core/auth/auth.service.ts

2
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,

Loading…
Cancel
Save