From dda30e407aca321f369f27078076d3e05fd28b19 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Mon, 21 Sep 2015 16:03:18 -0700 Subject: Added confirmation when users request another verification email; users are no longer redirected after requesting another verification email --- web/web.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'web/web.go') diff --git a/web/web.go b/web/web.go index 305e4f199..b204708b0 100644 --- a/web/web.go +++ b/web/web.go @@ -375,7 +375,10 @@ func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) { } else { user := result.Data.(*model.User) api.FireAndForgetVerifyEmail(user.Id, user.Email, team.Name, team.DisplayName, c.GetSiteURL(), c.GetTeamURLFromTeam(team)) - http.Redirect(w, r, "/", http.StatusFound) + + newAddress := strings.Replace(r.URL.String(), "?resend=true", "?resend_success=true", -1) + newAddress = strings.Replace(newAddress, "&resend=true", "&resend_success=true", -1) + http.Redirect(w, r, newAddress, http.StatusFound) return } } -- cgit v1.2.3-1-g7c22 From b4be8eb554d4de1de5b4928a37cb72c34d565487 Mon Sep 17 00:00:00 2001 From: Reed Garmsen Date: Mon, 21 Sep 2015 17:03:08 -0700 Subject: Minor changes to how resend status is passed --- web/web.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'web/web.go') diff --git a/web/web.go b/web/web.go index b204708b0..9d1946283 100644 --- a/web/web.go +++ b/web/web.go @@ -355,6 +355,7 @@ func getChannel(c *api.Context, w http.ResponseWriter, r *http.Request) { func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) { resend := r.URL.Query().Get("resend") + resendSuccess := r.URL.Query().Get("resend_success") name := r.URL.Query().Get("teamname") email := r.URL.Query().Get("email") hashedId := r.URL.Query().Get("hid") @@ -376,8 +377,7 @@ func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) { user := result.Data.(*model.User) api.FireAndForgetVerifyEmail(user.Id, user.Email, team.Name, team.DisplayName, c.GetSiteURL(), c.GetTeamURLFromTeam(team)) - newAddress := strings.Replace(r.URL.String(), "?resend=true", "?resend_success=true", -1) - newAddress = strings.Replace(newAddress, "&resend=true", "&resend_success=true", -1) + newAddress := strings.Replace(r.URL.String(), "&resend=true", "&resend_success=true", -1) http.Redirect(w, r, newAddress, http.StatusFound) return } @@ -403,6 +403,7 @@ func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) { page.Props["IsVerified"] = isVerified page.Props["TeamURL"] = c.GetTeamURLFromTeam(team) page.Props["UserEmail"] = email + page.Props["ResendSuccess"] = resendSuccess page.Render(c, w) } -- cgit v1.2.3-1-g7c22