Skip to content

Commit 2de3030

Browse files
committed
Remove generateScopes function and set Scopes to an empty array in OAuth authentication
1 parent 6a27fbe commit 2de3030

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

routers/api/v1/admin/auth_oauth.go

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func CreateOauthAuth(ctx *context.APIContext) {
6060
OpenIDConnectAutoDiscoveryURL: form.ProviderAutoDiscoveryURL,
6161
CustomURLMapping: nil,
6262
IconURL: form.ProviderIconURL,
63-
Scopes: generateScopes(),
63+
Scopes: []string{},
6464
RequiredClaimName: form.RequiredClaimName,
6565
RequiredClaimValue: form.RequiredClaimValue,
6666
SkipLocalTwoFA: form.SkipLocal2FA,
@@ -146,7 +146,7 @@ func EditOauthAuth(ctx *context.APIContext) {
146146
OpenIDConnectAutoDiscoveryURL: form.ProviderAutoDiscoveryURL,
147147
CustomURLMapping: nil,
148148
IconURL: form.ProviderIconURL,
149-
Scopes: generateScopes(),
149+
Scopes: []string{},
150150
RequiredClaimName: form.RequiredClaimName,
151151
RequiredClaimValue: form.RequiredClaimValue,
152152
SkipLocalTwoFA: form.SkipLocal2FA,
@@ -267,17 +267,3 @@ func SearchOauthAuth(ctx *context.APIContext) {
267267
ctx.SetTotalCountHeader(maxResults)
268268
ctx.JSON(http.StatusOK, &results)
269269
}
270-
271-
// ??? todo: what should I do here?
272-
func generateScopes() []string {
273-
var scopes []string
274-
275-
// for _, s := range strings.Split(form.Oauth2Scopes, ",") {
276-
// s = strings.TrimSpace(s)
277-
// if s != "" {
278-
// scopes = append(scopes, s)
279-
// }
280-
// }
281-
282-
return scopes
283-
}

0 commit comments

Comments
 (0)