diff options
-rw-r--r-- | web/react/components/email_verify.jsx | 4 | ||||
-rw-r--r-- | web/react/components/login.jsx | 12 | ||||
-rw-r--r-- | web/sass-files/sass/partials/_signup.scss | 5 | ||||
-rw-r--r-- | web/templates/verify.html | 25 | ||||
-rw-r--r-- | web/web.go | 15 |
5 files changed, 38 insertions, 23 deletions
diff --git a/web/react/components/email_verify.jsx b/web/react/components/email_verify.jsx index 8d3f15525..391de3326 100644 --- a/web/react/components/email_verify.jsx +++ b/web/react/components/email_verify.jsx @@ -38,8 +38,8 @@ export default class EmailVerify extends React.Component { } return ( - <div className='col-sm-offset-4 col-sm-4'> - <div className='panel panel-default'> + <div className='col-sm-12'> + <div className='panel panel-default verify_panel'> <div className='panel-heading'> <h3 className='panel-title'>{title}</h3> </div> diff --git a/web/react/components/login.jsx b/web/react/components/login.jsx index 70f7a5d6e..54df75cbc 100644 --- a/web/react/components/login.jsx +++ b/web/react/components/login.jsx @@ -112,6 +112,17 @@ export default class Login extends React.Component { errorClass = ' has-error'; } + const verifiedParam = Utils.getUrlParameter('verified'); + let verifiedBox = ''; + if (verifiedParam) { + verifiedBox = ( + <div className='alert alert-success'> + <i className='fa fa-check' /> + {' Email Verified'} + </div> + ); + } + let emailSignup; if (global.window.config.EnableSignUpWithEmail === 'true') { emailSignup = ( @@ -175,6 +186,7 @@ export default class Login extends React.Component { <h2 className='signup-team__name'>{teamDisplayName}</h2> <h2 className='signup-team__subdomain'>on {global.window.config.SiteName}</h2> <form onSubmit={this.handleSubmit}> + {verifiedBox} <div className={'form-group' + errorClass}> {serverError} </div> diff --git a/web/sass-files/sass/partials/_signup.scss b/web/sass-files/sass/partials/_signup.scss index 47235eb50..fcf0d5d77 100644 --- a/web/sass-files/sass/partials/_signup.scss +++ b/web/sass-files/sass/partials/_signup.scss @@ -333,3 +333,8 @@ .authorize-btn { margin-right: 6px; } + +.verify_panel { + margin: 60px auto auto auto; + max-width: 380px; +} diff --git a/web/templates/verify.html b/web/templates/verify.html index cb4832512..a49ba7930 100644 --- a/web/templates/verify.html +++ b/web/templates/verify.html @@ -1,16 +1,21 @@ {{define "verify"}} <!DOCTYPE html> <html> -{{template "head" . }} -<body> - <div class="container-fluid"> - <div class="row"> - <div id="verify"></div> + {{template "head" . }} + <body class="white"> + <div class="container-fluid"> + <div class="inner__wrap"> + <div class="row content"> + <div id="verify"></div> + </div> + <div class="row footer"> + {{template "footer" . }} + </div> + </div> </div> - </div> - <script> - window.setupVerifyPage({{ .Props }}); - </script> -</body> + <script> + window.setupVerifyPage({{ .Props }}); + </script> + </body> </html> {{end}} 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 |