Replies: 2 comments 1 reply
-
The following article mght help you |
Beta Was this translation helpful? Give feedback.
-
Create a protected layout file. And return from your api |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey,
I'm trying to set up Auth.js v5 with Next.js 14 and struggling a lot, probably due to me learning how Auth.js works at the same time.
My backend is an external API that takes credentials and sends me back three cookies: a split-cookies access token and a refresh token. These cookies are my source of truth because the app is useless if the user can't get data from my API, so I want to keep Auth.js in sync with them.
The session token from Auth.js (
__Secure-authjs.session-token
) refreshes its expiration date automatically all the time when I interact with the app, but I would like it to constantly be equal to my refresh token's. This refresh token is itself refreshed for a month every time I use it, which is only when my main access token gets stale (every 30min).I have tried something like that but to no avail. The session token keeps updating its expiration date:
I have searched the v4 docs and what's existing for the v5 docs multiple times and I can't seem to find any info on how to do that, google isn't much help either.
Usually when that's the case, it means I'm approaching it wrong, so maybe that's the case here?
Beta Was this translation helpful? Give feedback.
All reactions