feat: integrate Google OAuth authentication provider and add login UI button
This commit is contained in:
@@ -12,3 +12,7 @@ SMTP_PORT=587
|
||||
SMTP_USER=user@example.com
|
||||
SMTP_PASS=your-smtp-password
|
||||
SMTP_FROM=Playzer <no-reply@example.com>
|
||||
|
||||
# Google OAuth
|
||||
GOOGLE_CLIENT_ID=your-google-client-id
|
||||
GOOGLE_CLIENT_SECRET=your-google-client-secret
|
||||
|
||||
@@ -17,7 +17,21 @@ export const auth = betterAuth({
|
||||
emailAndPassword: {
|
||||
enabled: true,
|
||||
},
|
||||
trustedOrigins: [process.env.APP_BASE_URL ?? 'http://localhost:5173'],
|
||||
socialProviders: {
|
||||
google: {
|
||||
clientId: process.env.GOOGLE_CLIENT_ID!,
|
||||
clientSecret: process.env.GOOGLE_CLIENT_SECRET!,
|
||||
},
|
||||
},
|
||||
advanced: {
|
||||
generateUsername: async (data) => {
|
||||
return `user_${Date.now()}`;
|
||||
},
|
||||
},
|
||||
trustedOrigins: [
|
||||
process.env.APP_BASE_URL ?? 'http://localhost:5173',
|
||||
process.env.BETTER_AUTH_URL ?? 'http://localhost:3000',
|
||||
],
|
||||
plugins: [openAPI()],
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user