Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/controllers/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ export default class RegisterController extends Controller {
.catch(reason => {
if (reason && Object.prototype.hasOwnProperty.call(reason, 'errors') && reason.errors[0].status === 409) {
this.set('errorMessage', this.l10n.t('User already exists.'));
} else if (reason && Object.prototype.hasOwnProperty.call(reason, 'errors') && reason.errors[0].status === '422') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
} else if (reason && Object.prototype.hasOwnProperty.call(reason, 'errors') && reason.errors[0].status === '422') {
} else if (reason?.errors[0]?.status === '422') {

this.set('errorMessage', this.l10n.t('Invalid email address.'));
} else {
this.set('errorMessage', this.l10n.t('An unexpected error occurred.'));
}
Expand Down