hi! can i override how `<EmailPassword.EmailPassw...
# support-questions-legacy
y
hi! can i override how
<EmailPassword.EmailPasswordAuth>
from 'supertokens-auth-react' redirects to auth? i want to add a query param
r
Can you elaborate more on what you want to do?
y
so this component redirects to auth page if the session does not exist i want also add a query param to that redirect something like
auth?redirectToPath=/protected&lang=kk
i want to add lang query param
r
hmmm i see. You could try something like this:
Copy code
EmailPassword.init({
    getRedirectionURL: async function (context) {
        if (context.action === "SIGN_IN_AND_UP") {
            return "/auth?lang=kk"
        }
        return undefined;
    }
})
And the value of which language to add to the query param can be fetched from localsotrage or wherever you like.
y
thanks
maybe i can modify that context beforehand?
r
what do you mean?
y
i thought that i can modify the context that is passed to getRedirectionURL
r
yeaa... there is no
userContext
object that is passed to that.. you can open an issue about it and we can figure a way of doing it
y
ok, thank you
i also wanted to ask what recipe is best if i need
email/phone + password + email/phone verification
is it
email+password
and some customizations?
r
Yes. Emailpassword with customisation on top of it. We have a guide that customises emailpassword to work as a phone password + phone verification => https://supertokens.com/docs/phonepassword/introduction you can take inspiration from that to build your own way
y
phonepassword is what i have now 😅
thanks 💖💖
r
cool!
3 Views