Skip to content

JWT expired not being renewed #51

Answered by acupofjose
rhuanbarros asked this question in Q&A
Discussion options

You must be logged in to vote

Ooo my. That's a fantastic catch! I'll make a quick change and push an update to gotrue-csharp.

But you're correct, ideally the session would be validated by the retriever before being returned. Gotrue-csharp will take the returned session and attempt to refresh it's token and everything. This will fail if the session is invalid.

The easiest way to do it (IMO) is to do isValid = await Supabase.Auth.GetUser(savedSession.Token) (you get the idea). Or you can check the CreatedAt vs. the ExpiredAt.

The CreatedAt not being set correctly does produce issues with the token being automatically refreshed - so this update will fix that!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@rhuanbarros
Comment options

Answer selected by rhuanbarros
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants