Always redirect to homepage when not logged in
This commit is contained in:
parent
89e31ed338
commit
32c8f0cfa0
10
main.go
10
main.go
|
@ -473,6 +473,11 @@ func (h *graphHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}()
|
||||
|
||||
if !sess.LoggedIn {
|
||||
http.Redirect(w, r, "/", http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
refs := make(Refs)
|
||||
|
||||
f, err := os.Open(filepath.Join(mp.(*FilePages).dirname, "backrefs.json"))
|
||||
|
@ -613,6 +618,11 @@ func (h *indexHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}()
|
||||
|
||||
if !sess.LoggedIn {
|
||||
http.Redirect(w, r, "/", http.StatusFound)
|
||||
return
|
||||
}
|
||||
|
||||
format := r.URL.Query().Get("format")
|
||||
if format == "" {
|
||||
format = "html"
|
||||
|
|
Loading…
Reference in New Issue
Block a user