refactor(web): make a separate auth middlewares for server

also slightly change api auth middleware
This commit is contained in:
2025-01-07 04:32:49 +03:00
parent 8b417dc623
commit 2228dc5f14
4 changed files with 20 additions and 10 deletions
-1
View File
@@ -32,7 +32,6 @@ func MiddlewareAuth(c *gin.Context) {
c.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{"error": "Ты это, залогинься сначала что ли, а то чё как крыса"})
return
}
c.Set("authorized", ok)
c.Set("user_id", user_id)
c.Next()
}