fix (plg_authenticate_local): handle base

This commit is contained in:
MickaelK
2025-09-04 02:41:30 +10:00
parent efad2a675d
commit b8da632f7c
2 changed files with 3 additions and 3 deletions

View File

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

View File

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