feat: check passwords on login

This commit is contained in:
2025-05-21 21:17:30 +02:00
parent 8ccf9f281c
commit de28470432

View File

@ -81,6 +81,11 @@ func (h *AuthHandler) login(w http.ResponseWriter, r *http.Request) {
return return
} }
if !util.VerifyPassword(params.Password, user.PasswordHash) {
web.Error(w, "username or/and password are incorrect", http.StatusBadRequest)
return
}
claims := types.UserClaims{ claims := types.UserClaims{
UserID: user.ID.String(), UserID: user.ID.String(),
RegisteredClaims: jwt.RegisteredClaims{ RegisteredClaims: jwt.RegisteredClaims{