Skip to content

Conversation

@gbirman
Copy link
Contributor

@gbirman gbirman commented Jan 2, 2026

Summary

Screenshots, GIFs, and Videos

@gbirman gbirman requested a review from a team as a code owner January 2, 2026 20:20
@gbirman gbirman requested a review from synoet January 2, 2026 20:20
@synoet
Copy link
Contributor

synoet commented Jan 2, 2026

Rejection might be right to remove. But I think we should keep leeway at zero.

@gbirman
Copy link
Contributor Author

gbirman commented Jan 2, 2026

why do you think we should keep leeway at zero?

@gbirman
Copy link
Contributor Author

gbirman commented Jan 2, 2026

ok i think we should actually have both, leeway to account for potential clock skew between fusion auth and our own auth, and then the reject early to prevent downstream 401s that initially pass. there's a separate issue in the front end though about ensuring that our refresh propagates correctly. useUserInfo for instance will 401 due to a jwt expiry and then never refresh its false state which is why we see the banner in the Dock component. if we can a) maximize a token's lifetime but also b) ensure that the occasional rejection flows through to the auth state in the front end we'll be able to fix this

let mut validation = Validation::new(Algorithm::HS256);

validation.leeway = 0;
validation.leeway = 30;
Copy link
Member

Choose a reason for hiding this comment

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

this is the default so you could just remove thisa

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@whutchinson98 whutchinson98 left a comment

Choose a reason for hiding this comment

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

Instead lets have leeway set to something reasonable like 5 to account for any clock skew and then remove the reject_tokens_expiring_in_less_than all together.

@gbirman
Copy link
Contributor Author

gbirman commented Jan 5, 2026

reverting to default because we already have things hardcoded elsewhere to account for 60s leeway, e.g. packages/core/signal/token.ts. don't want to sneakily break things between this and macro-api too so both will just use default for now

@gbirman gbirman merged commit 1b71370 into main Jan 5, 2026
35 checks passed
@gbirman gbirman deleted the gab/chore/add-leeway-instead-of-rejecting-tokens-expiring branch January 5, 2026 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants