How can I make the authToken last longer than a day before expiring?
Options
Eben
Member ✭
Hello,
I have this issue where after a day of inactivity, the authToken generated upon sign-in expires, making all the authenticated APIs return empty values with HTTP 401 error messages like this:
{"code":"ERROR_CODE_UNAUTHORIZED","message":"The token expired."}.
I've set up caching on my auth/me API to 7 days (which seems to be the max) but the token still expires after about a day of inactivity.
I have attached a screenshot of my auth/me settings below in case someone can help point out what I'm not doing well. Thank you.
[image.png]
I have this issue where after a day of inactivity, the authToken generated upon sign-in expires, making all the authenticated APIs return empty values with HTTP 401 error messages like this:
{"code":"ERROR_CODE_UNAUTHORIZED","message":"The token expired."}.
I've set up caching on my auth/me API to 7 days (which seems to be the max) but the token still expires after about a day of inactivity.
I have attached a screenshot of my auth/me settings below in case someone can help point out what I'm not doing well. Thank you.
[image.png]
Comments
-
You will want to change the "expiration" parameter in the "Create Authentication Token" for the auth/login and auth/signup APIs. The expiration parameter controls the length of time in seconds that the token will remain valid.
By default it is set to 86,400 seconds (60 sec X 60 min X 24 hrs = 86,400 seconds in a day). If you take 86,400 times 7 you will get the number of seconds in a week and that is how long your token on signup or login will remain valid. -
Thank you so much, Steve!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback