funk101
05/06/2022, 8:37 AMEmailPasswordReact
and SessionReact
. However, when trying to customize the SignIn UI, I'm getting an error: Error: No instance of EmailPassword found. Make sure to call the EmailPassword.init method
. Do I need to modify the code to use EmailPassword
and not EmailPasswordReact
?rp_st
05/06/2022, 8:38 AMrp_st
05/06/2022, 8:38 AMrp_st
05/06/2022, 8:39 AMfunk101
05/06/2022, 8:39 AMrp_st
05/06/2022, 8:39 AMrp_st
05/06/2022, 8:40 AMfunk101
05/06/2022, 8:40 AMexport const frontendConfig = () => {
return {
appInfo,
recipeList: [
EmailPasswordReact.init({
signInAndUpFeature: {
disableDefaultImplementation: true,
},
getRedirectionURL: async (context) => {
if (context.action === "SIGN_IN_AND_UP") {
return "/signin";
}
},
}),
SessionReact.init(),
],
};
};
funk101
05/06/2022, 8:40 AMrp_st
05/06/2022, 8:40 AMfunk101
05/06/2022, 8:40 AMfunk101
05/06/2022, 8:41 AMrp_st
05/06/2022, 8:41 AMfunk101
05/06/2022, 8:41 AMrp_st
05/06/2022, 8:41 AMfunk101
05/06/2022, 8:42 AMrp_st
05/06/2022, 8:42 AMfunk101
05/06/2022, 8:42 AMrp_st
05/06/2022, 8:42 AMfunk101
05/06/2022, 8:42 AMimport React from "react";
import SuperTokensReact from "supertokens-auth-react";
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());
}
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
export default MyApp;
rp_st
05/06/2022, 8:43 AMrp_st
05/06/2022, 8:43 AMSignIn
component you have made is getting server side renderedrp_st
05/06/2022, 8:43 AMrp_st
05/06/2022, 8:44 AMSignIn
only if it's on the client sidefunk101
05/06/2022, 8:45 AMfunk101
05/06/2022, 8:46 AMfunk101
05/06/2022, 8:46 AMrp_st
05/06/2022, 8:46 AMrp_st
05/06/2022, 8:47 AMdynamic
HOC provided by nextjsrp_st
05/06/2022, 8:47 AMfunk101
05/06/2022, 8:50 AMrp_st
05/06/2022, 8:50 AMrp_st
05/06/2022, 8:50 AMfunk101
05/06/2022, 8:51 AMfunk101
05/06/2022, 8:51 AMrp_st
05/06/2022, 8:54 AMimport { SignInAndUp } from "supertokens-auth-react/recipe/emailpassword";
import dynamic from 'next/dynamic'
const SignInAndUpNoSSR = dynamic(
new Promise<any>((res) =>
res(SignInAndUp)
),
{ ssr: false }
)
export default function SignIn() {
return (
<div>
<SignInAndUpNoSSR />
</div>
);
}
funk101
05/06/2022, 8:57 AMrp_st
05/06/2022, 9:02 AMfunk101
05/06/2022, 9:03 AM<SignInAndUpNoSSR>
<div>
<input type="email" />
</div>
<div>
<input type="password" />
</div>
<div>
<button>Sign In</button>
</div>
</SignInAndUpNoSSR>
funk101
05/06/2022, 9:03 AMrp_st
05/06/2022, 9:03 AMrp_st
05/06/2022, 9:03 AMrp_st
05/06/2022, 9:04 AMfunk101
05/06/2022, 9:04 AMfunk101
05/06/2022, 9:06 AMfunk101
05/06/2022, 9:07 AMfunk101
05/06/2022, 9:08 AMrp_st
05/06/2022, 9:28 AM