mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 18:14:17 +00:00
check Authentication Token both on SSR and CSR
This commit is contained in:
@@ -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() {
|
public checkAuthenticationToken() {
|
||||||
this.store.pipe(
|
|
||||||
select(getAuthenticationMethods),
|
|
||||||
filter((authMethods: AuthMethod[]) => isEmpty(authMethods)),
|
|
||||||
take(1)
|
|
||||||
).subscribe(() => {
|
|
||||||
this.store.dispatch(new CheckAuthenticationTokenAction());
|
this.store.dispatch(new CheckAuthenticationTokenAction());
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user