diff --git a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts index 644221b3..4f67b21a 100644 --- a/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts +++ b/projects/ucap-webmessenger-app/src/app/services/authentication.service.ts @@ -118,21 +118,23 @@ export class AppAuthenticationService { environment.customConfig.appKey ); - appUserInfo = { - ...appUserInfo, - settings: { - ...appUserInfo.settings, - general: { - ...appUserInfo.settings.general, - autoLogin: false + if (!!appUserInfo) { + appUserInfo = { + ...appUserInfo, + settings: { + ...appUserInfo.settings, + general: { + ...appUserInfo.settings.general, + autoLogin: false + } } - } - }; + }; - this.localStorageService.encSet( - KEY_APP_USER_INFO, - appUserInfo, - environment.customConfig.appKey - ); + this.localStorageService.encSet( + KEY_APP_USER_INFO, + appUserInfo, + environment.customConfig.appKey + ); + } } }