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:
@@ -58,3 +58,8 @@ type AppleSignInRequest struct {
|
||||
FirstName *string `json:"first_name"`
|
||||
LastName *string `json:"last_name"`
|
||||
}
|
||||
|
||||
// GoogleSignInRequest represents the Google Sign In request body
|
||||
type GoogleSignInRequest struct {
|
||||
IDToken string `json:"id_token" binding:"required"` // Google ID token from Credential Manager
|
||||
}
|
||||
|
||||
@@ -171,3 +171,19 @@ func NewAppleSignInResponse(token string, user *models.User, isNewUser bool) App
|
||||
IsNewUser: isNewUser,
|
||||
}
|
||||
}
|
||||
|
||||
// GoogleSignInResponse represents the Google Sign In response
|
||||
type GoogleSignInResponse struct {
|
||||
Token string `json:"token"`
|
||||
User UserResponse `json:"user"`
|
||||
IsNewUser bool `json:"is_new_user"`
|
||||
}
|
||||
|
||||
// NewGoogleSignInResponse creates a GoogleSignInResponse
|
||||
func NewGoogleSignInResponse(token string, user *models.User, isNewUser bool) GoogleSignInResponse {
|
||||
return GoogleSignInResponse{
|
||||
Token: token,
|
||||
User: NewUserResponse(user),
|
||||
IsNewUser: isNewUser,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user