minor cleanup based on make check

This commit is contained in:
bpiraeus
2022-03-14 14:11:44 -07:00
committed by André Roth
parent 836137f15d
commit 8fa1922477

View File

@@ -20,7 +20,7 @@ func Authorize(username string, password string) (ok bool) {
default: default:
return false return false
} }
if ok != true { if !ok {
return false return false
} }
} }
@@ -67,7 +67,7 @@ func getGroups(c *gin.Context, username string) {
var groups []string var groups []string
config := context.Config() config := context.Config()
dn := fmt.Sprintf("%s", config.Auth.LdapDN) dn := config.Auth.LdapDN
session := sessions.Default(c) session := sessions.Default(c)
// connect to ldap server // connect to ldap server
server := fmt.Sprintf("%s", config.Auth.Server) server := fmt.Sprintf("%s", config.Auth.Server)
@@ -94,7 +94,6 @@ func getGroups(c *gin.Context, username string) {
groups = append(groups, fmt.Sprintf("%s,", value)) groups = append(groups, fmt.Sprintf("%s,", value))
} }
session.Set("Groups", groups) session.Set("Groups", groups)
return
} }
func checkGroup(c *gin.Context, ldgroup string) bool { func checkGroup(c *gin.Context, ldgroup string) bool {