fix: get access token from headers
This commit is contained in:
@@ -37,12 +37,13 @@ export const middleware: NextMiddleware = async (request) => {
|
||||
authorization
|
||||
)
|
||||
|
||||
// Pass the webview token via cookie to the page
|
||||
return NextResponse.next({
|
||||
headers: {
|
||||
"Set-Cookie": `webviewToken=${decryptedData}; Secure; HttpOnly;`,
|
||||
},
|
||||
const response = NextResponse.next()
|
||||
response.cookies.set("webviewToken", decryptedData, {
|
||||
httpOnly: true,
|
||||
secure: true,
|
||||
})
|
||||
|
||||
return response
|
||||
} catch (e) {
|
||||
if (e instanceof Error) {
|
||||
console.error(`${e.name}: ${e.message}`)
|
||||
|
||||
Reference in New Issue
Block a user