Commit 8629c38
authored
fix(auth): improve token expiry precision and org ID (#10)
<!-- mesa-description-start -->
## 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.
<sup>_Description generated by Mesa. [Update
settings](https://app.mesa.dev/onkernel/settings/pull-requests)_</sup>
<!-- mesa-description-end -->1 parent 556ab5b commit 8629c38
2 files changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
| 124 | + | |
125 | 125 | | |
126 | 126 | | |
127 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
274 | 277 | | |
275 | 278 | | |
276 | 279 | | |
| |||
316 | 319 | | |
317 | 320 | | |
318 | 321 | | |
| 322 | + | |
319 | 323 | | |
320 | 324 | | |
321 | 325 | | |
| |||
0 commit comments