Skip to content

Fix 401 issue when no refresh token#2181

Merged
gary149 merged 1 commit intomainfrom
fix-token-issues
Mar 16, 2026
Merged

Fix 401 issue when no refresh token#2181
gary149 merged 1 commit intomainfrom
fix-token-issues

Conversation

@coyotte508
Copy link
Member

No description provided.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 73f92b67c1

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +180 to +181
if (new Date() > session.oauth.token.expiresAt) {
return { user: null, invalidateSession: true };

Choose a reason for hiding this comment

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

P1 Badge Avoid invalidating session for expired non-refreshable token

This branch logs the user out whenever an access token expires and no refresh token is present, but authenticateRequest converts invalidateSession: true into a full session reset, not just token removal. For OIDC providers that do not issue refresh tokens (a common setup), this effectively limits login lifetime to the OAuth access-token TTL and forces repeated re-authentication even when the app could continue with a valid local session and simply omit locals.token for token-dependent features.

Useful? React with 👍 / 👎.

Copy link
Member Author

@coyotte508 coyotte508 Mar 14, 2026

Choose a reason for hiding this comment

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

not useful the oauth token is needed for inference calls

@gary149 gary149 merged commit 6859cbe into main Mar 16, 2026
6 checks passed
@gary149 gary149 deleted the fix-token-issues branch March 16, 2026 10:26
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