node프로젝트 작업 중 에러가 났다.
stackoverflow를 찾아보니 passport 0.6 출시 이후로 req.logout이 비동기로 변경되어 위 코드로는 작동이 안된다고 한다.
그래서 아래 코드로 수정하였더니 로그아웃이 잘 된다.^^
router.get('/logout', function(req, res, next) {
req.logout(function(err) {
if (err) { return next(err); }
res.redirect('/');
});
});
https://stackoverflow.com/questions/72336177/error-reqlogout-requires-a-callback-function
Error: req#logout requires a callback function
can't able to find solution of this tried everything, i am just new in using passport. Error: req#logout requires a callback function i have coded this before but that time i have not received any...
stackoverflow.com
해당 질문-답 링크는 이쪽!
'Study > Node.js' 카테고리의 다른 글
[Node.JS] If the above error is not helpful, you may want to try EJS-Lint 오류 (0) | 2022.12.16 |
---|---|
Node.js 에러- Mongo Server Error: user is not allowed to do action [find] on [test.posts] (0) | 2022.10.22 |
Node.js에러 - node:internal/modules/cjs/loader:936 throw err; (0) | 2022.10.22 |
Node.js 미들웨어 사용하기(bodyParser, compression) (0) | 2022.09.07 |
Node.js 시멘틱 URL (0) | 2022.09.06 |