save
Some checks failed
Deploy to Server (Docker) / deploy (push) Failing after 46s

This commit is contained in:
Ivan Titov 2025-03-22 12:17:52 +03:00
parent 29d2069bb1
commit 22a7e7b755

View File

@ -55,7 +55,12 @@ func (rm *TaskManager) handleLogin(w http.ResponseWriter, r *http.Request) {
} }
user, err := rm.repo.GetUser(input.Name) 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")) respondWithError(w, http.StatusUnauthorized, "Invalid username or password", errors.New("authentication failed"))
return return
} }