From 6af58599373a90f23c8b8ace22f03fe72c5ecde0 Mon Sep 17 00:00:00 2001 From: Eugene Blikh Date: Sat, 8 Aug 2026 23:03:15 +0300 Subject: [PATCH] web: take the login redirect from chrome.LoginURLFor Building a whole Page resolved the nav, the brand and the profile link for a response that is a Location header and nothing else. --- web/router.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/router.go b/web/router.go index b4a849e83a69b26922717200af91bd67eced508d..5d4b65a7a0fde444173e4c9867aff6b1fd73e9f7 100644 --- a/web/router.go +++ b/web/router.go @@ -253,8 +253,12 @@ func (a *app) forbidden(w http.ResponseWriter, r *http.Request, msg string) { // redirectLogin sends an unauthenticated caller to meta's login, returning them // to the current URL afterwards. +// +// LoginURLFor rather than a whole Page for one field off it: building the page +// resolves the nav, the profile link and the brand for a response that is a +// Location header and nothing else. func (a *app) redirectLogin(w http.ResponseWriter, r *http.Request) { - http.Redirect(w, r, a.page(r, "").LoginURL, http.StatusSeeOther) + http.Redirect(w, r, a.chrome.LoginURLFor(r), http.StatusSeeOther) } // loadRepoForBrowse loads the repo named by the {user}/{db} URL params and