Hello! I am trying to enable the email verificatio...
# support-questions-legacy
y
Hello! I am trying to enable the email verification feature in the thirdpartyemailpassword recipe but I am not sure about the configuration needed. If I do it like that:
Copy code
ThirdPartyEmailPassword.init({
            signInAndUpFeature: {
                providers: [Google.init()],
                disableDefaultUI: false,
            },
            emailVerificationFeature: {
                mode: "REQUIRED"
            },
            getRedirectionURL: async (context) => {
                if (context.action === "SIGN_IN_AND_UP") {
                    return "/";
                }
            },
        }),
i guess I have to create a new page and render the default component which is in
/auth/verify-email?rid=thirdpartyemailpassword
?
r
Get!
Hey^
The config change you have done is correct. But you don’t need to create a new route and the pre built ui will handle that for you.
Unless you are not using the pre built ui?
y
with this
disableDefaultUI: false,
it disables the prebuilt ui for the verification page right?
r
yes.
y
is there a component I can render myself? like the
r
But putting it in the
signInAndUpFeature
will only disable the sign up / sign in form
y
ah right, so in the case I am rendering myself the signinsignup page in / how can I redirect the user to
/auth/verify-email
in case they are not verified?
r
See the various values that are input to the
getRedirectionURL
function. One of them should be to email verification and then you can return the path to the email verification screen there.
It should also redirect you automatically to the screen though post sign up. Is that not happening?
y
on post signup it doesn't redirect me to /auth/verify-email
r
are you calling the sign up API yourself or via the pre built UI?
Can you print out the input to
getRedirectionURL
function and do a sign up? What is the output?
y
I use the prebuilt yeah let me check
r
Btw, if you are testing with google sign in, the email verification flow is not triggered.
cause google emails are already verified.
y
no no I try with a new email and it seems getRedirectionURL is not called at all
r
can i see the full supertokens.init call that you have made?
y
sure:
Copy code
SuperTokens.init({
    appInfo: {
        appName: "SuperTokens Demo App", // TODO: Your app name
        apiDomain: getApiDomain(), // TODO: Change to your app's API domain
        websiteDomain: getWebsiteDomain(), // TODO: Change to your app's website domain
    },
    recipeList: [
        ThirdPartyEmailPassword.init({
            signInAndUpFeature: {
                providers: [Google.init()],
                disableDefaultUI: false,
            },
            emailVerificationFeature: {
                mode: "REQUIRED"
            },
            getRedirectionURL: async (context) => {
                console.log(context);
                if (context.action === "SIGN_IN_AND_UP") {
                    console.log("Context");
                    console.log(context);
                    return "/";
                }
            },
        }),
        Session.init(),
    ],
});
r
Can I see how you have embedded the
<SignInUp />
component?
Can we get on a quick call to debug? this is strange
y
yeah, let me post the code first in case I am doing something clearly wrong:
r
okay
y
Copy code
<SuperTokensWrapper>
          <div className="App">
              <Router>
                  <div className="fill">
                      <Routes>
                          {/* This shows the login UI on "/auth" route */}
                          {getSuperTokensRoutesForReactRouterDom(require("react-router-dom"))}

                          <Route
                              path="/"
                              element={
                                  /* This protects the "/" route so that it shows
                                      <Home /> only if the user is logged in.
                                      Else it redirects the user to "/auth" */
                                  <Home/>
                              }
                          />
                              <Route path="/foo" element={
                                  <ThirdPartyEmailPasswordAuth>
                                  <div>Foo bar!</div>
                                  </ThirdPartyEmailPasswordAuth>
                              }></Route>

                      </Routes>
                  </div>
              </Router>
          </div>
      </SuperTokensWrapper>
and the home component is:
Copy code
function Home(){
    let session = useSessionContext();
    if (session.loading) {
        // Session loading is generally very fast, so we do not recommend you to use a loading screen here.
        return null;
    }
    if (session.doesSessionExist) {
        return <div>Hello there!</div>
    } else {
        return <div>
            Hello there but login please!
            <SignInAndUp></SignInAndUp>

        </div>
    }
}
export default Home;
r
this seems fine.
i'll send a zoom link
Join Zoom Meeting https://us06web.zoom.us/j/83992222534?pwd=cDcyWkNhZENFbG92M3Q1QUYvQjArQT09 Meeting ID: 839 9222 2534 Passcode: 720720 One tap mobile +13092053325,,83992222534#,,,,*720720# US +13126266799,,83992222534#,,,,*720720# US (Chicago) Dial by your location +1 309 205 3325 US +1 312 626 6799 US (Chicago) +1 346 248 7799 US (Houston) +1 386 347 5053 US +1 564 217 2000 US +1 646 931 3860 US +1 669 444 9171 US +1 669 900 6833 US (San Jose) +1 719 359 4580 US +1 929 205 6099 US (New York) +1 253 215 8782 US (Tacoma) +1 301 715 8592 US (Washington DC) Meeting ID: 839 9222 2534 Passcode: 720720 Find your local number: https://us06web.zoom.us/u/kboLpYDRjz
y
joining in 1 minute
thanks so much!!!
r
happy to help 🙂
6 Views