Charakter creation bugfixing

This commit is contained in:
2025-08-10 22:26:07 +02:00
parent 141211edf6
commit 8874084a07
6 changed files with 431 additions and 146 deletions
+7 -2
View File
@@ -139,12 +139,17 @@ func AuthMiddleware() gin.HandlerFunc {
c.Abort()
return
}
if CheckToken(token) == nil {
user := CheckToken(token)
if user == nil {
respondWithError(c, http.StatusUnauthorized, "Unauthorized.")
c.Abort()
return
}
// Add token validation logic here
// Set user information in context
c.Set("userID", user.UserID)
c.Set("username", user.Username)
c.Next()
}