Skip to content

fix: handle tokens properly and recreate session on token expiry#261

Merged
jonathanlab merged 2 commits intomainfrom
jonathan/token-refresh
Dec 15, 2025
Merged

fix: handle tokens properly and recreate session on token expiry#261
jonathanlab merged 2 commits intomainfrom
jonathan/token-refresh

Conversation

@jonathanlab
Copy link
Copy Markdown
Contributor

We seemed to be having two issues with auth:

  1. There might have been stale tokens whenever we used them. I added a getPosthogApiKey so we should have a guarantee of no stale keys
  2. We were not recreating the session with claude code sdk whenever our oauth token needed to be refreshed. Now if we hit a 401 from the gateway, we should be properly recreating the session with the up to date token.

@jonathanlab jonathanlab requested a review from a team as a code owner December 15, 2025 14:44
@jonathanlab jonathanlab merged commit c38c5a6 into main Dec 15, 2025
10 checks passed
@jonathanlab jonathanlab deleted the jonathan/token-refresh branch December 15, 2025 16:21
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