andrewbyrley
03/04/2024, 10:20 AMgetRedirectionURL: async (context) => {
if (context.action === "SUCCESS") {
// https://supertokens.com/docs/thirdpartyemailpassword/advanced-customizations/frontend-hooks/redirection-callback
if (context.redirectToPath !== undefined) {
// console.log("undefined redirecting to path: " + context.redirectToPath)
// we are navigating back to where the user was before they authenticated
return context.redirectToPath;
}
if (context.isNewPrimaryUser) {
// console.log("new primary user")
// user signed up
return "/signup";
} else {
// console.log("existing user")
// user signed in
}
return "/";
}
return undefined;
}