Hi, I read the official doc, and I saw that I can setting up a
tokenExpiration
field, but I need that the system never expires.
Would an api-key work better for you? Cookies have a hard limit of 400 days mandated by the browser. You could enable api-keys on your user collection and then use an api-key authenticate with infinitely. Here’s some more info about them:
https://payloadcms.com/docs/authentication/config#api-keysThere's not exist someway to use jwt?
You can also use JWT yeah!
Authorization: JWT your-token-here
Yes but using JWT passing by Authorization, keeps expiring
There's exist some way to avoid JWT expiration?
Not really, the intention of JWTs and this kind of "temporary token authorisation" is the fact that they expire, what you're really looking for is the API key linked above, that is also going to have the behaviour you want of not expiring.
Any other solution to get JWTs to behave like an API key would just be hacky and not recommended
Hey @Japineda16 do you have any follow up questions here? If not I'll close this one out. Thanks!
Star
Discord
online
Get help straight from the Payload team with an Enterprise License.