ErrNoUId -> ErrWrongCredentials
This commit is contained in:
parent
02a5b9ce24
commit
3829155308
2 changed files with 2 additions and 2 deletions
|
@ -29,7 +29,7 @@ func (s *Server) getAuthToken(w http.ResponseWriter, req *http.Request) {
|
|||
}
|
||||
|
||||
userId, err := s.store.GetUserId(authRequest.Email, authRequest.Password)
|
||||
if err == store.ErrNoUId {
|
||||
if err == store.ErrWrongCredentials {
|
||||
errorJson(w, http.StatusUnauthorized, "No match for email and password")
|
||||
return
|
||||
}
|
||||
|
|
|
@ -65,7 +65,7 @@ func TestServerAuthHandlerErrors(t *testing.T) {
|
|||
expectedStatusCode: http.StatusUnauthorized,
|
||||
expectedErrorString: http.StatusText(http.StatusUnauthorized) + ": No match for email and password",
|
||||
|
||||
storeErrors: TestStoreFunctionsErrors{GetUserId: store.ErrNoUId},
|
||||
storeErrors: TestStoreFunctionsErrors{GetUserId: store.ErrWrongCredentials},
|
||||
},
|
||||
{
|
||||
name: "generate token fail",
|
||||
|
|
Loading…
Reference in a new issue