Merge pull request #9205 from vvlladd28/bug/auth-service/updatedAuthUserFromToken/null-auth-user
Fixed auth service function updatedAuthUserFromToken when authUser and tokenData in null
This commit is contained in:
		
						commit
						e43ce6de39
					
				@ -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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user