1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-20 00:18:27 +00:00

Fix OAuth Source Edit Page (#18495) (#18503)

Backport #18495

* Fix OAuth Source Edit Page to ensure restricted and group settings are set
* Also tolerate []interface in the groups

Fix #18432

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath
2022-01-31 21:36:34 +00:00
committed by GitHub
parent d5027b6c09
commit 083b85c655
2 changed files with 7 additions and 0 deletions

View File

@@ -904,6 +904,10 @@ func claimValueToStringSlice(claimValue interface{}) []string {
switch rawGroup := claimValue.(type) {
case []string:
groups = rawGroup
case []interface{}:
for _, group := range rawGroup {
groups = append(groups, fmt.Sprintf("%s", group))
}
default:
str := fmt.Sprintf("%s", rawGroup)
groups = strings.Split(str, ",")