Merge pull request #1057 from trheyi/main
Add response_mode support for OAuth provider in Signin API
This commit is contained in:
commit
0c90aef200
2 changed files with 6 additions and 0 deletions
|
|
@ -150,6 +150,11 @@ func getOAuthAuthorizationURL(c *gin.Context) {
|
||||||
params.Add("scope", "openid profile email")
|
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())
|
authorizationURL := fmt.Sprintf("%s?%s", provider.Endpoints.Authorization, params.Encode())
|
||||||
|
|
||||||
// Return the authorization URL and state
|
// Return the authorization URL and state
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,7 @@ type Provider struct {
|
||||||
ClientSecret string `json:"client_secret,omitempty"`
|
ClientSecret string `json:"client_secret,omitempty"`
|
||||||
ClientSecretGenerator *SecretGenerator `json:"client_secret_generator,omitempty"`
|
ClientSecretGenerator *SecretGenerator `json:"client_secret_generator,omitempty"`
|
||||||
Scopes []string `json:"scopes,omitempty"`
|
Scopes []string `json:"scopes,omitempty"`
|
||||||
|
ResponseMode string `json:"response_mode,omitempty"`
|
||||||
Endpoints *Endpoints `json:"endpoints,omitempty"`
|
Endpoints *Endpoints `json:"endpoints,omitempty"`
|
||||||
Mapping map[string]string `json:"mapping,omitempty"`
|
Mapping map[string]string `json:"mapping,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue