| 1 | import type { Metadata } from 'next' |
| 2 | import { headers } |
| 3 | import { redirect } |
| 4 | import { authClient } |
| 5 | import { createMetadata } |
| 6 | import { getSession } |
| 7 | |
| 8 | export const metadata: |
| 9 | title: 'Dashboard', |
| 10 | description: 'Open your Saturn workspace.', |
| 11 | openGraph: { |
| 12 | images: ['/api/og?page=Dashboard'], |
| 13 | }, |
| 14 | twitter: { |
| 15 | images: ['/api/og?page=Dashboard'], |
| 16 | }, |
| 17 | }) |
| 18 | |
| 19 | export default async function |
| 20 | const session = |
| 21 | if (!session) |
| 22 | redirect('/auth/sign-in?redirectTo=/dashboard') |
| 23 | } |
| 24 | const organizations = |
| 25 | fetchOptions: { headers: await |
| 26 | }) |
| 27 | if (!organizations.data |
| 28 | redirect('/onboarding') |
| 29 | } |
| 30 | redirect(`/${organizations |
| 31 | return null |
| 32 | } |