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

Function createAccessToken

api/src/utils/tokens.ts:36–43  ·  view source on GitHub ↗
(userId: string, ttl?: number)

Source from the content-addressed store, hash-verified

34 * @returns The access token.
35 */
36export const createAccessToken = (userId: string, ttl?: number): Token => {
37 return {
38 userId,
39 id: customNanoid(),
40 ttl: ttl ?? 77760000000,
41 created: new Date().toISOString()
42 };
43};
44
45/**
46 * Creates an auth token.

Callers 5

tokens.test.tsFile · 0.85
mobileAuth0RoutesFunction · 0.85
devAuthFunction · 0.85
auth0.tsFile · 0.85
auth.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected