michael_pxr
03/28/2024, 12:45 PMpages/auth/[[...path]].tsx
)? If so, where do I put my components? If not, which file should I use?
- The example of the custom email password signin [2] only shows the callback function. Is there an example of building a custom UI in NextJS?
- Is there a certain structure to keep in mind such that I can easily later add alternative signin/signup methods?
[1]: https://supertokens.com/docs/emailpassword/nextjs/setting-up-frontend
[2]: https://supertokens.com/docs/emailpassword/custom-ui/email-password-loginrp_st
03/28/2024, 2:15 PMrp_st
03/28/2024, 2:15 PMmichael_pxr
03/28/2024, 2:30 PMEmailPasswordPreBuildUI
to MyOwnCustomEmailPasswordUI
?
tsx
const SuperTokensComponentNoSSR = dynamic<{}>(
new Promise((res) => res(() => getRoutingComponent([MyOwnCustomEmailPasswordUI]))),
{ 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([MyOwnCustomEmailPasswordUI]) === false) {
redirectToAuth()
}
}, [])
return (
<SuperTokensComponentNoSSR />
)
}
michael_pxr
03/28/2024, 2:31 PMgetRoutingComponent
and canHandleRoute
expect type PreBuiltRecipes
, I'm expecting that this is not the right approach.