Make requests read only when account disabled
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-06-28 00:08:23 -04:00
parent d832734f0d
commit e90570e2ae

View File

@@ -37,6 +37,12 @@ func UserSession(authService *authz.Service) gin.HandlerFunc {
return
}
// If the request is not GET and disabled, deny it
if ctx.Request.Method != "GET" && !user.Active {
ctx.JSON(http.StatusForbidden, gin.H{"error": "User is disabled"})
ctx.Abort()
}
// Get user session
userSession, err := authService.GetUserAuthProfile(ctx, sessionId)
if err != nil {