fix: alinhar searchParams da página de erro de autenticação ao contrato do Next 16
This commit is contained in:
parent
72b25fafab
commit
9c74e10675
1 changed files with 9 additions and 9 deletions
|
|
@ -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<Record<string, string | string[] | undefined>>
|
||||
}) {
|
||||
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
|
|||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue