ソースを参照

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
+		})
 	})
 })