fix(session): scope session access by user

This commit is contained in:
wolfkill
2026-05-13 16:22:06 +08:00
committed by lyingbug
parent 7478e3cddb
commit 8f4e5a459f
7 changed files with 418 additions and 70 deletions
+5
View File
@@ -442,6 +442,11 @@ func (h *Handler) BatchDeleteSessions(c *gin.Context) {
}
if err := h.sessionService.BatchDeleteSessions(ctx, sanitizedIDs); err != nil {
if err == errors.ErrSessionNotFound {
logger.Warnf(ctx, "No visible sessions found for batch delete")
c.Error(errors.NewNotFoundError(err.Error()))
return
}
logger.ErrorWithFields(ctx, err, nil)
c.Error(errors.NewInternalServerError(err.Error()))
return