mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-15 05:53:03 +00:00
Fixes
This commit is contained in:
@@ -8,8 +8,12 @@ export class AuthTokenInfo {
|
||||
|
||||
constructor(token: string) {
|
||||
this.accessToken = token.replace('Bearer ', '');
|
||||
const tokenClaims = decode(this.accessToken);
|
||||
// exp claim is in seconds, convert it se to milliseconds
|
||||
this.expires = tokenClaims.exp * 1000;
|
||||
try {
|
||||
const tokenClaims = decode(this.accessToken);
|
||||
// exp claim is in seconds, convert it se to milliseconds
|
||||
this.expires = tokenClaims.exp * 1000;
|
||||
} catch (err) {
|
||||
this.expires = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user