@ng-mfe/auth
v0.1.1
Published
Authentication and token management
Readme
@ng-mfe/auth
支持多种存储后端的身份认证与令牌管理服务。
安装
npm install @ng-mfe/auth用法
import { AuthService, LocalStorageStore } from '@ng-mfe/auth';
const auth = new AuthService({ store: new LocalStorageStore() });
auth.set({ token: 'eyJ...' });
auth.get(); // { token: 'eyJ...' }API 接口
- AuthService — 令牌生命周期管理
- 令牌存储 — LocalStorage、SessionStorage、Cookie、Memory
- AuthHttpMiddleware — 自动为请求附加令牌
- AuthCoordinator — 跨标签页令牌同步
文档
查看主 README 获取完整文档。
