fix: refina layout das colunas de empresas e corrige leitura de cookies no middleware
This commit is contained in:
parent
43230e0310
commit
5211ea45df
2 changed files with 28 additions and 13 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue