summaryrefslogtreecommitdiffstats
path: root/web
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2015-09-23 08:19:45 -0400
committerChristopher Speller <crspeller@gmail.com>2015-09-23 08:19:45 -0400
commit772a4337c62c07e9f825ddc68283be2bee3b280e (patch)
tree8e05a6107666674707d78502f3c221001f5ddd4d /web
parentf340d21cf417547b7c35f435c7f071091e2c222c (diff)
parentb4be8eb554d4de1de5b4928a37cb72c34d565487 (diff)
downloadchat-772a4337c62c07e9f825ddc68283be2bee3b280e.tar.gz
chat-772a4337c62c07e9f825ddc68283be2bee3b280e.tar.bz2
chat-772a4337c62c07e9f825ddc68283be2bee3b280e.zip
Merge pull request #739 from rgarmsen2295/plt-39
PLT-39 Clicking "Resend email" on the verification page now confirms email was sent
Diffstat (limited to 'web')
-rw-r--r--web/react/components/email_verify.jsx14
-rw-r--r--web/react/pages/verify.jsx1
-rw-r--r--web/web.go6
3 files changed, 17 insertions, 4 deletions
diff --git a/web/react/components/email_verify.jsx b/web/react/components/email_verify.jsx
index 92123956f..8d3f15525 100644
--- a/web/react/components/email_verify.jsx
+++ b/web/react/components/email_verify.jsx
@@ -10,12 +10,14 @@ export default class EmailVerify extends React.Component {
this.state = {};
}
handleResend() {
- window.location.href = window.location.href + '&resend=true';
+ const newAddress = window.location.href.replace('&resend_success=true', '');
+ window.location.href = newAddress + '&resend=true';
}
render() {
var title = '';
var body = '';
var resend = '';
+ var resendConfirm = '';
if (this.props.isVerified === 'true') {
title = global.window.config.SiteName + ' Email Verified';
body = <p>Your email has been verified! Click <a href={this.props.teamURL + '?email=' + this.props.userEmail}>here</a> to log in.</p>;
@@ -30,6 +32,9 @@ export default class EmailVerify extends React.Component {
Resend Email
</button>
);
+ if (this.props.resendSuccess) {
+ resendConfirm = <div><br /><p className='alert alert-success'><i className='fa fa-check'></i>{' Verification email sent.'}</p></div>;
+ }
}
return (
@@ -41,6 +46,7 @@ export default class EmailVerify extends React.Component {
<div className='panel-body'>
{body}
{resend}
+ {resendConfirm}
</div>
</div>
</div>
@@ -51,10 +57,12 @@ export default class EmailVerify extends React.Component {
EmailVerify.defaultProps = {
isVerified: 'false',
teamURL: '',
- userEmail: ''
+ userEmail: '',
+ resendSuccess: 'false'
};
EmailVerify.propTypes = {
isVerified: React.PropTypes.string,
teamURL: React.PropTypes.string,
- userEmail: React.PropTypes.string
+ userEmail: React.PropTypes.string,
+ resendSuccess: React.PropTypes.string
};
diff --git a/web/react/pages/verify.jsx b/web/react/pages/verify.jsx
index e48471bbd..16a9846e5 100644
--- a/web/react/pages/verify.jsx
+++ b/web/react/pages/verify.jsx
@@ -9,6 +9,7 @@ global.window.setupVerifyPage = function setupVerifyPage(props) {
isVerified={props.IsVerified}
teamURL={props.TeamURL}
userEmail={props.UserEmail}
+ resendSuccess={props.ResendSuccess}
/>,
document.getElementById('verify')
);
diff --git a/web/web.go b/web/web.go
index 95a5a5881..0cf45766e 100644
--- a/web/web.go
+++ b/web/web.go
@@ -359,6 +359,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")
@@ -379,7 +380,9 @@ 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)
+ http.Redirect(w, r, newAddress, http.StatusFound)
return
}
}
@@ -404,6 +407,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)
}