fix: refina layout das colunas de empresas e corrige leitura de cookies no middleware

This commit is contained in:
Esdras Renan 2025-10-15 23:30:16 -03:00
parent 43230e0310
commit 5211ea45df
2 changed files with 28 additions and 13 deletions

View file

@ -75,14 +75,17 @@ async function attemptSessionRefresh(request: NextRequest): Promise<NextResponse
}
const redirect = NextResponse.redirect(request.nextUrl)
const setCookieHeaders =
typeof response.headers.raw === "function"
? response.headers.raw()["set-cookie"] ?? []
const headersWithGetSetCookie = response.headers as Headers & { getSetCookie?: () => string[] | undefined }
let setCookieHeaders =
typeof headersWithGetSetCookie.getSetCookie === "function"
? headersWithGetSetCookie.getSetCookie() ?? []
: []
if (setCookieHeaders.length === 0) {
const single = response.headers.get("set-cookie")
if (single) setCookieHeaders.push(single)
if (single) {
setCookieHeaders = [single]
}
}
for (const cookie of setCookieHeaders) {