fix core admin css and js not rendering for unauthorised users
This commit is contained in:
parent
ef3f3c5428
commit
800d4b5bdf
1 changed files with 13 additions and 3 deletions
|
|
@ -55,9 +55,19 @@ func Handler(app *model.AppState) http.Handler {
|
|||
mux.Handle("/tracks", requireAccount(serveTracks(app)))
|
||||
mux.Handle("/tracks/", requireAccount(serveTracks(app)))
|
||||
|
||||
mux.Handle("/static/", requireAccount(
|
||||
mux.Handle("/static/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
if r.URL.Path == "/static/admin.css" {
|
||||
http.ServeFile(w, r, "./admin/static/admin.css")
|
||||
return
|
||||
}
|
||||
if r.URL.Path == "/static/admin.js" {
|
||||
http.ServeFile(w, r, "./admin/static/admin.js")
|
||||
return
|
||||
}
|
||||
requireAccount(
|
||||
http.StripPrefix("/static",
|
||||
view.ServeFiles("./admin/static"))))
|
||||
view.ServeFiles("./admin/static"))).ServeHTTP(w, r)
|
||||
}))
|
||||
|
||||
mux.Handle("/", requireAccount(AdminIndexHandler(app)))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue