(userId: string, ttl?: number)
| 49 | * @returns The access token. |
| 50 | */ |
| 51 | export const createAuthToken = (userId: string, ttl?: number): Token => { |
| 52 | return { |
| 53 | userId, |
| 54 | id: customNanoid(), |
| 55 | ttl: ttl ?? 900000, |
| 56 | created: new Date().toISOString() |
| 57 | }; |
| 58 | }; |
| 59 | |
| 60 | /** |
| 61 | * Check if an access token has expired. |
no outgoing calls
no test coverage detected