Only allow Admins to login to the UI (for now)
This commit is contained in:
parent
43b0a9dadd
commit
4e8cb5ffef
1 changed files with 4 additions and 0 deletions
|
|
@ -72,6 +72,10 @@ func validateLogin(userRepo model.UserRepository, userName, password string) (*m
|
|||
if u.Password != password {
|
||||
return nil, nil
|
||||
}
|
||||
if !u.IsAdmin {
|
||||
log.Warn("Non-admin user tried to login", "user", userName)
|
||||
return nil, nil
|
||||
}
|
||||
err = userRepo.UpdateLastLoginAt(u.ID)
|
||||
if err != nil {
|
||||
log.Error("Could not update LastLoginAt", "user", userName)
|
||||
|
|
|
|||
Loading…
Reference in a new issue