Skip to content

TodoPal/utils

Repository files navigation

Util module

This is a util module for the TodoPal application.

Setup

For local development follow these steps:

Install the dependencies, then run the module with the npm start command.

API

  1. getJwtExpiration
  2. getUsername

getJwtExpiration

Gets the expiration date of the JWT Token.

Syntax

const exp = getJwtExpiration(jwtToken);
console.log(exp) // Output: 1716486040
Parameters:
  • token (Type string): A JWT Token
Return Value:
  • Type number | undefined: The expiration date in epoch format, otherwise undefined.

getUsername

Gets the username from the JWT Token.

Syntax

const exp = getUsername(jwtToken);
console.log(exp) // Output: tstuser
Parameters:
  • token (Type string): A JWT Token
Return Value:
  • Type string | undefined: The username otherwise undefined.

About

Util functions for the TodoPal application

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published