summaryrefslogtreecommitdiffstats
path: root/web/web.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2015-10-06 13:24:17 -0700
committerCorey Hulen <corey@hulen.com>2015-10-06 13:24:17 -0700
commitfe802fb9c4afdf27a2fb56eb472f48eb921b4de0 (patch)
tree67617a819d423afd6c848c35f37f57ec81f240fa /web/web.go
parentcbe1ab8dbac9502017a5ae5cd4eb01d9c43772e2 (diff)
parent4311978d650fa1e40f34db3c2cb411377bcc6936 (diff)
downloadchat-fe802fb9c4afdf27a2fb56eb472f48eb921b4de0.tar.gz
chat-fe802fb9c4afdf27a2fb56eb472f48eb921b4de0.tar.bz2
chat-fe802fb9c4afdf27a2fb56eb472f48eb921b4de0.zip
Merge pull request #938 from mattermost/plt-111
PLT-111 Combining email verification confirmation screen with login screen.
Diffstat (limited to 'web/web.go')
-rw-r--r--web/web.go15
1 files changed, 4 insertions, 11 deletions
diff --git a/web/web.go b/web/web.go
index a1bbf5a81..b87636187 100644
--- a/web/web.go
+++ b/web/web.go
@@ -422,24 +422,17 @@ func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) {
}
}
- var isVerified string
- if len(userId) != 26 {
- isVerified = "false"
- } else if len(hashedId) == 0 {
- isVerified = "false"
- } else if model.ComparePassword(hashedId, userId) {
- isVerified = "true"
+ if len(userId) == 26 && len(hashedId) != 0 && model.ComparePassword(hashedId, userId) {
if c.Err = (<-api.Srv.Store.User().VerifyEmail(userId)).Err; c.Err != nil {
return
} else {
- c.LogAudit("")
+ c.LogAudit("Email Verified")
+ http.Redirect(w, r, api.GetProtocol(r)+"://"+r.Host+"/"+name+"/login?verified=true&email="+email, http.StatusTemporaryRedirect)
+ return
}
- } else {
- isVerified = "false"
}
page := NewHtmlTemplatePage("verify", "Email Verified")
- page.Props["IsVerified"] = isVerified
page.Props["TeamURL"] = c.GetTeamURLFromTeam(team)
page.Props["UserEmail"] = email
page.Props["ResendSuccess"] = resendSuccess