권한 변경·계정 사용 안 함·역할 변경·비밀번호 초기화 시 대상 PC에 revokeUser 알림

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013U497kUNL8ArhV7jkzCpKa
main
diadmin 2026-10-27 11:07:21 +00:00
parent 7e5ba5cae5
commit 09cb3cda59
No known key found for this signature in database
1 changed files with 4 additions and 0 deletions

View File

@ -128,6 +128,10 @@ public sealed class Hub
/// <summary>사용자 계정이 바뀜 (사용 안 함·역할 변경) → 그 사용자의 연결을 다시 확인</summary>
public async Task RefreshUserAsync(long userId, string kickReason = null)
{
// 대상 PC들: 이 사용자의 기존 연결(옛 권한 티켓)을 바로 끊게 함 → 관리 PC는 새 티켓으로 다시 연결
foreach (var a in Agents.Values)
await a.Ws.TrySendAsync(new JsonObject { ["event"] = "revokeUser", ["userId"] = userId });
var user = await Db.GetUserAsync(userId);
foreach (var m in Managers.Values.Where(x => x.User.Id == userId).ToList())
{