UNPKG

core-mvc

Version:

Simple but powerful MVC framework for NodeJS.

9 lines (6 loc) 256 B
import jsonwebtoken from 'jsonwebtoken'; const decodeToken = <T>(token: string) => { const jwtSecret = process.env.JWT_SECRET || '__SECRET_CHANGE_ME__'; return jsonwebtoken.verify(token, jwtSecret) as unknown as T; }; export default decodeToken;