Auth Redirection - is there a version of this that...
# support-questions-legacy
k
Auth Redirection - is there a version of this that I can use for supertokens-web-js? Also have the same question for setting
useShadowDom: false
Copy code
import SuperTokens from "supertokens-auth-react";
import ThirdPartyEmailPassword from "supertokens-auth-react/recipe/thirdpartyemailpassword";

SuperTokens.init({
    appInfo: {
        apiDomain: "...",
        appName: "...",
        websiteDomain: "...",
    },
    recipeList: [
        ThirdPartyEmailPassword.init({
            getRedirectionURL: async (context) => {
                if (context.action === "SUCCESS") {
                    if (context.redirectToPath !== undefined) {
                        // we are navigating back to where the user was before they authenticated
                        return context.redirectToPath;
                    }
                    return "/dashboard";
                }
                return undefined;
            }
        }),
    ]
});
r
Hey @Kranos web-is doesn’t do redirections. You simply call the function, consume the response and then redirect yourself.
5 Views