funk101
05/11/2022, 4:51 PMfunk101
05/11/2022, 4:51 PMimport React from "react";
import dynamic from "next/dynamic";
import SuperTokensReact from "supertokens-auth-react";
import EmailPassword from "supertokens-auth-react/recipe/emailpassword";
import { frontendConfig } from "../config/frontendConfig";
if (typeof window !== "undefined") {
// we only want to call this init function on the frontend, so we check typeof window !== 'undefined'
SuperTokensReact.init(frontendConfig());
}
const EmailPasswordAuthNoSSR = dynamic(
new Promise((res) => res(EmailPassword.EmailPasswordAuth)),
{ ssr: false }
);
function MyApp({ Component, pageProps }) {
return (
<EmailPasswordAuthNoSSR>
<Component {...pageProps} />;
</EmailPasswordAuthNoSSR>
);
}
export default MyApp;
TH
05/11/2022, 6:53 PMTH
05/11/2022, 6:55 PMfunk101
05/12/2022, 4:23 AMfunk101
05/12/2022, 4:24 AMEmailPasswordSignIn_Override: ({ DefaultComponent, ...props }) => {
return (
<Layout
pageTitle="SignIn/Register"
contentTitle="SignIn/Register"
metaDescription="Meta description here"
canonical="/auth"
>
<SingleColumnLayout>
<DefaultComponent {...props} />
</SingleColumnLayout>
</Layout>
);
},
funk101
05/12/2022, 4:24 AMfunk101
05/12/2022, 4:24 AMrp
05/12/2022, 4:26 AMfunk101
05/12/2022, 4:27 AMfunk101
05/12/2022, 4:28 AMrp
05/12/2022, 4:28 AMrp
05/12/2022, 4:29 AMfunk101
05/12/2022, 4:30 AMfunk101
05/12/2022, 5:38 AMrp
05/12/2022, 5:40 AM<SuperTokensComponentNoSSR />
. You can do the same and add a footer / header and stuff to that page - this will affect all the pages shown by supertokens. Should be easier for you to implementfunk101
05/12/2022, 5:42 AMfunk101
05/12/2022, 5:42 AMrp
05/12/2022, 5:43 AMfunk101
05/12/2022, 5:46 AMrp
05/12/2022, 5:48 AMfunk101
05/12/2022, 6:39 AMfunk101
05/12/2022, 6:42 AMfunk101
05/12/2022, 1:59 PM<div data-supertokens="container" class="react-shadow-6rs9u2">...</div>
funk101
05/12/2022, 2:04 PMfunk101
05/12/2022, 2:04 PMmwill8886
05/12/2022, 7:04 PMredirect_uri
, that page handles the /auth/signinup
, how should I properly handle sending my user back to the initial protected page?rp
05/12/2022, 8:40 PM