15 lines
624 B
TypeScript
15 lines
624 B
TypeScript
|
|
import { JwtClaims } from './models/auth-api.model';
|
||
|
|
/**
|
||
|
|
* Client-side JWT *decoding* only - never verification. The signature is
|
||
|
|
* meaningless to check here because the frontend has no trusted key to check
|
||
|
|
* it against; verifying a JWT's signature is the backend's job on every
|
||
|
|
* request. This service exists purely so the UI can read `role`/`exp` for
|
||
|
|
* display and route-gating UX (e.g. "session expires in 4m").
|
||
|
|
*/
|
||
|
|
export declare class JwtService {
|
||
|
|
decode(token: string): JwtClaims | null;
|
||
|
|
isExpired(claims: JwtClaims, skewSeconds?: number): boolean;
|
||
|
|
private isJwtClaims;
|
||
|
|
private base64UrlDecode;
|
||
|
|
}
|