Skip to content

fix: improve token expiration logic to prefer JWT expiry over stale config#10

Open
anserwaseem wants to merge 1 commit into
mainfrom
issue/5
Open

fix: improve token expiration logic to prefer JWT expiry over stale config#10
anserwaseem wants to merge 1 commit into
mainfrom
issue/5

Conversation

@anserwaseem

Copy link
Copy Markdown
Contributor

No description provided.

@anserwaseem anserwaseem self-assigned this Jun 19, 2026
Comment thread src/auth/token.ts
export function isTokenExpired(idToken: string, expiresAt?: number, bufferSeconds = 60): boolean {
const expiry = normalizeExpiresAt(expiresAt) ?? getIdTokenExpiryMs(idToken);
const jwtExpiry = getIdTokenExpiryMs(idToken);
const configExpiry = normalizeExpiresAt(expiresAt);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should remove the config expiresAt completely, its not needed anymore

we added this initially when we did not used to have the refresh mechanism, as we have the refresh mechanism, this config exp becomes stale, the no point in storing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants