feat: account deletion, username reuse, and real-time username availability

- Add account deletion with tombstone (isDeleted flag), password/username
  confirmation, owned-space guard, and full cleanup transaction
- Free deleted usernames by renaming to !deleted:<id> so they can be reused
- Add migration to retroactively free usernames from already-tombstoned users
- Add GET /api/auth/check-username endpoint with rate limiting for real-time
  availability checking during registration
- Add debounced username availability indicator on registration Step 1
- Add DeleteAccountModal with federation-aware remote account cleanup
- Add federation ops utility for remote instance management
- Update sanitizeUser to anonymize deleted user profiles
- Add instance store improvements and connected instances modal updates
This commit is contained in:
Jannis Braun
2026-03-11 16:29:25 +01:00
parent c8e2945c07
commit 8c8767ba2c
18 changed files with 1343 additions and 21 deletions
@@ -266,6 +266,7 @@ function InstanceRow({ inst }: { inst: import('../../stores/instanceStore').Conn
const removeInstance = useInstanceStore((s) => s.removeInstance);
const reconnectInstance = useInstanceStore((s) => s.reconnectInstance);
const reauthenticateInstance = useInstanceStore((s) => s.reauthenticateInstance);
const hasPendingSync = useInstanceStore((s) => s.hasPendingPasswordSync)(inst.origin);
const [showReauth, setShowReauth] = useState(false);
const [reauthPassword, setReauthPassword] = useState('');
@@ -307,6 +308,11 @@ function InstanceRow({ inst }: { inst: import('../../stores/instanceStore').Conn
{(inst.status === 'disconnected' || inst.status === 'error') && inst.error && (
<div className="text-xs text-accent-amber mt-0.5">{inst.error}</div>
)}
{hasPendingSync && inst.status === 'connected' && (
<div className="text-xs text-accent-amber mt-0.5" title="Password not synced — re-authenticate to sync">
Password not synced
</div>
)}
</div>
</div>
<div className="flex items-center gap-1 shrink-0 ml-2">