Add Sign in with Apple authentication
- Add AppleSocialAuth model to store Apple ID linkages - Create AppleAuthService for JWT verification with Apple's public keys - Add AppleSignIn handler and route (POST /auth/apple-sign-in/) - Implement account linking (links Apple ID to existing accounts by email) - Add Redis caching for Apple public keys (24-hour TTL) - Support private relay emails (@privaterelay.appleid.com) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -49,3 +49,12 @@ type UpdateProfileRequest struct {
|
||||
type ResendVerificationRequest struct {
|
||||
// No body needed - uses authenticated user's email
|
||||
}
|
||||
|
||||
// AppleSignInRequest represents the Apple Sign In request body
|
||||
type AppleSignInRequest struct {
|
||||
IDToken string `json:"id_token" binding:"required"`
|
||||
UserID string `json:"user_id" binding:"required"` // Apple's sub claim
|
||||
Email *string `json:"email"` // May be nil or private relay
|
||||
FirstName *string `json:"first_name"`
|
||||
LastName *string `json:"last_name"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user