Browse Source

A couple more auth.go cleanups

pull/24/head
Jordan 7 years ago
parent
commit
a3882cbf02
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      auth/auth.go

+ 1
- 3
auth/auth.go View File

@ -41,10 +41,8 @@ func Login(r *http.Request) (bool, error) {
//Let's check the password
err = bcrypt.CompareHashAndPassword([]byte(u.Hash), []byte(password))
if err != nil {
fmt.Println("Error in comparing hash and password")
ctx.Set(r, "user", nil)
//Return false, but don't return an error
return false, nil
return false, ErrInvalidPassword
}
ctx.Set(r, "user", u)
session.Values["id"] = u.Id

Loading…
Cancel
Save