* Get the authenticated user or throw.
()
| 36 | * Get the authenticated user or throw. |
| 37 | */ |
| 38 | async function requireAuth() { |
| 39 | const session = await auth(); |
| 40 | if (!session?.user?.id) { |
| 41 | throw new Error('Unauthorized'); |
| 42 | } |
| 43 | return session.user; |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Get all code workspaces for the authenticated user. |
no outgoing calls
no test coverage detected