From 1849c65c68b1c098b24ff5ec6f081e4d4b0ed3d6 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Sat, 11 Jul 2026 17:59:23 +0100 Subject: [PATCH] fix apiProxyHandler: stop stripping /api prefix, authelia-api needs it --- CHANGELOG.md | 5 +++++ VERSION | 2 +- main.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 961d1a6..2424940 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 0.1.0.0036 — 2026-07-11 + +### Fixed +- Admin panel user management: `apiProxyHandler` was stripping `/api` prefix before forwarding to authelia-api, causing 404 on all `/api/users` calls. Removed the `TrimPrefix` — authelia-api expects the full `/api/...` path. + ## 0.1.0.0035 — 2026-07-11 ### Added diff --git a/VERSION b/VERSION index 308cf85..2fd50ec 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.1.0.0035 +0.1.0.0036 diff --git a/main.go b/main.go index ed160a0..fb095d5 100644 --- a/main.go +++ b/main.go @@ -616,7 +616,7 @@ func apiProxyHandler(w http.ResponseWriter, r *http.Request) { if token != "" { r.Header.Set("Authorization", "Bearer "+token) } - r.URL.Path = strings.TrimPrefix(r.URL.Path, "/api") + // Forward the full path (authelia-api expects /api/... prefix) proxy.ServeHTTP(w, r) }