-
-
Couldn't load subscription status.
- Fork 184
Open
Labels
enhancementAn improvement that needs to be addedAn improvement that needs to be addedp2Nice to haveNice to have
Description
Describe the feature
Hi,
im using the local provider with a FastAPI backend where i generate my JWT tokens where i also set the expiration value.
def generate_jwt_token(user: User) -> str:
return jwt.encode({
"exp": datetime.datetime.utcnow() + datetime.timedelta(minutes=int(JWT_EXP_MINUTES))
JWT_USER_PROPERTY: user.email
}, JWT_SECRET, algorithm=JWT_ALGORITHM)I looked into the codebase and saw that the cookie for the token only accepts the module config value for maxAgeInSeconds here
It would be really nice to be able to parse it from the expiration field of the JWT!
This way i don't need to keep attention to sync this value or use an extra ENV for my backend/frontend deployment
What are your thoughts?
How would you implement this?
I don't have any implementation ideas.
I think one would need to re-set _rawTokenCookie when a new token is set and it can be identified as a JWT
Additional information
- Would you be willing to help implement this feature?
Provider
- AuthJS
- Local
- Refresh
- New Provider
pdjohntony
Metadata
Metadata
Assignees
Labels
enhancementAn improvement that needs to be addedAn improvement that needs to be addedp2Nice to haveNice to have