From 099ebd487f1c249a8f7290a16d64e0cc295d9ee1 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Thu, 7 Jun 2018 12:30:24 +0200 Subject: [PATCH] fixes --- src/app/core/auth/auth.effects.ts | 1 + src/app/core/auth/auth.reducer.ts | 5 +++++ src/app/core/auth/selectors.ts | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/app/core/auth/auth.effects.ts b/src/app/core/auth/auth.effects.ts index 60fe04a5d1..e2d6c80b5e 100644 --- a/src/app/core/auth/auth.effects.ts +++ b/src/app/core/auth/auth.effects.ts @@ -135,6 +135,7 @@ export class AuthEffects { public logOutSuccess$: Observable = this.actions$ .ofType(AuthActionTypes.LOG_OUT_SUCCESS) .do(() => this.authService.removeToken()) + .do(() => this.authService.clearRedirectUrl()) .do(() => this.authService.refreshAfterLogout()); @Effect({dispatch: false}) diff --git a/src/app/core/auth/auth.reducer.ts b/src/app/core/auth/auth.reducer.ts index c3a425c192..0c5e36ce91 100644 --- a/src/app/core/auth/auth.reducer.ts +++ b/src/app/core/auth/auth.reducer.ts @@ -74,6 +74,11 @@ export function authReducer(state: any = initialState, action: AuthActions): Aut info: undefined }); + case AuthActionTypes.AUTHENTICATED: + return Object.assign({}, state, { + loading: true + }); + case AuthActionTypes.AUTHENTICATED_ERROR: return Object.assign({}, state, { authenticated: false, diff --git a/src/app/core/auth/selectors.ts b/src/app/core/auth/selectors.ts index 24353a04a2..fa637981ae 100644 --- a/src/app/core/auth/selectors.ts +++ b/src/app/core/auth/selectors.ts @@ -195,7 +195,7 @@ export const getLogOutError = createSelector(getAuthState, _getLogOutError); export const getRegistrationError = createSelector(getAuthState, _getRegistrationError); /** - * Returns the redirect url.. + * Returns the redirect url. * @function getRedirectUrl * @param {AuthState} state * @param {any} props