(userId: string, ttl?: number)
| 34 | * @returns The access token. |
| 35 | */ |
| 36 | export 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. |
no outgoing calls
no test coverage detected