AI Implementation feature(871): Admin Area System: Database Backup/Restore and Danger Zone (#61)
This commit was merged in pull request #61.
This commit is contained in:
@@ -240,6 +240,17 @@ export class AuthService {
|
||||
this.publishInvalidation(message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Forcibly invalidate the local session (and broadcast peer
|
||||
* invalidation) — used after a destructive server-initiated action such
|
||||
* as a successful restore that revokes access. Same as a normal logout
|
||||
* from the client's perspective.
|
||||
*/
|
||||
forceServerInvalidation(): void {
|
||||
this.suppressBroadcast = false;
|
||||
this.clearAndBroadcast();
|
||||
}
|
||||
|
||||
handleSseUnauthorized(): void {
|
||||
this.clearAndBroadcast();
|
||||
this.notifyPeerInvalidation('sse-unauthorized');
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { Injectable, signal } from '@angular/core';
|
||||
|
||||
export type SystemDataChangeKind = 'scores-reset' | 'challenges-wiped' | 'restore-completed';
|
||||
|
||||
@Injectable({ providedIn: 'root' })
|
||||
export class SystemDataChangeService {
|
||||
private readonly _events = signal<{ kind: SystemDataChangeKind; ts: number }[]>([]);
|
||||
|
||||
readonly events = this._events.asReadonly();
|
||||
|
||||
notify(kind: SystemDataChangeKind): void {
|
||||
this._events.update((cur) => [...cur, { kind, ts: Date.now() }]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user