mirror of
https://github.com/sipeed/NanoKVM.git
synced 2026-09-11 09:02:05 -05:00
Fix password updated check
This commit is contained in:
@@ -70,7 +70,9 @@ func (s *Service) IsPasswordUpdated(c *gin.Context) {
|
||||
err = bcrypt.CompareHashAndPassword([]byte(account.Password), []byte("admin"))
|
||||
|
||||
rsp.OkRspWithData(c, &proto.IsPasswordUpdatedRsp{
|
||||
IsUpdated: err == nil,
|
||||
// If the hash is not valid, still assume it's not updated
|
||||
// The error we want to see is password and hash not matching
|
||||
IsUpdated: err == bcrypt.ErrMismatchedHashAndPassword,
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user