mwill8886
05/13/2022, 6:21 PMThirdPartyEmailPassword
to wrap my components but when I try to access a protected route including url search params, only the base of the route is send to the auth page as the redirectToPath and does not include my url search params.
I'd prefer not to roll my own wrapper, so is there a way to configure ThirdPartyEmailPassword
to include url search params in the redirectToPath?
If not, I figure i have to create my own wrapper that checks if the user is logged in. I've tried importing supertokens-website
into my NextJS app, import SuperTokens from 'supertokens-website'
, however whenever I try to access SuperTokens.doesSessionExist()
i get an error stating that SuperTokens is undefined. I have initialized SuperTokens in the _app.ts file. I can use supertokens-auth-react
but not supertokens-website
.rp_st
05/13/2022, 6:23 PM<ThirdPartyEmailPasswordAuth requireAuth={false}>...</ThirdPartyEmailPasswordAuth>
This will allow your child component to render even if the user is not logged in, and in there, you can use the session context to see check if a user is not logged in and then redirect them to wherever you like with the query params intact.mwill8886
05/13/2022, 6:36 PMsupertokens-website
?rp_st
05/13/2022, 6:36 PMrp_st
05/13/2022, 6:36 PMrp_st
05/13/2022, 6:37 PMmwill8886
05/13/2022, 7:57 PMdoesSessionExist
returns false even after sign up. We do have our own UI for the signup and login screens following: https://supertokens.com/blog/adding-social-login-to-your-website-with-supertokens
I don't know if that's effecting it or not.mwill8886
05/13/2022, 8:23 PM<ThirdPartyEmailPasswordAuth requireAuth={false}>
then checked the context in the individual pages. Now the context comes back correctly.SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).
Powered by