Skip to content

Commit

Permalink
fix: 로그아웃 이벤트에서 서버 로그아웃 요청
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroCho committed Jun 4, 2024
1 parent 9f504ac commit 3c42f08
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion ch4/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const {
events: {
signOut(data) {
console.log('auth.ts events signout', 'session' in data && data.session, 'token' in data && data.token);
fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/logout`, {
method: "POST",
credentials: 'include'
})
// if ('session' in data) {
// data.session = null;
// }
Expand Down Expand Up @@ -70,4 +74,4 @@ export const {
},
}),
]
});
});
6 changes: 5 additions & 1 deletion lecture/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export const {
events: {
signOut(data) {
console.log('auth.ts events signout', 'session' in data && data.session, 'token' in data && data.token);
fetch(`${process.env.NEXT_PUBLIC_BASE_URL}/api/logout`, {
method: "POST",
credentials: 'include'
})
// if ('session' in data) {
// data.session = null;
// }
Expand Down Expand Up @@ -70,4 +74,4 @@ export const {
},
}),
]
});
});

0 comments on commit 3c42f08

Please sign in to comment.