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:
parent
5c6ab490c7
commit
d41e8b0372
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user