Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Refactor SocialButtons component to streamline callback URL handling

Bill Yanga978df5de8af
diff --git a/client/src/components/auth/SocialButtons.tsx b/client/src/components/auth/SocialButtons.tsx
index 82b46e2e1..ce903a493 100644
--- a/client/src/components/auth/SocialButtons.tsx
+++ b/client/src/components/auth/SocialButtons.tsx
@@ -29,8 +29,8 @@ export function SocialButtons({
try {
await authClient.signIn.social({
provider,
- ...(callbackURL && mode !== "signup" ? { callbackURL } : {}),
- // For signup flow, new users should be redirected to the same callbackURL
+ ...(callbackURL ? { callbackURL } : {}),
+ // For signup flow, new users should also be redirected to the callbackURL
...(mode === "signup" && callbackURL ? { newUserCallbackURL: callbackURL } : {}),
});
} catch (error) {