frontend: add logout
This commit is contained in:
parent
98422b2dae
commit
ee65be7bac
@ -63,6 +63,7 @@ func initStaticRouter(router *mux.Router) error {
|
||||
"login",
|
||||
"signup",
|
||||
"dashboard",
|
||||
"logout",
|
||||
"account",
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
SHELL = bash
|
||||
|
||||
# list of JS files to be built
|
||||
JS_BUILD = jquery.js vue.js highlight.js chartist.js login.js signup.js dashboard.js
|
||||
JS_BUILD = jquery.js vue.js highlight.js chartist.js login.js signup.js dashboard.js logout.js
|
||||
|
||||
jquery.js = jquery.js
|
||||
vue.js = vue.js
|
||||
@ -10,6 +10,7 @@ chartist.js = chartist.js
|
||||
login.js = utils.js http.js auth-common.js login.js
|
||||
signup.js = utils.js http.js auth-common.js signup.js
|
||||
dashboard.js = utils.js http.js errors.js self.js dashboard.js dashboard-setting.js dashboard-domain.js dashboard-installation.js dashboard-general.js dashboard-moderation.js dashboard-statistics.js dashboard-import.js dashboard-danger.js
|
||||
logout.js = utils.js logout.js
|
||||
|
||||
# for each file in $(JS_BUILD), list its composition
|
||||
|
||||
|
8
frontend/js/logout.js
Normal file
8
frontend/js/logout.js
Normal file
@ -0,0 +1,8 @@
|
||||
(function (global, document) {
|
||||
|
||||
global.logout = function() {
|
||||
global.cookieSet("session", "");
|
||||
document.location = "/login";
|
||||
}
|
||||
|
||||
} (window, document));
|
10
frontend/logout.html
Normal file
10
frontend/logout.html
Normal file
@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head>
|
||||
<script src="<<<.CdnPrefix>>>/js/jquery.js"></script>
|
||||
<script src="<<<.CdnPrefix>>>/js/logout.js"></script>
|
||||
</head>
|
||||
|
||||
<script>
|
||||
window.onload = window.logout;
|
||||
</script>
|
||||
</html>
|
Loading…
Reference in New Issue
Block a user