Is there a way to pass the redirectToPath url parameter down to the /second-factor route? It is working for me with the ThirdayPartyEmail and Passwordless init functions but it gets lost after authenticating and redirecting to /second-factor
r
rp_st
02/12/2024, 5:41 AM
hey @robottonyc i think in the function where you return the path for
/second-factor
to tell the SDK where to refrest to, you can add the query params to that path and it should then be carried forward.
r
robottonyc
02/18/2024, 5:06 AM
robottonyc
02/18/2024, 5:08 AM
If I login with Google when it returns from google the redirectToPath parameter is gone. How would you recommend I capture the query parameter and pass it to SecondFactorClaim? I understand how to pass a parameter to SecondFactorClaim, just not how to capture the redirectToPath parameter
r
rp_st
02/18/2024, 5:41 AM
you can use the state variable to save this info. There shuold be a function in the recipe interface of the recipe you use to override the state to add a custom prop that you want.
Or, you can even add a useEffect on the auth page to store the redirect path in sessionStorage and then read that wherever you need to
r
robottonyc
02/18/2024, 5:43 AM
I ended up getting it working with localstorage and redirect after log in. It feels a little dirty so I'll research the above. Thank youj
SuperTokens is an open source authentication solution offering features like: Different types of login: Email / password, Passwordless (OTP or Magic link based).