What would be the best way to verify sessions with Next.JS and a custom UI? (Node + JS SDK) - Curren...
n
What would be the best way to verify sessions with Next.JS and a custom UI? (Node + JS SDK) - Currently I have a auth HOC that checks the session is valid, every authenticated page is under this HOC, but this means that on every navigation, the session must be verified again, sometimes this can make pages load a little slow. Is there a better way to do it?
r
hey @n000dles
you can use wrapper even with your custom UI
n
Oh really? I thought that was just for supertokens-auth-react?
r
the SessionAuth wrapper should not be slow though. Are you seeing a call to the email verification GET API on each page navigation?
if you are using auth-react on the frontend and have your custom UI using that, then you can use SessionAuth
if you are not using auth-react at all on the frontend and are using web-js on the frontend, then you will have to use the Session.doesSessionExist function on the frontend - like the docs say
n
Got it, I'll take a look. Thanks!
3 Views