Redirect for first time user with social sign in

How would I change the redirect for a first time user signing in with a social provider, since they are all sign ins?
Solution:
const data = await authClient.signIn.social({
provider: "google", // or any other provider
callbackURL: "/dashboard", // URL for existing users
newUserCallbackURL: "/onboarding", // URL for first-time users
});
const data = await authClient.signIn.social({
provider: "google", // or any other provider
callbackURL: "/dashboard", // URL for existing users
newUserCallbackURL: "/onboarding", // URL for first-time users
});
...
Jump to solution
3 Replies
Solution
KiNFiSH
KiNFiSH3w ago
const data = await authClient.signIn.social({
provider: "google", // or any other provider
callbackURL: "/dashboard", // URL for existing users
newUserCallbackURL: "/onboarding", // URL for first-time users
});
const data = await authClient.signIn.social({
provider: "google", // or any other provider
callbackURL: "/dashboard", // URL for existing users
newUserCallbackURL: "/onboarding", // URL for first-time users
});
KiNFiSH
KiNFiSH3w ago
you can use newUserCallbackURL
stevem
stevemOP3w ago
thank you!!

Did you find this page helpful?