Handling redirects @ oauth w/ different url's for auth backend and frontend

11 Replies
kWAY
kWAYOP3mo ago
i need to change that redirectTo uri since my frontend lives in another app different from my auth backend
FalconiZzare
FalconiZzare3mo ago
authClient.signIn.social has a callbackURL parameter, give the whole frontend domain + path to redirect to your frontend.
❌ await authClient.signIn.social({ provider: "discord", callbackURL: /dashboard/settings});
❌ await authClient.signIn.social({ provider: "discord", callbackURL: /dashboard/settings});
✅ await authClient.signIn.social({ provider: "discord", callbackURL: https://www.frontend/dashboard/settings});
✅ await authClient.signIn.social({ provider: "discord", callbackURL: https://www.frontend/dashboard/settings});
kWAY
kWAYOP3mo ago
@daveycodez any way of passing this callback url to the oauth providers from your ui kit though
daveycodez
daveycodez3mo ago
baseURL
kWAY
kWAYOP3mo ago
in provider?
daveycodez
daveycodez3mo ago
AuthUIProvider
kWAY
kWAYOP3mo ago
but that's set to my backend url
daveycodez
daveycodez3mo ago
Shouldn’t be baseURL on AuthUIProvider should be set to the front end Otherwise you’ll get callbackURL redirecting to your backend
kWAY
kWAYOP3mo ago
aah, got me confused since it said frontend worked, solved :Tick:

Did you find this page helpful?