MCPcopy Create free account
hub / github.com/freeCodeCamp/freeCodeCamp / isExpired

Function isExpired

api/src/utils/tokens.ts:65–68  ·  view source on GitHub ↗
(token: Token | DbToken)

Source from the content-addressed store, hash-verified

63 * @returns True if the token has expired, false otherwise.
64 */
65export const isExpired = (token: Token | DbToken): boolean => {
66 const created = new Date(token.created);
67 return Date.now() > created.getTime() + token.ttl;
68};

Callers 3

tokens.test.tsFile · 0.85
settingRedirectRoutesFunction · 0.85
getAuthedUserFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected