Files
carmanagement/apps/admin/src/app/login/page.tsx
T
root 149806a773
Build & Push / Pipeline Tests (push) Successful in 1m53s
Test / Type Check (all packages) (push) Successful in 56s
Build & Push / Build & Push Docker Image (push) Failing after 4m53s
Test / API Unit Tests (push) Successful in 1m15s
Test / Homepage Unit Tests (push) Successful in 46s
Test / Carplace Unit Tests (push) Successful in 41s
Test / Admin Unit Tests (push) Successful in 40s
Test / Dashboard Unit Tests (push) Successful in 42s
Test / API Integration Tests (push) Successful in 1m6s
fix bug 16 and 17
2026-08-04 00:52:58 -04:00

17 lines
662 B
TypeScript

import { cookies, headers } from 'next/headers'
import { redirect } from 'next/navigation'
import { resolveServerAppUrl } from '@/lib/appUrls'
export default async function AdminLoginPage() {
const requestHeaders = await headers()
const cookieStore = await cookies()
const rawTheme = cookieStore.get('rentaldrivego-theme')?.value
const theme = rawTheme === 'light' ? 'light' : 'dark'
const websiteUrl = resolveServerAppUrl(
process.env.NEXT_PUBLIC_WEBSITE_URL ?? 'http://localhost:3000',
requestHeaders.get('host'),
requestHeaders.get('x-forwarded-proto'),
)
redirect(`${websiteUrl}/en/${theme}/admin-sign-in?next=/admin/dashboard`)
}