https://supertokens.com/ logo
Title
k

Kranos

03/11/2023, 11:26 AM
How to I change the default path people are directed to once they've logged in? Currently it's directs to
http://localhost:3000/
but I'd like it to direct to
http://localhost:3000/user
r

rp

03/11/2023, 1:08 PM
Hey @Kranos
See the section about redirection post login in our docs.
k

Kranos

03/11/2023, 1:10 PM
Ah sorry, couldn't find that earlier! This bit right?
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

rp

03/11/2023, 2:04 PM
Yes.