mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-27 11:35:04 +08:00
fix (plg_authenticate_local): handle base
This commit is contained in:
@ -35,7 +35,7 @@ func (this SimpleAuth) Setup() Form {
|
||||
{
|
||||
Name: "banner",
|
||||
Type: "hidden",
|
||||
Description: fmt.Sprintf(`<pre>MANAGEMENT GUI: <a href="/admin/simple-user-management">/admin/simple-user-management</a>
|
||||
Description: fmt.Sprintf(`<pre>MANAGEMENT GUI: <a href="`+WithBase("/admin/simple-user-management")+`">/admin/simple-user-management</a>
|
||||
STATS:
|
||||
┌─────────────┐ ┌──────────────┐
|
||||
│ TOTAL USERS │ │ ACTIVE USERS │
|
||||
|
||||
@ -12,8 +12,8 @@ import (
|
||||
func init() {
|
||||
Hooks.Register.AuthenticationMiddleware("local", SimpleAuth{})
|
||||
Hooks.Register.HttpEndpoint(func(r *mux.Router, app *App) error {
|
||||
r.Handle("/admin/simple-user-management", http.RedirectHandler("/admin/api/simple-user-management", http.StatusSeeOther)).Methods("GET")
|
||||
r.HandleFunc("/admin/api/simple-user-management", middleware.NewMiddlewareChain(
|
||||
r.Handle(WithBase("/admin/simple-user-management"), http.RedirectHandler(WithBase("/admin/api/simple-user-management"), http.StatusSeeOther)).Methods("GET")
|
||||
r.HandleFunc(WithBase("/admin/api/simple-user-management"), middleware.NewMiddlewareChain(
|
||||
UserManagementHandler,
|
||||
[]Middleware{middleware.AdminOnly},
|
||||
*app,
|
||||
|
||||
Reference in New Issue
Block a user