Added confirmation when users request another verification email; users are no longer redirected after requesting another verification email
Этот коммит содержится в:
@@ -10,12 +10,14 @@ export default class EmailVerify extends React.Component {
|
|||||||
this.state = {};
|
this.state = {};
|
||||||
}
|
}
|
||||||
handleResend() {
|
handleResend() {
|
||||||
window.location.href = window.location.href + '&resend=true';
|
const newAddress = window.location.href.replace('?resend_success=true', '').replace('&resend_success=true', '');
|
||||||
|
window.location.href = newAddress + '&resend=true';
|
||||||
}
|
}
|
||||||
render() {
|
render() {
|
||||||
var title = '';
|
var title = '';
|
||||||
var body = '';
|
var body = '';
|
||||||
var resend = '';
|
var resend = '';
|
||||||
|
let resendConfirm = '';
|
||||||
if (this.props.isVerified === 'true') {
|
if (this.props.isVerified === 'true') {
|
||||||
title = global.window.config.SiteName + ' Email Verified';
|
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>;
|
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
|
Resend Email
|
||||||
</button>
|
</button>
|
||||||
);
|
);
|
||||||
|
if (window.location.href.indexOf('resend_success=true') > -1) {
|
||||||
|
resendConfirm = <div><br /><p className='alert alert-success'><i className='fa fa-check'></i>{' Verification email sent.'}</p></div>;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -41,6 +46,7 @@ export default class EmailVerify extends React.Component {
|
|||||||
<div className='panel-body'>
|
<div className='panel-body'>
|
||||||
{body}
|
{body}
|
||||||
{resend}
|
{resend}
|
||||||
|
{resendConfirm}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -375,7 +375,10 @@ func verifyEmail(c *api.Context, w http.ResponseWriter, r *http.Request) {
|
|||||||
} else {
|
} else {
|
||||||
user := result.Data.(*model.User)
|
user := result.Data.(*model.User)
|
||||||
api.FireAndForgetVerifyEmail(user.Id, user.Email, team.Name, team.DisplayName, c.GetSiteURL(), c.GetTeamURLFromTeam(team))
|
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
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user