https://supertokens.com/ logo
Title
g

ggishant

10/27/2022, 1:01 PM
Hi, so I am using the prebuilt ui from supertokens. I'm appending a query param
redirect
on the url to redirect the user to a specific page after login. does supertoken support this functionality or how can I implement this using overrides? which function will i have to override?
r

rp

10/27/2022, 1:05 PM
hey! We do support this. Which recipe are you using?
Assuming you are using thirdpartyemailpassword, you can do this like mentioned here: https://supertokens.com/docs/thirdpartyemailpassword/pre-built-ui/auth-redirection
g

ggishant

10/27/2022, 2:04 PM
this method always gives me the google auth url or undefined
r

rp

10/27/2022, 2:05 PM
what do you mean?
How are you redirecting the user to the login page?
g

ggishant

10/27/2022, 2:08 PM
i'm sending a link to the user to accept invites into workspace, the link is of the form domain.com/auth/?redirect=some-url&other-query-params=something
r

rp

10/27/2022, 2:09 PM
oh i see. Use the query param
redirectToPath
instead of using
redirect
g

ggishant

10/27/2022, 2:09 PM
okay, let me try with this
okay, i'm getting the url, but what if i want some query params too with it?
i'm creating the url like this
r

rp

10/27/2022, 2:38 PM
> what if i want some query params too with it? In that function, you can just read the query params from the current URL