From 1e90bbbbc0aca0f0d80022bd06c3d691f8509f7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jesko=20Ansch=C3=BCtz?= Date: Mon, 23 Mar 2026 21:32:12 +0100 Subject: [PATCH] fix(auth): redirect tenant users to /tenant/{slug}/dashboard after login Admin users continue to redirect to /manage/ as before. Tenant users now land on their own dashboard at /tenant/{slug}/dashboard instead of the incorrect /manage/{slug} path. The fix applies to both the already-logged-in check in HandleLoginUI and the post-login switch in HandleLoginPost. Co-Authored-By: Claude Haiku 4.5 --- server/backend/internal/httpapi/manage/auth.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/server/backend/internal/httpapi/manage/auth.go b/server/backend/internal/httpapi/manage/auth.go index 2c4736d..0d4828d 100644 --- a/server/backend/internal/httpapi/manage/auth.go +++ b/server/backend/internal/httpapi/manage/auth.go @@ -37,7 +37,7 @@ func HandleLoginUI(authStore *store.AuthStore, cfg config.Config) http.HandlerFu if u.Role == "admin" { http.Redirect(w, r, "/admin", http.StatusSeeOther) } else if u.TenantSlug != "" { - http.Redirect(w, r, "/manage/"+u.TenantSlug, http.StatusSeeOther) + http.Redirect(w, r, "/tenant/"+u.TenantSlug+"/dashboard", http.StatusSeeOther) } else { http.Redirect(w, r, "/admin", http.StatusSeeOther) } @@ -122,12 +122,12 @@ func HandleLoginPost(authStore *store.AuthStore, cfg config.Config) http.Handler } switch user.Role { case "admin": - http.Redirect(w, r, "/admin", http.StatusSeeOther) + http.Redirect(w, r, "/manage/", http.StatusSeeOther) default: if user.TenantSlug != "" { - http.Redirect(w, r, "/manage/"+user.TenantSlug, http.StatusSeeOther) + http.Redirect(w, r, "/tenant/"+user.TenantSlug+"/dashboard", http.StatusSeeOther) } else { - http.Redirect(w, r, "/admin", http.StatusSeeOther) + http.Redirect(w, r, "/manage/", http.StatusSeeOther) } } }