fix(backend)rename error code
This commit is contained in:
@@ -21,7 +21,7 @@ func Login(c *gin.Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := c.ShouldBindJSON(&input); err != nil {
|
if err := c.ShouldBindJSON(&input); err != nil {
|
||||||
c.JSON(http.StatusBadRequest, gin.H{"error": "Invalid input"})
|
c.JSON(http.StatusBadRequest, gin.H{"error": "Неверный ввод"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ func Login(c *gin.Context) {
|
|||||||
passErr := bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(input.Password))
|
passErr := bcrypt.CompareHashAndPassword([]byte(user.Password), []byte(input.Password))
|
||||||
|
|
||||||
if err != nil || passErr != nil {
|
if err != nil || passErr != nil {
|
||||||
c.JSON(http.StatusUnauthorized, gin.H{"error": "Invalid login or password"})
|
c.JSON(http.StatusUnauthorized, gin.H{"error": "Неверный логин или пароль"})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user