Is there a way to pass the redirectToPath url para...
# support-questions-legacy
r
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
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
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
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
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
8 Views