/** 401 等场景统一清空登录态（由 main.ts 注册 Pinia 同步逻辑） */
let clearSessionHandler: (() => void) | null = null;

export const registerClearSessionHandler = (handler: () => void) => {
    clearSessionHandler = handler;
};

export const clearSession = () => {
    clearSessionHandler?.();
};
