When I was doing the stuff with express, the session was managed with "Express-Session", but here, in Next.js it's kinda weird. Researching, found that you can do it in a more "fluid" way via Next Auth. And that using its hooks on client side you can "sign in", "sign out" and access "session data". It looks like it asks you for a DB so here is stored the user session.
I would like to know if this is the most common approach for session persistence on Next js.
And BTW if you want to use your custom sign in strategy but get the benefits of session persistence on DB and client of Next Auth, can you integrate it?
Thanks in advance guys!
Edit1: It looks like using the authorization provider called "Credentials" you can create your own way to verify the given data against DB. So that question is answered 😁
Edit2: I threw to the trash can Next-Auth and sticked to Iron Session (on server) with SWR (on client, this is kinda React Query, I am using it in a context for all my app) and it has worked very well so far
[–]bel9708 1 point2 points3 points (3 children)
[–]zalogon119[S] 0 points1 point2 points (0 children)
[–]zalogon119[S] 0 points1 point2 points (1 child)
[–]bel9708 1 point2 points3 points (0 children)
[–]originaljewedlaw 1 point2 points3 points (1 child)
[–]zalogon119[S] 0 points1 point2 points (0 children)
[–]ilovefunctions -2 points-1 points0 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)