Skip to content

Commit

Permalink
pass cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueHorn07 committed Jul 7, 2023
1 parent 8b02aa8 commit 50952b6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pages/board/whitebook.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ const WhitebookPage = ({ whitebookList }) => {

export default WhitebookPage;

export async function getServerSideProps() {
export async function getServerSideProps(context) {
const { cookie } = context.req.headers;

try {
const res = await PoPoAxios.get(
'whitebook/with-login?orderBy=click_count',
{ withCredentials: true }
{ headers: cookie ? { cookie: cookie.toString() } : null }
);
const whitebookList = res.data;
return { props: { whitebookList } };
Expand Down

0 comments on commit 50952b6

Please sign in to comment.