Next Auth integration with Laravel Sanctum Session
Unanswered
Capelin posted this in #help-forum
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
CapelinOP
Hello, i wanna know if there's a video tutorial or blog of integrating next auth with laravel sanctum session. I have been searching for it and all of them are JWT based authentication.
I know this is not a "help" but i cant post a message in discussion channel
Thank you.
I know this is not a "help" but i cant post a message in discussion channel
Thank you.
6 Replies
![Avatar](https://cdn.discordapp.com/avatars/194128415954173952/708a8637ada505b6b7a85972807d9dca.webp?size=256)
Alfonsus Ardani
This is considered a help, and you can also still discuss it in #NextAuth.js but you've created a post now
If laravel is already managing the session + authentication, i dont think theres a need to use NextAuth anymore
![Avatar](https://cdn.discordapp.com/embed/avatars/2.png)
CapelinOP
But how can i manage the session on the frontend side?
Like, if i want to retrieve authenticated data in server components, and expire the authentication.
Like, if i want to retrieve authenticated data in server components, and expire the authentication.
![Avatar](https://cdn.discordapp.com/avatars/194128415954173952/708a8637ada505b6b7a85972807d9dca.webp?size=256)
Alfonsus Ardani
If your laravel store cookie in the client, you can get the users cookis using cookies() in nextjs
Then you can use that token from cookie, be checked against the laravel server
Expiring the session can simply be done by directly calling the laravel server and removing the cookies. Then you can just refresh the site and you wont be authenticated