You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we think of a super fast way to check if a JWT has expired? In my application code which uses the refresh token model I can either: 1) Refresh my token every request (slow). 2) Try a request, catch failures, refresh the token, and try again. 3) Request some route to see if the token has expired (server still does some calculations). None of these are optimal, so is there any way we could develop a fast method for checking JWT expiration?
Maybe we use the recommended ping request of OPTIONS *. It always succeeds with no authentication, and fails fails with bad authentication. Of course doing authentication parsing could slow down other ping requests.
Side note, I haven't checked to see if a GET / request will fail with an expired token, but even if it does the server still does some calculations which aren't required.
The text was updated successfully, but these errors were encountered:
Can we think of a super fast way to check if a JWT has expired? In my application code which uses the refresh token model I can either: 1) Refresh my token every request (slow). 2) Try a request, catch failures, refresh the token, and try again. 3) Request some route to see if the token has expired (server still does some calculations). None of these are optimal, so is there any way we could develop a fast method for checking JWT expiration?
Maybe we use the recommended ping request of
OPTIONS *
. It always succeeds with no authentication, and fails fails with bad authentication. Of course doing authentication parsing could slow down other ping requests.Side note, I haven't checked to see if a
GET /
request will fail with an expired token, but even if it does the server still does some calculations which aren't required.The text was updated successfully, but these errors were encountered: