( userId: string )
| 38 | }; |
| 39 | |
| 40 | export async function createDemoSession( |
| 41 | userId: string |
| 42 | ): Promise<SessionValidationResult> { |
| 43 | const user = await db.user.findUniqueOrThrow({ |
| 44 | where: { |
| 45 | id: userId, |
| 46 | }, |
| 47 | }); |
| 48 | |
| 49 | return { |
| 50 | user, |
| 51 | userId: user.id, |
| 52 | session: { |
| 53 | id: '1', |
| 54 | userId: user.id, |
| 55 | expiresAt: new Date(Date.now() + 1000 * 60 * 60 * 24 * 30 * 365), |
| 56 | createdAt: new Date(), |
| 57 | updatedAt: new Date(), |
| 58 | }, |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | export const decodeSessionToken = (token: string): string | null => { |
| 63 | return token |
no outgoing calls
no test coverage detected