Hey, i have a auth web set up with react and i wan...
# support-questions
Hey, i have a auth web set up with react and i want to redirect upon successful sign in to a different url (my app) The auth web and the app web are in the same subdomain so i have like for example https://auth.my.subdomain.com and https://app.my.subdomain.com I tried using getRedirectionURL
Copy code
getRedirectionURL: async (context) => {
                if (context.action === "SUCCESS") {
                    let redirectUrl = context.redirectToPath

                    if (redirectUrl !== undefined) {
                        console.log("yoo redirected path");
                        // we are navigating back to where the user was before they authenticated
                        return redirectUrl
                return undefined;
I call the sign in with redirectToPath in the url like so https://auth.my.subdomain.com/auth?redirectToPath=https://www.app.my.subdomain.com and i get that the context.redirectToPath is empty and it just redirects me to the home page of my auth web instead to my web app. When i tried setting the web app url hardcoded in the return of getRedirectionURL it works like a charm and redirected me to the web app. Any idea if this is possible? or only paths are allowed to be redirected to? (Thanks for the help so far you have given me)
hey @Diesel
At the moment, we support redirection only to the same domain's path. To hack around this, you can redirect to some temp path on the same sub domain and make that redirect the user to the right sub domain
so like have https://auth.my.subdomain.com/webapp that redirects to https://app.my.subdomain.com ? just want to make sure
yea. You can make it redirect to
or something like that, and that page's only purpose is to redrect to the other sub domain
great thanks ill give it a try
so i got confused with domain and subdomain. both of my web apps, the supertokens sign in web app and my actual web app, are in the same domain
but they live in different subdomains. So i cant redirect to the same domain only to the same subdomain?
yeaa.. you can't redirect them to a different sub domain via the
But as explained before, you can redirect them to a page on the same domain whose purpose is to redirect them to the application's domain