Refactored check with regexp to error type checking

- Changed as per review here: https://github.com/TryGhost/Ghost-Admin/pull/1560#discussion_r420040384
This commit is contained in:
Nazar Gargol 2020-05-06 00:05:19 +12:00
parent 39addff34f
commit 47a4b9c433

View File

@ -57,7 +57,7 @@ export default Controller.extend(ValidationEngine, {
this.set('flowErrors', (mainError.context.string || mainError.message.string));
if (mainError.message.string.match(/your password must be reset/i)) {
if (mainError.type === 'PasswordResetRequiredError') {
this.set('passwordResetEmailSent', true);
}