From 721df57957bd11d3ffd8f41b8b2e4e4dd87e1d3c Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Thu, 25 May 2023 23:25:25 +0700 Subject: [PATCH] Revert: fetch config --- src/app/[...path]/page.tsx | 12 ++++++------ src/app/page.tsx | 12 +++++------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/app/[...path]/page.tsx b/src/app/[...path]/page.tsx index fa5e00d..e737342 100644 --- a/src/app/[...path]/page.tsx +++ b/src/app/[...path]/page.tsx @@ -108,9 +108,9 @@ async function FilePage({ params }: Props) { )}`, { credentials: "include", - // headers: { - // Cookie: `${Constant.cookiePassword}=${passwordCookies}`, - // }, + headers: { + Cookie: `${Constant.cookiePassword}=${passwordCookies}`, + }, }, ).then( (res) => @@ -153,9 +153,9 @@ async function FilePage({ params }: Props) { `${apiConfig.basePath}/api/files/${lastId}`, { credentials: "include", - // headers: { - // Cookie: `${Constant.cookiePassword}=${passwordCookies}`, - // }, + headers: { + Cookie: `${Constant.cookiePassword}=${passwordCookies}`, + }, }, ).then( (res) => diff --git a/src/app/page.tsx b/src/app/page.tsx index b51e740..2bcc8a3 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -46,9 +46,9 @@ async function RootPage() { `${apiConfig.basePath}/api/validate`, { credentials: "include", - // headers: { - // Cookie: `${Constant.cookiePassword}=${passwordCookies}`, - // }, + headers: { + Cookie: `${Constant.cookiePassword}=${passwordCookies}`, + }, }, ).then( (res) => @@ -60,11 +60,9 @@ async function RootPage() { const getFilesData = fetch( `${apiConfig.basePath}/api/files`, { + credentials: "include", headers: { - credentials: "include", - // headers: { - // Cookie: `${Constant.cookiePassword}=${passwordCookies}`, - // }, + Cookie: `${Constant.cookiePassword}=${passwordCookies}`, }, }, ).then(