fix(postit): preserve performer identity during save

This commit is contained in:
Paul Schneider 2026-10-07 12:35:09 +01:00
commit 5e22b9a232
Signed by: notazof
GPG key ID: AD4B9B545FBD7D12
3 changed files with 78 additions and 24 deletions

View file

@ -228,7 +228,17 @@ namespace Yavsc.WebApi.Controllers
}
var uid = User.GetUserId();
if (string.IsNullOrWhiteSpace(uid) || !string.Equals(model.PerformerId, uid, StringComparison.Ordinal))
if (string.IsNullOrWhiteSpace(uid))
{
return Challenge();
}
if (string.IsNullOrWhiteSpace(model.PerformerId))
{
model.PerformerId = uid;
}
if (!string.Equals(model.PerformerId, uid, StringComparison.Ordinal))
{
return Forbid();
}