stevem
stevem
BABetter Auth
Created by stevem on 4/6/2025 in #help
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?
6 replies
BABetter Auth
Created by stevem on 4/6/2025 in #help
User Cancelling Authentication Redirects to Better Auth Error Page
export const facebookSignIn = async () => {
const data = await authClient.signIn.social({
provider: "facebook",
callbackURL: "/profile",
errorCallbackURL: "/sign-in",
});

return data;
};
export const facebookSignIn = async () => {
const data = await authClient.signIn.social({
provider: "facebook",
callbackURL: "/profile",
errorCallbackURL: "/sign-in",
});

return data;
};
this is my code for facebook login, i have the errorCallbackURL to go to "/sign-in" but it doesn't fall back to this redirect instead it goes staright to the default better auth error page. my database is fully set up, the error in the url says:
http://localhost:3000/api/auth/error?error=access_denied&error_description=Permissions%20error#_=_
http://localhost:3000/api/auth/error?error=access_denied&error_description=Permissions%20error#_=_
8 replies