backend: fixed wrong error codes

This commit is contained in:
Alex
2025-03-02 23:14:03 +01:00
parent 6937ab333c
commit ff3106b8be
9 changed files with 37 additions and 22 deletions

View File

@@ -80,7 +80,7 @@ func AuthMiddleware() gin.HandlerFunc {
logger.Error.Printf("No Auth token: %v\n", err)
c.JSON(http.StatusUnauthorized,
gin.H{"errors": []gin.H{{
"field": "general",
"field": "server.general",
"key": "server.error.no_auth_token",
}}})
c.Abort()
@@ -97,7 +97,7 @@ func AuthMiddleware() gin.HandlerFunc {
logger.Error.Printf("Token(%v) is invalid: %v\n", tokenString, err)
c.JSON(http.StatusUnauthorized,
gin.H{"errors": []gin.H{{
"field": "general",
"field": "server.general",
"key": "server.error.no_auth_token",
}}})
c.Abort()