feat(auth): implement cookie-based token management and update user ID retrieval

This commit is contained in:
ShiYu
2025-06-09 23:57:16 +08:00
parent f7048c3025
commit dbe306d2df
5 changed files with 77 additions and 3 deletions

View File

@@ -273,7 +273,7 @@ public class PictureController(IPictureService pictureService, IStorageService s
_logger.LogWarning("GetPictureFile: Picture with ID {PictureId} not found.", pictureId);
return NotFound("Picture not found.");
}
var currentUserId = GetCurrentUserId();
var currentUserId = GetUserIdFromCookie();
if (picture.Permission != PermissionType.Public)
{
if (currentUserId == null || picture.UserId != currentUserId.Value)