funk101
06/12/2022, 4:48 AMEmailPasswordReact.init({
getRedirectionURL: async (context) => {
if (context.action === "SUCCESS") {
if (context.redirectToPath !== undefined) {
// navigate back to where the user was before authenticated
return context.redirectToPath;
}
return "/dashboard";
}
return undefined;
},rp_st
06/12/2022, 6:00 AMfunk101
06/12/2022, 6:15 AMfunk101
06/12/2022, 6:17 AMfunk101
06/12/2022, 6:18 AMfunk101
06/12/2022, 6:18 AMreturn /dashboard, does the user get redirected back to where they came from by default?rp_st
06/12/2022, 6:21 AMcontext.redirectToPath should not be undefined.funk101
06/12/2022, 6:21 AMrp_st
06/12/2022, 6:21 AMcontext.redirectToPath should be where they were before. So it should take them therefunk101
06/12/2022, 6:22 AMreturn /dashboard I should have return context.redirectToPath right?rp_st
06/12/2022, 6:22 AMif (context.redirectToPath !== undefined) {
// navigate back to where the user was before authenticated
return context.redirectToPath;
}funk101
06/12/2022, 6:23 AMrp_st
06/12/2022, 6:23 AMrp_st
06/12/2022, 6:23 AMcontext.redirectToPath === undefinedrp_st
06/12/2022, 6:24 AMfunk101
06/12/2022, 6:24 AMfunk101
06/12/2022, 6:25 AMfunk101
06/12/2022, 6:26 AMfunk101
06/12/2022, 6:27 AMfunk101
06/12/2022, 6:27 AMfunk101
06/12/2022, 6:28 AMfunk101
06/12/2022, 6:28 AMrp_st
06/12/2022, 6:29 AMfunk101
06/12/2022, 6:30 AMrp_st
06/12/2022, 6:31 AMfunk101
06/12/2022, 6:31 AMconst handleAddToCart = () => {}rp_st
06/12/2022, 6:31 AMfunk101
06/12/2022, 6:31 AMrp_st
06/12/2022, 6:32 AMfunk101
06/12/2022, 6:32 AMrp_st
06/12/2022, 6:32 AMrp_st
06/12/2022, 6:32 AMredirectToAuth function we provide?funk101
06/12/2022, 6:33 AM<Disclosure.Button
as="a"
href="/auth"
className={joinClassNames(
router.pathname === "signin"
? "g-nav"
: "g-nav-hover",
"g-nav-user-dashboard-common block w-full text-left"
)}
>
Sign In/Register
</Disclosure.Button>funk101
06/12/2022, 6:33 AMrp_st
06/12/2022, 6:33 AMrp_st
06/12/2022, 6:33 AMrp_st
06/12/2022, 6:34 AM"/auth?redirectToPath=XYZ where XYZ = the current pathfunk101
06/12/2022, 6:35 AMonClick={redirectToAuth} in a handler maybe?funk101
06/12/2022, 6:35 AMfunk101
06/12/2022, 6:36 AMrp_st
06/12/2022, 6:36 AMfunk101
06/12/2022, 6:36 AMfunk101
06/12/2022, 6:53 AMrp_st
06/12/2022, 6:55 AM