diff --git a/src/app/machines/auth-error/page.tsx b/src/app/machines/auth-error/page.tsx index f3a70a6..1cf0d3e 100644 --- a/src/app/machines/auth-error/page.tsx +++ b/src/app/machines/auth-error/page.tsx @@ -7,14 +7,15 @@ export const metadata: Metadata = { title: "Falha na autenticação da dispositivo", } -type AuthErrorPageProps = { - searchParams?: { - reason?: string - } -} - -export default function MachinesAuthErrorPage({ searchParams }: AuthErrorPageProps) { - const reason = (searchParams?.reason ?? "invalid_token").toString() +export default async function MachinesAuthErrorPage({ + searchParams, +}: { + searchParams: Promise> +}) { + const params = await searchParams + const rawReason = params.reason + const reasonValue = Array.isArray(rawReason) ? rawReason[0] : rawReason + const reason = (reasonValue ?? "invalid_token").toString() const subtitle = reason === "invalid_token" @@ -45,4 +46,3 @@ export default function MachinesAuthErrorPage({ searchParams }: AuthErrorPagePro ) } -