Hey, i am getting a blank screen after signup then the email verification is set to required. I dont...
l
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
Hey.
Can you show how you have added our routes to your react app?
l
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
You also need to add EmailVerificationPreBuiltUI to the array in canHandleRoute and getRoutingComponent.
l
oh
thanks 🙂
7 Views