[Infra] Persist DataProtection keys in the DB (fixes logout/antiforgery on deploy)

Add Microsoft.AspNetCore.DataProtection.EntityFrameworkCore; AppDbContext implements IDataProtectionKeyContext with a DataProtectionKeys set; PersistKeysToDbContext + SetApplicationName(hamkadr). Now the key ring is shared across restarts/replicas, so auth cookies, antiforgery tokens and the captcha no longer break on every deploy (the root cause of the earlier admin lock-out). Migration: DataProtectionKeys table.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
soroush.asadi
2026-06-07 07:33:20 +03:30
parent c46e628f6a
commit 437258294b
6 changed files with 1336 additions and 1 deletions
File diff suppressed because it is too large Load Diff