mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 06:24:11 +01:00 
			
		
		
		
	Fix OAuth Source Edit Page (#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:
		
							parent
							
								
									db7c3ecc1f
								
							
						
					
					
						commit
						7d452558f0
					
				@ -192,6 +192,9 @@ func parseOAuth2Config(form forms.AuthenticationForm) *oauth2.Source {
 | 
			
		||||
		RequiredClaimName:             form.Oauth2RequiredClaimName,
 | 
			
		||||
		RequiredClaimValue:            form.Oauth2RequiredClaimValue,
 | 
			
		||||
		SkipLocalTwoFA:                form.SkipLocalTwoFA,
 | 
			
		||||
		GroupClaimName:                form.Oauth2GroupClaimName,
 | 
			
		||||
		RestrictedGroup:               form.Oauth2RestrictedGroup,
 | 
			
		||||
		AdminGroup:                    form.Oauth2AdminGroup,
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -900,6 +900,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, ",")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user