mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
fix error message issues in accounts form
This commit is contained in:
parent
3ca3198949
commit
3b863e7cbb
1 changed files with 12 additions and 2 deletions
|
@ -638,8 +638,13 @@ export class AccountsLoginForm extends Tracker.Component {
|
|||
Meteor.loginWithPassword(loginSelector, password, (error, result) => {
|
||||
onSubmitHook(error,formState);
|
||||
if (error) {
|
||||
console.log(error);
|
||||
const errorId = `accounts.error_${error.reason.toLowerCase().replace(/ /g, '_')}`;
|
||||
this.showMessage(this.context.intl.formatMessage({id: errorId}) || 'accounts.error_unknown', errorId, 'error');
|
||||
if (this.context.intl.formatMessage({id: errorId})) {
|
||||
this.showMessage(errorId);
|
||||
} else {
|
||||
this.showMessage('accounts.error_unknown');
|
||||
}
|
||||
}
|
||||
else {
|
||||
loginResultCallback(() => this.state.onSignedInHook());
|
||||
|
@ -698,11 +703,16 @@ export class AccountsLoginForm extends Tracker.Component {
|
|||
loginWithService(options, (error) => {
|
||||
onSubmitHook(error,formState);
|
||||
if (error) {
|
||||
console.log(error)
|
||||
if (error instanceof Accounts.LoginCancelledError) {
|
||||
// do nothing
|
||||
} else {
|
||||
const errorId = `accounts.error_${error.reason.toLowerCase().replace(/ /g, '_')}`;
|
||||
this.showMessage((error.reason && this.context.intl.formatMessage({id: errorId})) || 'accounts.error_unknown' && errorId)
|
||||
if (this.context.intl.formatMessage({id: errorId})) {
|
||||
this.showMessage(errorId);
|
||||
} else {
|
||||
this.showMessage('accounts.error_unknown');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.setState({ formState: STATES.PROFILE });
|
||||
|
|
Loading…
Add table
Reference in a new issue