yiannis.gkoufas
08/19/2022, 9:34 AMThirdPartyEmailPassword.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
?rp_st
08/19/2022, 9:35 AMrp_st
08/19/2022, 9:35 AMrp_st
08/19/2022, 9:36 AMrp_st
08/19/2022, 9:36 AMyiannis.gkoufas
08/19/2022, 10:31 AMdisableDefaultUI: false,
it disables the prebuilt ui for the verification page right?rp_st
08/19/2022, 10:31 AMrp_st
08/19/2022, 10:32 AMsignInAndUpFeature
will only disable the sign up / sign in formrp_st
08/19/2022, 10:33 AMyiannis.gkoufas
08/19/2022, 10:35 AM/auth/verify-email
in case they are not verified?rp_st
08/19/2022, 10:37 AMgetRedirectionURL
function. One of them should be to email verification and then you can return the path to the email verification screen there.rp_st
08/19/2022, 10:37 AMyiannis.gkoufas
08/19/2022, 10:43 AMrp_st
08/19/2022, 10:45 AMrp_st
08/19/2022, 10:46 AMgetRedirectionURL
function and do a sign up? What is the output?rp_st
08/19/2022, 10:49 AMrp_st
08/19/2022, 10:49 AMyiannis.gkoufas
08/19/2022, 10:54 AMrp_st
08/19/2022, 10:57 AMyiannis.gkoufas
08/19/2022, 10:58 AMSuperTokens.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(),
],
});
rp_st
08/19/2022, 11:01 AM<SignInUp />
component?rp_st
08/19/2022, 11:01 AMyiannis.gkoufas
08/19/2022, 11:04 AMrp_st
08/19/2022, 11:04 AMyiannis.gkoufas
08/19/2022, 11:04 AM<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>
yiannis.gkoufas
08/19/2022, 11:05 AMyiannis.gkoufas
08/19/2022, 11:05 AMfunction 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;
rp_st
08/19/2022, 11:05 AMrp_st
08/19/2022, 11:05 AMrp_st
08/19/2022, 11:06 AMyiannis.gkoufas
08/19/2022, 11:08 AMyiannis.gkoufas
08/19/2022, 11:35 AMrp_st
08/19/2022, 12:00 PM