store token on AUTHENTICATED_SUCCESS action

This commit is contained in:
Giuseppe Digilio
2020-06-11 14:15:19 +02:00
parent ea26597b6a
commit 6bd04c94ec
2 changed files with 9 additions and 2 deletions

View File

@@ -65,7 +65,6 @@ export class AuthEffects {
@Effect()
public authenticateSuccess$: Observable<Action> = this.actions$.pipe(
ofType(AuthActionTypes.AUTHENTICATE_SUCCESS),
tap((action: AuthenticationSuccessAction) => this.authService.storeToken(action.payload)),
map((action: AuthenticationSuccessAction) => new AuthenticatedAction(action.payload))
);
@@ -82,6 +81,7 @@ export class AuthEffects {
@Effect()
public authenticatedSuccess$: Observable<Action> = this.actions$.pipe(
ofType(AuthActionTypes.AUTHENTICATED_SUCCESS),
tap((action: AuthenticatedSuccessAction) => this.authService.storeToken(action.payload.authToken)),
map((action: AuthenticatedSuccessAction) => new RetrieveAuthenticatedEpersonAction(action.payload.userHref))
);