Replies: 1 comment 2 replies
-
The quickest way to definitely know whether an auth session is valid is to check |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I'm working on a nuxt3 project and trying to see if I can use directus as a backend.
A challange has been synchronizign the auth information between client and SSR contexts.
The setup
When a client logs in, I do:
The useCookie here just makes SSR friendly cookies copies of token and expiration.
When the page loads initially, in the SSR context, I initialize directus like this:
The problem
In the above setup, the client logs in and sets cookies, and the SSR the reads the cookie.
The issue i'm facing:
When a page loads, how can I check that an
auth_token
is valid? This way, I can redirect user to a login page. Is there a method to call in the js SDK to verify a token?Beta Was this translation helpful? Give feedback.
All reactions