diff --git a/connect/communityGuard/connectAdminLoginGuard.guard.ts b/connect/communityGuard/connectAdminLoginGuard.guard.ts index 467a548a..12948ef4 100644 --- a/connect/communityGuard/connectAdminLoginGuard.guard.ts +++ b/connect/communityGuard/connectAdminLoginGuard.guard.ts @@ -34,6 +34,7 @@ export class ConnectAdminLoginGuard implements CanActivate, CanLoad { if (Session.isPortalAdministrator(user) || Session.isCommunityCurator(user)) { return of(true); } else { + errorCode = LoginErrorCodes.NOT_ADMIN; return this.communityService.isCommunityManager(properties, properties['communityAPI'] + community, email); } diff --git a/connect/communityGuard/connectSubscriber.guard.ts b/connect/communityGuard/connectSubscriber.guard.ts index 27624249..d2e48b8b 100644 --- a/connect/communityGuard/connectSubscriber.guard.ts +++ b/connect/communityGuard/connectSubscriber.guard.ts @@ -18,11 +18,12 @@ export class ConnectSubscriberGuard implements CanActivate { private propertiesService: EnvironmentSpecificService) {} check(community: string, path: string): Observable | boolean { - let errorCode = LoginErrorCodes.NOT_SUBSCRIBER; + let errorCode = LoginErrorCodes.NOT_LOGIN; let email = null; const subscribed = this.propertiesService.subscribeEnvironment().pipe(map(res => res), mergeMap(properties => { return this.userManagementService.getUserInfo(properties.userInfoUrl).pipe(map(user => { if (user) { + errorCode = LoginErrorCodes.NOT_SUBSCRIBER; email = user.email; let communityDomain = ConnectHelper.getCommunityFromDomain(properties.domain); if(communityDomain) { diff --git a/connect/userEmailPreferences/mailPrefs.component.ts b/connect/userEmailPreferences/mailPrefs.component.ts index ba7090eb..0837a202 100644 --- a/connect/userEmailPreferences/mailPrefs.component.ts +++ b/connect/userEmailPreferences/mailPrefs.component.ts @@ -35,8 +35,6 @@ export class MailPrefsComponent { public userValidMessage:string = ""; public savedMessage: string = ""; - public fetchId:string; - private errorCodes: ErrorCodes; private errorMessages: ErrorMessagesComponent; @@ -58,8 +56,6 @@ export class MailPrefsComponent { this.communityId = params['communityId']; } - this.fetchId = Session.getUserEmail(); - this.getEmailPreferences(); }); diff --git a/login/utils/helper.class.ts b/login/utils/helper.class.ts index 302cae40..4db27cb9 100644 --- a/login/utils/helper.class.ts +++ b/login/utils/helper.class.ts @@ -25,7 +25,7 @@ export class Session{ public static isLoggedIn(): boolean { var loggedIn:boolean = false; var user:User = null; - var cookie= COOKIE.getCookie(COOKIE.cookieName_u); + var cookie= COOKIE.getCookie(COOKIE.cookieName_id); if(cookie == null ||cookie == ""){ return false; }else{