Merge pull request #1057 from trheyi/main

Add response_mode support for OAuth provider in Signin API
This commit is contained in:
Max 2025-07-31 16:14:07 +08:00 committed by GitHub
commit 0c90aef200
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

View file

@ -150,6 +150,11 @@ func getOAuthAuthorizationURL(c *gin.Context) {
params.Add("scope", "openid profile email")
}
// Add response_mode if specified (required for Apple with name/email scopes)
if provider.ResponseMode != "" {
params.Add("response_mode", provider.ResponseMode)
}
authorizationURL := fmt.Sprintf("%s?%s", provider.Endpoints.Authorization, params.Encode())
// Return the authorization URL and state

View file

@ -94,6 +94,7 @@ type Provider struct {
ClientSecret string `json:"client_secret,omitempty"`
ClientSecretGenerator *SecretGenerator `json:"client_secret_generator,omitempty"`
Scopes []string `json:"scopes,omitempty"`
ResponseMode string `json:"response_mode,omitempty"`
Endpoints *Endpoints `json:"endpoints,omitempty"`
Mapping map[string]string `json:"mapping,omitempty"`
}