This commit is contained in:
Liang Ding 2014-10-20 18:02:41 +08:00
parent 1e4b5ab3b4
commit 8e5460cefa
3 changed files with 6 additions and 11 deletions

View File

@ -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": ""
} }
} }

View File

@ -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
} }

View File

@ -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
} }