Merge pull request #48 from fathisiddiqi/fix/google-login
fix: set redirect uri for google login and prevent router push when login by google
This commit is contained in:
@ -52,8 +52,8 @@ function LoginForm() {
|
|||||||
try {
|
try {
|
||||||
await signIn.social({
|
await signIn.social({
|
||||||
provider: "google",
|
provider: "google",
|
||||||
|
callbackURL: "/editor",
|
||||||
});
|
});
|
||||||
router.push("/editor");
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
setError("Failed to sign in with Google. Please try again.");
|
setError("Failed to sign in with Google. Please try again.");
|
||||||
setIsGoogleLoading(false);
|
setIsGoogleLoading(false);
|
||||||
|
@ -16,7 +16,7 @@ export const auth = betterAuth({
|
|||||||
emailAndPassword: {
|
emailAndPassword: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
},
|
},
|
||||||
socialProviders: {
|
socialProviders: {
|
||||||
google: {
|
google: {
|
||||||
clientId: process.env.GOOGLE_CLIENT_ID as string,
|
clientId: process.env.GOOGLE_CLIENT_ID as string,
|
||||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
|
clientSecret: process.env.GOOGLE_CLIENT_SECRET as string,
|
||||||
@ -26,4 +26,4 @@ export const auth = betterAuth({
|
|||||||
trustedOrigins: ["http://localhost:3000"],
|
trustedOrigins: ["http://localhost:3000"],
|
||||||
});
|
});
|
||||||
|
|
||||||
export type Auth = typeof auth;
|
export type Auth = typeof auth;
|
||||||
|
Reference in New Issue
Block a user