puff6248
07/26/2023, 8:44 PMcreateMagicLink
method.
I also tried appending ?redirectToPath=/path
to the end of the magic link but then the login fails. (500 from signinup/code/consume
)rp_st
07/27/2023, 4:35 AMrp_st
07/27/2023, 4:35 AMpuff6248
07/27/2023, 2:37 PMredirectToPath
param before the hash char doesnt make it return a 500 but it still doesnt redirect with that.
Looks like this if want to redirect to a route called /questions
http://localhost:4209/auth/verify?redirectToPath=%2Fquestions&rid=passwordless&preAuthSessionId=DIR6EFU4mOSjAQj4sf-_5t-3NgLk1xZlefuoQ7QvxiE=#Uww-g6ARcF8MJUUEP-qmLouRDzYcIlW3_0Q1t90EJ20=
So how would I modify the link to make it redirect after logging in? I guessi m not sure what urlWithLinkCode
is supposed to do https://supertokens.com/docs/passwordless/common-customizations/change-magic-link-urlrp_st
07/27/2023, 4:07 PMpuff6248
07/27/2023, 4:17 PMcontext.redirectPath
is undefined though in the ovveride of getRedirectionUrl
when I manually append redirectToPath
on the magic link when generated.
For some context, the magic link im generating outside of the login page to send in a notification and the deep link path is generated dynamically.puff6248
07/27/2023, 4:21 PMrp_st
07/27/2023, 4:36 PMpuff6248
07/27/2023, 4:45 PMgetRedirectionURL: async (context) => {
if (context.action === 'SUCCESS') {
const searchParams = new URLSearchParams(window.location.search);
const redirectToPath = searchParams.get('redirectToPath');
if (redirectToPath) {
return redirectToPath;
}
return '/';
}
return undefined;
},
rp_st
07/27/2023, 4:52 PMpuff6248
07/27/2023, 5:01 PMrp_st
07/27/2023, 5:01 PMSuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).
Powered by