summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriza <59828082+izadoesdev@users.noreply.github.com>2025-06-26 11:28:58 +0300
committerGitHub <noreply@github.com>2025-06-26 11:28:58 +0300
commitb66e85cf4d9000091f2de9cd25539ea1d86d9d72 (patch)
tree64a522ee469238928258da0de066966966f6db74
parent46614d400883051867e1415f84c45f5a37a5fcaa (diff)
parent2f5bde105158e189b396e2a6d5181ac971a4ed9f (diff)
downloadopencut-b66e85cf4d9000091f2de9cd25539ea1d86d9d72.tar.gz
Merge pull request #48 from fathisiddiqi/fix/google-login
fix: set redirect uri for google login and prevent router push when login by google
-rw-r--r--apps/web/src/app/(auth)/login/page.tsx2
-rw-r--r--packages/auth/src/server.ts4
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/web/src/app/(auth)/login/page.tsx b/apps/web/src/app/(auth)/login/page.tsx
index 73c34e1e..755784fa 100644
--- a/apps/web/src/app/(auth)/login/page.tsx
+++ b/apps/web/src/app/(auth)/login/page.tsx
@@ -52,8 +52,8 @@ function LoginForm() {
try {
await signIn.social({
provider: "google",
+ callbackURL: "/editor",
});
- router.push("/editor");
} catch (error) {
setError("Failed to sign in with Google. Please try again.");
setIsGoogleLoading(false);
diff --git a/packages/auth/src/server.ts b/packages/auth/src/server.ts
index f6c68dc5..6590c0af 100644
--- a/packages/auth/src/server.ts
+++ b/packages/auth/src/server.ts
@@ -16,7 +16,7 @@ export const auth = betterAuth({
emailAndPassword: {
enabled: true,
},
- socialProviders: {
+ socialProviders: {
google: {
clientId: process.env.GOOGLE_CLIENT_ID as string,
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
@@ -26,4 +26,4 @@ export const auth = betterAuth({
trustedOrigins: ["http://localhost:3000"],
});
-export type Auth = typeof auth; \ No newline at end of file
+export type Auth = typeof auth;