mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 10:50:26 -06:00
Better forgot password message
This commit is contained in:
parent
23cc7c174a
commit
a15714899e
@ -15,6 +15,7 @@ Discourse.ForgotPasswordController = Discourse.Controller.extend(Discourse.Modal
|
||||
}.property('accountEmailOrUsername'),
|
||||
|
||||
submit: function() {
|
||||
if (!this.get('accountEmailOrUsername')) return false;
|
||||
|
||||
Discourse.ajax("/session/forgot_password", {
|
||||
data: { login: this.get('accountEmailOrUsername') },
|
||||
@ -22,7 +23,11 @@ Discourse.ForgotPasswordController = Discourse.Controller.extend(Discourse.Modal
|
||||
});
|
||||
|
||||
// don't tell people what happened, this keeps it more secure (ensure same on server)
|
||||
this.flash(I18n.t('forgot_password.complete'));
|
||||
if (this.get('accountEmailOrUsername').match(/@/)) {
|
||||
this.flash(I18n.t('forgot_password.complete_email', {email: this.get('accountEmailOrUsername')}));
|
||||
} else {
|
||||
this.flash(I18n.t('forgot_password.complete_username', {username: this.get('accountEmailOrUsername')}));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -484,7 +484,8 @@ en:
|
||||
action: "I forgot my password"
|
||||
invite: "Enter your username or email address, and we'll send you a password reset email."
|
||||
reset: "Reset Password"
|
||||
complete: "If an account matches that username or email address, you should receive an email with instructions on how to reset your password shortly."
|
||||
complete_username: "If an account matches the username <b>%{username}</b>, you should receive an email with instructions on how to reset your password shortly."
|
||||
complete_email: "If an account matches <b>%{email}</b>, you should receive an email with instructions on how to reset your password shortly."
|
||||
|
||||
login:
|
||||
title: "Sign In"
|
||||
|
Loading…
Reference in New Issue
Block a user