Fixed authentication module

This commit is contained in:
Giuseppe Digilio
2018-02-13 12:56:07 +01:00
parent 8df514f39c
commit 4488a450c0
9 changed files with 104 additions and 59 deletions

View File

@@ -112,11 +112,12 @@ export class AuthEffects {
@Effect({dispatch: false})
public logOutSuccess: Observable<Action> = this.actions$
.ofType(AuthActionTypes.LOG_OUT_SUCCESS)
.do((action: LogOutSuccessAction) => this.authService.removeToken());
.do(() => this.authService.removeToken())
.do(() => this.authService.refreshPage());
@Effect({dispatch: false})
public redirectToLogin: Observable<Action> = this.actions$
.ofType(AuthActionTypes.REDIRECT)
.ofType(AuthActionTypes.REDIRECT_TOKEN_EXPIRED, AuthActionTypes.REDIRECT_AUTHENTICATION_REQUIRED)
.do(() => this.authService.redirectToLogin());
/**