logout action
This commit is contained in:
		| @@ -65,6 +65,10 @@ const accountController = { | ||||
|         if (req.session.publicKey != null) { | ||||
|             return res.status(200).json({ publicKey: req.session.publicKey }); | ||||
|         } | ||||
|     }, | ||||
|     logout: (req, res) => { | ||||
|         req.session.publicKey = undefined; | ||||
|         res.redirect('/'); | ||||
|     } | ||||
| }; | ||||
|  | ||||
|   | ||||
| @@ -1,2 +1,2 @@ | ||||
| var jswarn = document.getElementById('jswarn'); | ||||
| const jswarn = document.getElementById('jswarn'); | ||||
| jswarn.innerText = ''; | ||||
|   | ||||
| @@ -14,6 +14,10 @@ router | ||||
|   .route("/login") | ||||
|   .get(accountController.loginGetChallenge); | ||||
|  | ||||
| router | ||||
|   .route("/logout") | ||||
|   .get(accountController.logout); | ||||
|  | ||||
| router | ||||
|   .route("/verify-challenge") | ||||
|   .post(accountController.loginVerifyChallenge); | ||||
|   | ||||
| @@ -42,7 +42,7 @@ html(lang="en-US") | ||||
|       else | ||||
|         .btn-toolbar.btn-group-sm(role="toolbar", aria-label="Toolbar") | ||||
|           .btn-group.mr-2(role="group", aria-label="logout") | ||||
|             button#logout.btn.btn-secondary(type="button") logout | ||||
|             a#logout.btn.btn-secondary(href="./account/logout") logout | ||||
|  | ||||
|         ul#messages | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user