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
Currently, AUTH_SESSION tokens will expire after 1hr. If a currently authenticated user is working on the code-editor for more than an hour, they might become unauthenticated when a request is made to a protected route.
We require a mechanism to refresh the AUTH_SESSION token. For a start, here is what chatgpt suggests:
Implementing refresh tokens is a bit more involved than simply using an access token because it requires maintaining a record of the refresh tokens that are issued, handling their revocation, and managing their longer lifecycles. However, they are crucial for enhancing security and user experience.
Here's a high-level overview of the process, followed by a more detailed walkthrough:
High-Level Overview:
Issue Access and Refresh Tokens: Upon successful authentication, both an access token (short-lived) and a refresh token (longer-lived) are generated and sent to the client.
Store Refresh Tokens: Refresh tokens are stored server-side (database, cache, etc.) with metadata (user ID, issuance date, expiration, etc.).
Use Access Token for Authorization: The client sends the access token with each request for accessing protected resources.
Access Token Expires: Once the access token expires, the client can't access protected resources.
Request New Access Token with Refresh Token: When the access token expires, the client sends a request with the refresh token to get a new access token.
Validate Refresh Token: Before issuing a new access token, the server validates the refresh token against the stored tokens.
Issue New Access Token: If the refresh token is valid, a new access token (and possibly a new refresh token) is sent to the client.
Handle Refresh Token Expiry/Revocation: If a refresh token is expired or revoked, prompt the user to re-authenticate.
The text was updated successfully, but these errors were encountered:
Currently,
AUTH_SESSION
tokens will expire after 1hr. If a currently authenticated user is working on the code-editor for more than an hour, they might become unauthenticated when a request is made to a protected route.We require a mechanism to refresh the AUTH_SESSION token. For a start, here is what chatgpt suggests:
The text was updated successfully, but these errors were encountered: