diff --git a/README.md b/README.md index 750acf7..ce0cbf0 100644 --- a/README.md +++ b/README.md @@ -152,6 +152,8 @@ authService .getTokenPayload(): string // get the token ttl if available .getTtl(): Number + // get the token exp if available + .getExp(): Number ``` Additionally, you can use `AuthFilterValueConverter` and `AuthorizeStep` for UI feedback. diff --git a/src/authService.js b/src/authService.js index 25e09c6..25e6caf 100644 --- a/src/authService.js +++ b/src/authService.js @@ -101,6 +101,15 @@ export class AuthService { return authenticated; } + /** + * Gets ttl in seconds + * + * @returns {Number} ttl for JWT tokens, NaN for all other tokens + */ + getExp() { + return this.authentication.getExp(); + } + /** * Gets ttl in seconds *