Skip to content

Commit

Permalink
fix(auth): use access token when expiration date is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
seth2810 committed Aug 4, 2024
1 parent 0d95a79 commit 0e01ce3
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/http/AuthManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ export class AuthManager {
*/
async getToken(): Promise<string> {
if (this.config.accessToken) {
// non-expirable token
if (typeof this.privateConfig.tokenExpireAt === 'undefined') {
return this.config.accessToken;
}

// check if token is expired
if (Date.now() < this.privateConfig.tokenExpireAt) {
// return already defined access token
Expand Down

0 comments on commit 0e01ce3

Please sign in to comment.