check Authentication Token both on SSR and CSR

This commit is contained in:
Giuseppe Digilio
2020-01-17 11:50:07 +01:00
parent afe70bc546
commit 0eac9c6369

View File

@@ -169,16 +169,10 @@ export class AuthService {
}
/**
* Checks if token is present into browser storage and is valid. (NB Check is done only on SSR)
* Checks if token is present into browser storage and is valid.
*/
public checkAuthenticationToken() {
this.store.pipe(
select(getAuthenticationMethods),
filter((authMethods: AuthMethod[]) => isEmpty(authMethods)),
take(1)
).subscribe(() => {
this.store.dispatch(new CheckAuthenticationTokenAction());
});
}
/**