Add Google OAuth authentication support
- Add Google OAuth token verification and user lookup/creation - Add GoogleAuthRequest and GoogleAuthResponse DTOs - Add GoogleLogin handler in auth_handler.go - Add google_auth.go service for token verification - Add FindByGoogleID repository method for user lookup - Add GoogleID field to User model - Add Google OAuth configuration (client ID, enabled flag) - Add i18n translations for Google auth error messages - Add Google verification email template support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,15 +13,16 @@ import (
|
||||
|
||||
// Config holds all configuration for the application
|
||||
type Config struct {
|
||||
Server ServerConfig
|
||||
Database DatabaseConfig
|
||||
Redis RedisConfig
|
||||
Email EmailConfig
|
||||
Push PushConfig
|
||||
Worker WorkerConfig
|
||||
Security SecurityConfig
|
||||
Storage StorageConfig
|
||||
AppleAuth AppleAuthConfig
|
||||
Server ServerConfig
|
||||
Database DatabaseConfig
|
||||
Redis RedisConfig
|
||||
Email EmailConfig
|
||||
Push PushConfig
|
||||
Worker WorkerConfig
|
||||
Security SecurityConfig
|
||||
Storage StorageConfig
|
||||
AppleAuth AppleAuthConfig
|
||||
GoogleAuth GoogleAuthConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
@@ -78,6 +79,12 @@ type AppleAuthConfig struct {
|
||||
TeamID string // Apple Developer Team ID
|
||||
}
|
||||
|
||||
type GoogleAuthConfig struct {
|
||||
ClientID string // Web client ID for token verification
|
||||
AndroidClientID string // Android client ID (optional, for audience verification)
|
||||
IOSClientID string // iOS client ID (optional, for audience verification)
|
||||
}
|
||||
|
||||
type WorkerConfig struct {
|
||||
// Scheduled job times (UTC)
|
||||
TaskReminderHour int
|
||||
@@ -194,6 +201,11 @@ func Load() (*Config, error) {
|
||||
ClientID: viper.GetString("APPLE_CLIENT_ID"),
|
||||
TeamID: viper.GetString("APPLE_TEAM_ID"),
|
||||
},
|
||||
GoogleAuth: GoogleAuthConfig{
|
||||
ClientID: viper.GetString("GOOGLE_CLIENT_ID"),
|
||||
AndroidClientID: viper.GetString("GOOGLE_ANDROID_CLIENT_ID"),
|
||||
IOSClientID: viper.GetString("GOOGLE_IOS_CLIENT_ID"),
|
||||
},
|
||||
}
|
||||
|
||||
// Validate required fields
|
||||
|
||||
Reference in New Issue
Block a user