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