Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions internal/middleware/context_middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,10 @@ func (m *ContextMiddleware) basicAuth(username string, password string) (*model.
case model.UserLocal:
user := m.auth.GetLocalUser(username)

if user == nil {
return nil, nil, fmt.Errorf("user not found locally: %s", username)
}

if user.TOTPSecret != "" {
return nil, nil, fmt.Errorf("user with totp not allowed to login via basic auth: %s", username)
}
Expand Down
2 changes: 1 addition & 1 deletion internal/service/access_controls_rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ type LDAPGroupRule struct {
}

func (rule *LDAPGroupRule) Evaluate(ctx *ACLContext) Effect {
if ctx == nil || ctx.UserContext == nil {
if ctx == nil || ctx.UserContext == nil || ctx.ACLs == nil {
return EffectAbstain
}

Expand Down
Loading