Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃殌 Feature: Introduce Custom JWT Expiration Date Support #7602

Closed
2 tasks done
Edijae opened this issue Feb 17, 2024 · 2 comments
Closed
2 tasks done

馃殌 Feature: Introduce Custom JWT Expiration Date Support #7602

Edijae opened this issue Feb 17, 2024 · 2 comments
Labels
discussion Gathering community feedback product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.

Comments

@Edijae
Copy link

Edijae commented Feb 17, 2024

馃敄 Feature description

I have my own API server that communicates with the Appwrite Node.js server. When a user logs in, I use the createEmailSession method provided by Appwrite to authenticate the user and then generate a JWT token using the createJWTToken method. This JWT token is included in the response sent back to the user. Subsequently, when the user makes another API call, I authenticate them on their behalf in the backend and grant access to the resources they request.

However, a challenge arises because the JWT token expires quickly, forcing users to frequently log in. Is there a way to extend the expiration time of the JWT token to improve the user experience?

馃帳 Pitch

It would help increase jwt session period without user having to keep login in.

馃憖 Have you spent some time to check if this issue has been raised before?

  • I checked and didn't find similar issue

馃彚 Have you read the Code of Conduct?

@eldadfux eldadfux added product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services. feature discussion Gathering community feedback labels Feb 19, 2024
@Swinkid
Copy link
Contributor

Swinkid commented Feb 21, 2024

Assuming you're using one of the login methods (In your case createEmailSession), Can you not store the session/token/jwt in browser after createEmailSession and get the session ID and use:
updateSession
getSession

Also see https://appwrite.io/docs/references/cloud/models/session

Not tried this personally so apologies if you've tried already.

Perhaps it's worth a discussion on whether the libraries should handle how to store tokens/sessions locally and handling refreshing?

@stnguyen90
Copy link
Contributor

If you're looking for configurable JWT durations, please add a 馃憤馃徏 to #5263.

Btw, we're working on some changes that allow better session handling in custom backends. Stay tuned for that.

For now, I'm going to close this as a duplicate.

@stnguyen90 stnguyen90 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Gathering community feedback product / auth Fixes and upgrades for the Appwrite Auth / Users / Teams services.
Projects
None yet
Development

No branches or pull requests

4 participants