Jwt-decode in TypeScript

Working through the sample code on the Auth0 SPA. I’m working in TypeScript, and am having issues as the token returned by jwt-decode is of type {} this means that the calls to the token parameters don’t resolve.

function getTokenExpirationDate(encodedToken: any) {
let token = jwt_decode(encodedToken);
if (!token.exp) { return null; }

const date = new Date(0);
date.setUTCSeconds(token.exp);

return date;

}

Is the type for this exposed, and is so, what is it?

Hey there!

Sorry for such delay in response! We’re doing our best in providing the best developer support experience out there, but sometimes the number of incoming questions is just too big for our bandwidth. Sorry for such inconvenience!

Do you still require further assistance from us?