mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-26 04:05:40 +01:00
return nil if the user is deleted in LoginByDb()
This commit is contained in:
parent
d8785196c0
commit
7fea8c55dd
@ -69,7 +69,7 @@ func LoginByDb(auth models.AuthModel) (*models.User, error) {
|
|||||||
o := orm.NewOrm()
|
o := orm.NewOrm()
|
||||||
|
|
||||||
var users []models.User
|
var users []models.User
|
||||||
n, err := o.Raw(`select * from user where (username = ? or email = ?)`,
|
n, err := o.Raw(`select * from user where (username = ? or email = ?) and deleted = 0`,
|
||||||
auth.Principal, auth.Principal).QueryRows(&users)
|
auth.Principal, auth.Principal).QueryRows(&users)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
Reference in New Issue
Block a user