From 9c74e106756120f833d219cdfc4d1e4893c7ca08 Mon Sep 17 00:00:00 2001 From: Esdras Renan Date: Fri, 14 Nov 2025 15:08:18 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20alinhar=20searchParams=20da=20p=C3=A1gin?= =?UTF-8?q?a=20de=20erro=20de=20autentica=C3=A7=C3=A3o=20ao=20contrato=20d?= =?UTF-8?q?o=20Next=2016?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/machines/auth-error/page.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 ) } -