소스 검색

Fix bug where session was not being destroyed

sbkwgh 8 년 전
부모
커밋
cc8aae5a46
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      routes/user.js

+ 5 - 5
routes/user.js

@@ -249,11 +249,11 @@ router.post('/:username/login', async (req, res) => {
 })
 
 router.post('/:username/logout', async (req, res) => {
-	req.session = null
-	res.clearCookie('username')
-	
-	res.json({
-		success: true
+	req.session.destroy(() => {
+		res.clearCookie('username')
+		res.json({
+			success: true
+		})
 	})
 })