diff options
author | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-10-05 14:54:15 -0700 |
---|---|---|
committer | Reed Garmsen <rgarmsen2295@gmail.com> | 2015-10-05 14:54:15 -0700 |
commit | f85dc7f575a9aad45d7914279300a22e9a6fae8a (patch) | |
tree | c1fd8a45e42e7f57cef3faf30112d247de11cadc /web | |
parent | 817fa66ac4db9522488c1760417ca57cb1b56c20 (diff) | |
download | chat-f85dc7f575a9aad45d7914279300a22e9a6fae8a.tar.gz chat-f85dc7f575a9aad45d7914279300a22e9a6fae8a.tar.bz2 chat-f85dc7f575a9aad45d7914279300a22e9a6fae8a.zip |
Resending the verification email now sends the appropriate version of the email depending on whether it's a change or first signup
Diffstat (limited to 'web')
-rw-r--r-- | web/web.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/web.go b/web/web.go index a1bbf5a81..4ca60f61a 100644 --- a/web/web.go +++ b/web/web.go @@ -414,7 +414,12 @@ func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) { return } else { user := result.Data.(*model.User) - api.FireAndForgetVerifyEmail(user.Id, user.Email, team.Name, team.DisplayName, c.GetSiteURL(), c.GetTeamURLFromTeam(team)) + + if user.LastActivityAt > 0 { + api.FireAndForgetEmailChangeVerifyEmail(user.Id, user.Email, team.Name, team.DisplayName, c.GetSiteURL(), c.GetTeamURLFromTeam(team)) + } else { + 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) http.Redirect(w, r, newAddress, http.StatusFound) |