From d41e8b037244087b49aba0cc6bb6a961b54fa5de Mon Sep 17 00:00:00 2001 From: Adhityaa Chandrasekar Date: Sun, 12 Aug 2018 22:40:43 +0530 Subject: [PATCH] owner_confirm_hex.go: fix login redirect typo I have no idea where the FRONTEND environment variable came from (I think it's from my original write of Commento v1, which had whole bunch of different terminologies). Anyway, the `os.Getenv("FRONTEND")` would basically amount to nothing all the time, and it would redirect to "/login" irrespective of whether the user has a subdirectory-based COMMENTO_ORIGIN value. Closes https://gitlab.com/commento/commento-ce/issues/72 --- api/owner_confirm_hex.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/owner_confirm_hex.go b/api/owner_confirm_hex.go index 564a8bc..150792a 100644 --- a/api/owner_confirm_hex.go +++ b/api/owner_confirm_hex.go @@ -51,11 +51,11 @@ func ownerConfirmHex(confirmHex string) error { func ownerConfirmHexHandler(w http.ResponseWriter, r *http.Request) { if confirmHex := r.FormValue("confirmHex"); confirmHex != "" { if err := ownerConfirmHex(confirmHex); err == nil { - http.Redirect(w, r, fmt.Sprintf("%s/login?confirmed=true", os.Getenv("FRONTEND")), http.StatusTemporaryRedirect) + http.Redirect(w, r, fmt.Sprintf("%s/login?confirmed=true", os.Getenv("ORIGIN")), http.StatusTemporaryRedirect) return } } // TODO: include error message in the URL - http.Redirect(w, r, fmt.Sprintf("%s/login?confirmed=false", os.Getenv("FRONTEND")), http.StatusTemporaryRedirect) + http.Redirect(w, r, fmt.Sprintf("%s/login?confirmed=false", os.Getenv("ORIGIN")), http.StatusTemporaryRedirect) }