This commit is contained in:
Giuseppe Digilio
2018-06-07 12:30:24 +02:00
parent 66295d10ed
commit 099ebd487f
3 changed files with 7 additions and 1 deletions

View File

@@ -135,6 +135,7 @@ export class AuthEffects {
public logOutSuccess$: Observable<Action> = this.actions$
.ofType(AuthActionTypes.LOG_OUT_SUCCESS)
.do(() => this.authService.removeToken())
.do(() => this.authService.clearRedirectUrl())
.do(() => this.authService.refreshAfterLogout());
@Effect({dispatch: false})

View File

@@ -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,

View File

@@ -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