mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
13 lines
325 B
TypeScript
13 lines
325 B
TypeScript
|
|
import jwtDecode = require('jwt-decode');
|
|
|
|
let token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJmb28iOiJiYXIiLCJleHAiOjEzOTMyODY4OTMsImlhdCI6MTM5MzI2ODg5M30.4-iaDojEVl0pJQMjrbM1EzUIfAZgsbK_kgnVyVxFSVo";
|
|
|
|
interface TokenDto {
|
|
foo: string;
|
|
exp: number;
|
|
iat: number;
|
|
}
|
|
|
|
let decodedToken = jwtDecode(token) as TokenDto;
|