mirror of
https://github.com/mickael-kerjean/filestash
synced 2025-12-06 08:22:24 +01:00
fix (#883): console bug
This commit is contained in:
parent
80adf4d463
commit
aa253ddc59
1 changed files with 9 additions and 11 deletions
|
|
@ -49,11 +49,10 @@ var console_enable = func() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
Hooks.Register.Onload(func() {
|
|
||||||
if console_enable() == false {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
Hooks.Register.HttpEndpoint(func(r *mux.Router, _ *App) error {
|
Hooks.Register.HttpEndpoint(func(r *mux.Router, _ *App) error {
|
||||||
|
if console_enable() == false {
|
||||||
|
return ErrNotFound
|
||||||
|
}
|
||||||
r.PathPrefix("/admin/tty/").Handler(
|
r.PathPrefix("/admin/tty/").Handler(
|
||||||
AuthBasic(
|
AuthBasic(
|
||||||
func() (string, string) { return "admin", Config.Get("auth.admin").String() },
|
func() (string, string) { return "admin", Config.Get("auth.admin").String() },
|
||||||
|
|
@ -62,7 +61,6 @@ func init() {
|
||||||
)
|
)
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var notAuthorised = func(res http.ResponseWriter, req *http.Request) {
|
var notAuthorised = func(res http.ResponseWriter, req *http.Request) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue