Skip to content

Conversation

@masnwilliams
Copy link
Contributor

@masnwilliams masnwilliams commented Sep 4, 2025

TL;DR

Fixes a bug in the token refresh logic that caused premature token expiry and incorrect organization ID handling.

Why we made these changes

The previous token refresh logic used imprecise, integer-based timestamps for calculating token expiry. This could cause the CLI to assume a token was expired when it was still valid, forcing unnecessary logouts and disrupting user workflows. Additionally, the organization_id was not correctly persisted during a refresh, which could lead to context-related errors.

What changed?

  • Switched from seconds to milliseconds for token expiry calculations to improve precision and prevent premature expiration.
  • Ensured the organization_id is correctly requested and stored during the token refresh flow.

Description generated by Mesa. Update settings

Copy link

@mesa-dot-dev mesa-dot-dev bot left a comment

Choose a reason for hiding this comment

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

Performed full review of 556ab5b...9904c2d

Tip

⚡ Quick Actions

This review was generated by Mesa.

Actions:

Slash Commands:

  • /review - Request a full code review
  • /review latest - Review only changes since the last review
  • /describe - Generate PR description. This will update the PR body or issue comment depending on your configuration
  • /help - Get help with Mesa commands and configuration options

2 files reviewed | 3 comments | Review on Mesa | Edit Reviewer Settings

@masnwilliams masnwilliams requested a review from rgarcia September 4, 2025 05:16
@masnwilliams masnwilliams merged commit 8629c38 into main Sep 4, 2025
2 checks passed
@masnwilliams masnwilliams deleted the mason/refresh-token-fix branch September 4, 2025 15:24
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.

3 participants