diff --git a/apps/app/src/components/google-sign-in.tsx b/apps/app/src/components/google-sign-in.tsx index 47e7837e2e..be899eb860 100644 --- a/apps/app/src/components/google-sign-in.tsx +++ b/apps/app/src/components/google-sign-in.tsx @@ -23,8 +23,11 @@ export function GoogleSignIn({ ? `/api/auth/invitation?code=${inviteCode}` : "/"; + const callbackURL = new URL(redirectTo, window.location.origin); + await authClient.signIn.social({ provider: "google", + callbackURL: callbackURL.toString(), }); }; diff --git a/apps/app/src/utils/auth.ts b/apps/app/src/utils/auth.ts index 8c4b54d829..eadbefd403 100644 --- a/apps/app/src/utils/auth.ts +++ b/apps/app/src/utils/auth.ts @@ -35,6 +35,11 @@ export const auth = betterAuth({ database: prismaAdapter(db, { provider: "postgresql", }), + trustedOrigins: [ + "http://localhost:3000", + "https://app.trycomp.ai", + "https://dev.trycomp.ai", + ], advanced: { database: { // This will enable us to fall back to DB for ID generation.