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
This commit is contained in:
Adhityaa Chandrasekar 2018-08-12 22:40:43 +05:30
parent 5c6ab490c7
commit d41e8b0372

View File

@ -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)
}