Skip to content

How to check is accessToken valid without automatically refreshing it? #29454

Closed Answered by GaryAustin1
AljosaK asked this question in Questions
Discussion options

You must be logged in to vote

You could check the session for the expire time before you make the call and see if it is expired (not secure, but don't think that would matter for what you are doing). Then don't make getUser() call and do what you want to refresh if expired.

Otherwise you can server side decode the jwt with any jwt library and the jwt secret. Very soon you can decode with asymmetric key. https://github.com/orgs/supabase/discussions/29289

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by AljosaK
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants