Passport req.logOut()发送错误,表明本地主机未发送任何数据

时间:2018-06-26 16:18:36

标签: node.js passport.js logout passport-local

router.get('/logout', function (req, res) 
{
req.logout();
req.session = null;
res.redirect('/login');
}); 

错误->本地主机未发送任何数据! 我曾经尝试过所有解决方案,但仍然无法获得预期的输出!

感谢任何帮助!

1 个答案:

答案 0 :(得分:-1)

使用快速会话模块,您可以:

  it('should get current user', async () => {
    const result = service.getCurrentUser();
    console.log('RESULT', result);
    const req = httpMock.expectOne(`/api/me`);
    const test = req.flush({test: 'ing'});
    console.log('REQUEST', test);

    expect('a').toEqual('a');
  });