This is a util module for the TodoPal application.
For local development follow these steps:
Install the dependencies, then run the module with the npm start
command.
Gets the expiration date of the JWT Token.
const exp = getJwtExpiration(jwtToken);
console.log(exp) // Output: 1716486040
- token (Type string): A JWT Token
- Type number | undefined: The expiration date in epoch format, otherwise undefined.
Gets the username from the JWT Token.
const exp = getUsername(jwtToken);
console.log(exp) // Output: tstuser
- token (Type string): A JWT Token
- Type string | undefined: The username otherwise undefined.