1
0
forked from YaBL/app

fixed 404 to 403 and mom password

This commit is contained in:
Beesquit 2025-07-07 15:19:29 +00:00
parent 0b4eb08a3f
commit d9929dd51f

View File

@ -752,11 +752,11 @@ func main() {
targetUser := schemas.User{}
result := db.Select("password", "id").Where("username = ?", requestBody.Login).First(&targetUser)
if result.RowsAffected == 0 {
ctx.AbortWithStatus(404)
ctx.AbortWithStatus(403)
return
}
compare := bcrypt.CompareHashAndPassword([]byte(targetUser.Password), []byte(requestBody.Password))
if compare != nil && requestBody.Password != "мамой клянусь" {
if compare != nil {
ctx.AbortWithStatus(403)
return
}