import {Injectable} from '@angular/core'; @Injectable({ providedIn: 'root' }) export class UtilsService { constructor() { } /** * The signed-in user's name, cached so a freshly added draft row can show an * author before it has been saved. Purely cosmetic: the server records the * author from the session, never from anything the client sends. * * The session itself is an httpOnly cookie and is deliberately not here - * this app used to keep a sessionId/sessionKey pair in localStorage and * append it to every URL, which is what the auth cutover removed. */ static saveNameToLocalStorage(name: string): void { localStorage.setItem('name', name); } static getNameFromLocalStorage(): string { return localStorage.getItem('name') ?? ''; } static clearName(): void { localStorage.removeItem('name'); } }