Skip to content

Commit 1d8bf1d

Browse files
committed
I meant allow admin login, not block them :D
1 parent f057af4 commit 1d8bf1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

service/user.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (s *UserService) Login(username, password string, session *session.Session)
6565
return nil, model.UnauthorizedError{Message: "Invalid credentials", Err: nil}
6666
}
6767
if config.RestrictLoginToAdmins {
68-
if slices.ContainsFunc(user.Roles, func(role model.Role) bool { return role.Name == config.AdminRoleName }) {
68+
if !slices.ContainsFunc(user.Roles, func(role model.Role) bool { return role.Name == config.AdminRoleName }) {
6969
return nil, model.ForbiddenError{Message: "Login is currently restricted to admins only"}
7070
}
7171
}

0 commit comments

Comments
 (0)