({ user }: RequestHandlerParams)
| 3 | import { AppConfig } from '/lib/config.ts'; |
| 4 | |
| 5 | async function get({ user }: RequestHandlerParams) { |
| 6 | const config = await AppConfig.getConfig(); |
| 7 | |
| 8 | if (user) { |
| 9 | const firstEnabledApp = config.core.enabledApps[0]; |
| 10 | |
| 11 | return new Response('Redirect', { status: 303, headers: { 'Location': `/${firstEnabledApp}` } }); |
| 12 | } |
| 13 | |
| 14 | return new Response('Redirect', { status: 303, headers: { 'Location': '/login' } }); |
| 15 | } |
| 16 | |
| 17 | export default page({ |
| 18 | get, |