diff options
Diffstat (limited to 'models')
-rw-r--r-- | models/login.go | 2 | ||||
-rw-r--r-- | models/user.go | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/models/login.go b/models/login.go index 916e2731..73d11256 100644 --- a/models/login.go +++ b/models/login.go @@ -169,7 +169,7 @@ func UserSignIn(uname, passwd string) (*User, error) { // For plain login, user must exist to reach this line. // Now verify password. if u.LoginType == PLAIN { - if !u.ValidtePassword(passwd) { + if !u.ValidatePassword(passwd) { return nil, ErrUserNotExist } return u, nil diff --git a/models/user.go b/models/user.go index bf69f97a..e239ea17 100644 --- a/models/user.go +++ b/models/user.go @@ -143,8 +143,8 @@ func (u *User) EncodePasswd() { u.Passwd = fmt.Sprintf("%x", newPasswd) } -// ValidtePassword checks if given password matches the one belongs to the user. -func (u *User) ValidtePassword(passwd string) bool { +// ValidatePassword checks if given password matches the one belongs to the user. +func (u *User) ValidatePassword(passwd string) bool { newUser := &User{Passwd: passwd, Salt: u.Salt} newUser.EncodePasswd() return u.Passwd == newUser.Passwd |