This commit is contained in:
parent
29d2069bb1
commit
22a7e7b755
@ -55,7 +55,12 @@ func (rm *TaskManager) handleLogin(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
user, err := rm.repo.GetUser(input.Name)
|
||||
if err != nil || user.Password != persistance.GetMD5Hash(input.Password) {
|
||||
if err != nil {
|
||||
respondWithError(w, http.StatusUnauthorized, "Faild get user", err)
|
||||
return
|
||||
}
|
||||
|
||||
if user.Password != persistance.GetMD5Hash(input.Password) {
|
||||
respondWithError(w, http.StatusUnauthorized, "Invalid username or password", errors.New("authentication failed"))
|
||||
return
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user