gin-jwt
gin-jwt copied to clipboard
Can I set The timeout time so tokens never expire?
I want the user to be logged out after a week of not using the site. How can I do this?
Refresh the token at the end of the week.
even you refresh the token, the old token is also can be use. so maybe you can create a blacklist to stop using the old token
You can pass something like this to Timeout:
Timeout: time.Duration(24*365) * time.Hour, // one year
I'm not sure if it's good solution, but it works :)
@DevAlone yes but this will set the timeout for one year only, what happens after one year...
@appleboy : thanks for this amazing work. For setting token that never expires, do you provide something like "Timeout: 0,"?
@viseth why don't you try to set expiration to 100 years?