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
rp_st
11/23/2022, 9:26 AM
hey @n000dles
rp_st
11/23/2022, 9:26 AM
you can use wrapper even with your custom UI
n
n000dles
11/23/2022, 9:27 AM
Oh really? I thought that was just for supertokens-auth-react?
r
rp_st
11/23/2022, 9:27 AM
the SessionAuth wrapper should not be slow though. Are you seeing a call to the email verification GET API on each page navigation?
rp_st
11/23/2022, 9:27 AM
if you are using auth-react on the frontend and have your custom UI using that, then you can use SessionAuth
rp_st
11/23/2022, 9:28 AM
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
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).