Hey, i am getting a blank screen after signup then the email verification is set to required. I dont get any kind of error messages. No erros in borwser console, lo failing network requests, no backend errors.
I am using the latest versions of supertokens_python and supertokens react. I am using the thirdpartyemailpassword recipe. What can i do to fix this?
r
rp_st
05/26/2023, 4:14 AM
Hey.
rp_st
05/26/2023, 4:14 AM
Can you show how you have added our routes to your react app?
l
Luca
05/26/2023, 4:18 AM
I am using NextJS. I added the file src/pages/auth/[[...path]].tsx with the following content:
Copy code
import React, { useEffect } from 'react'
import dynamic from 'next/dynamic'
import { ThirdPartyEmailPasswordPreBuiltUI } from "supertokens-auth-react/recipe/thirdpartyemailpassword/prebuiltui";
import { redirectToAuth } from 'supertokens-auth-react'
import { canHandleRoute, getRoutingComponent } from 'supertokens-auth-react/ui'
const SuperTokensComponentNoSSR = dynamic<{}>(
new Promise((res) => res(() => getRoutingComponent([ThirdPartyEmailPasswordPreBuiltUI]))),
{ ssr: false }
)
export default function Auth() {
// if the user visits a page that is not handled by us (like /auth/random), then we redirect them back to the auth page.
useEffect(() => {
if (canHandleRoute([ThirdPartyEmailPasswordPreBuiltUI]) === false) {
redirectToAuth()
}
}, [])
return (
<SuperTokensComponentNoSSR />
)
}
r
rp_st
05/26/2023, 4:18 AM
You also need to add EmailVerificationPreBuiltUI to the array in canHandleRoute and getRoutingComponent.
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).