This commit is contained in:
parent
1e4b5ab3b4
commit
8e5460cefa
|
@ -16,13 +16,8 @@
|
||||||
"Password": "admin",
|
"Password": "admin",
|
||||||
"Workspace": "{pwd}/data/user_workspaces/admin",
|
"Workspace": "{pwd}/data/user_workspaces/admin",
|
||||||
"LatestSessionContent": {
|
"LatestSessionContent": {
|
||||||
"FileTree": [
|
"FileTree": [],
|
||||||
"E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest",
|
"Files": [],
|
||||||
"E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello"
|
|
||||||
],
|
|
||||||
"Files": [
|
|
||||||
"E:\\Work\\go\\src\\github.com\\b3log\\wide\\data\\user_workspaces\\admin\\src\\mytest\\hello\\main.go"
|
|
||||||
],
|
|
||||||
"CurrentFile": ""
|
"CurrentFile": ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
6
main.go
6
main.go
|
@ -118,7 +118,7 @@ func logoutHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
||||||
|
|
||||||
httpSession.Options.MaxAge = 0
|
httpSession.Options.MaxAge = -1
|
||||||
httpSession.Save(r, w)
|
httpSession.Save(r, w)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +129,7 @@ func indexHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
||||||
|
|
||||||
if httpSession.IsNew {
|
if httpSession.IsNew {
|
||||||
http.Redirect(w, r, "/login", http.StatusForbidden)
|
http.Redirect(w, r, "/login", http.StatusFound)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -177,7 +177,7 @@ func startHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
||||||
|
|
||||||
if httpSession.IsNew {
|
if httpSession.IsNew {
|
||||||
http.Redirect(w, r, "/login", http.StatusForbidden)
|
http.Redirect(w, r, "/login", http.StatusFound)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,7 +30,7 @@ func IndexHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
httpSession, _ := session.HTTPSession.Get(r, "wide-session")
|
||||||
|
|
||||||
if httpSession.IsNew {
|
if httpSession.IsNew {
|
||||||
http.Redirect(w, r, "/login", http.StatusForbidden)
|
http.Redirect(w, r, "/login", http.StatusFound)
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue