mirror of
https://github.com/go-gitea/gitea.git
synced 2025-08-15 04:34:00 +00:00
Remove generateScopes function and set Scopes to an empty array in OAuth authentication
This commit is contained in:
parent
6a27fbedda
commit
2de3030fb7
@ -60,7 +60,7 @@ func CreateOauthAuth(ctx *context.APIContext) {
|
|||||||
OpenIDConnectAutoDiscoveryURL: form.ProviderAutoDiscoveryURL,
|
OpenIDConnectAutoDiscoveryURL: form.ProviderAutoDiscoveryURL,
|
||||||
CustomURLMapping: nil,
|
CustomURLMapping: nil,
|
||||||
IconURL: form.ProviderIconURL,
|
IconURL: form.ProviderIconURL,
|
||||||
Scopes: generateScopes(),
|
Scopes: []string{},
|
||||||
RequiredClaimName: form.RequiredClaimName,
|
RequiredClaimName: form.RequiredClaimName,
|
||||||
RequiredClaimValue: form.RequiredClaimValue,
|
RequiredClaimValue: form.RequiredClaimValue,
|
||||||
SkipLocalTwoFA: form.SkipLocal2FA,
|
SkipLocalTwoFA: form.SkipLocal2FA,
|
||||||
@ -146,7 +146,7 @@ func EditOauthAuth(ctx *context.APIContext) {
|
|||||||
OpenIDConnectAutoDiscoveryURL: form.ProviderAutoDiscoveryURL,
|
OpenIDConnectAutoDiscoveryURL: form.ProviderAutoDiscoveryURL,
|
||||||
CustomURLMapping: nil,
|
CustomURLMapping: nil,
|
||||||
IconURL: form.ProviderIconURL,
|
IconURL: form.ProviderIconURL,
|
||||||
Scopes: generateScopes(),
|
Scopes: []string{},
|
||||||
RequiredClaimName: form.RequiredClaimName,
|
RequiredClaimName: form.RequiredClaimName,
|
||||||
RequiredClaimValue: form.RequiredClaimValue,
|
RequiredClaimValue: form.RequiredClaimValue,
|
||||||
SkipLocalTwoFA: form.SkipLocal2FA,
|
SkipLocalTwoFA: form.SkipLocal2FA,
|
||||||
@ -267,17 +267,3 @@ func SearchOauthAuth(ctx *context.APIContext) {
|
|||||||
ctx.SetTotalCountHeader(maxResults)
|
ctx.SetTotalCountHeader(maxResults)
|
||||||
ctx.JSON(http.StatusOK, &results)
|
ctx.JSON(http.StatusOK, &results)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ??? todo: what should I do here?
|
|
||||||
func generateScopes() []string {
|
|
||||||
var scopes []string
|
|
||||||
|
|
||||||
// for _, s := range strings.Split(form.Oauth2Scopes, ",") {
|
|
||||||
// s = strings.TrimSpace(s)
|
|
||||||
// if s != "" {
|
|
||||||
// scopes = append(scopes, s)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
return scopes
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user