repaired session alive check
This commit is contained in:
parent
3929c923ba
commit
2074a217f2
|
@ -53,6 +53,8 @@ func (fn TemplateHandler) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
|
|||
successMsg = t.SuccessMsg
|
||||
warnMsg = t.WarnMsg
|
||||
|
||||
t.Data["CSRFToken"] = csrf.Token(r)
|
||||
|
||||
if t.Err != nil {
|
||||
|
||||
switch e := t.Err.(type) {
|
||||
|
|
|
@ -155,7 +155,7 @@ func restrictedRoutes(ctx *m.AppContext, router *mux.Router, chain alice.Chain)
|
|||
|
||||
router.Handle("/logout", chain.Then(useTemplateHandler(ctx, c.LogoutHandler))).Methods("GET")
|
||||
|
||||
router.Handle("/json/session/keep-alive", chain.Then(useJSONHandler(ctx, c.KeepAliveSessionHandler))).Methods("GET")
|
||||
router.Handle("/json/session/keep-alive", chain.Then(useJSONHandler(ctx, c.KeepAliveSessionHandler))).Methods("POST")
|
||||
router.Handle("/json/file/upload", chain.Then(useJSONHandler(ctx, c.AdminUploadJSONFilePostHandler))).Methods("POST")
|
||||
}
|
||||
|
||||
|
|
|
@ -73,9 +73,8 @@
|
|||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
"X-CSRF-Token": csrf.value
|
||||
"X-CSRF-Token": document.head.querySelector("[name=csrfToken]").content,
|
||||
},
|
||||
body: formData
|
||||
})
|
||||
};
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
<html{{if Language}} lang="{{Language}}"{{end}}>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="csrfToken" content="{{.CSRFToken}}">
|
||||
<title>{{PageTitle}} | Administration</title>
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/assets/css/master.css">
|
||||
<link rel="icon" href="/favicon.ico" type="image/vnd.microsoft.icon">
|
||||
</head>
|
||||
|
|
Loading…
Reference in New Issue