1
0
mirror of https://github.com/flarum/core.git synced 2025-07-24 18:21:33 +02:00

Change back to 401 error on invalid login

See f2dbb96e84 (commitcomment-13866552)
This commit is contained in:
Toby Zerner
2015-10-21 09:04:58 +10:30
parent 15b05b359d
commit 5bec750f12
3 changed files with 7 additions and 12 deletions

View File

@@ -129,18 +129,13 @@ export default class LogInModal extends Modal {
}
onerror(error) {
switch (error.status) {
case 401:
if (error.status === 401) {
if (error.response.emailConfirmationRequired) {
error.alert.props.children = app.trans('core.forum.log_in_confirmation_required_message', {email: error.response.emailConfirmationRequired});
delete error.alert.props.type;
break;
case 404:
} else {
error.alert.props.children = app.trans('core.forum.log_in_invalid_login_message');
break;
default:
// no default
}
}
super.onerror(error);

View File

@@ -236,7 +236,7 @@ export default class App {
return responseText;
};
if (this.requestError) this.requestError.hideAlert();
if (this.requestError) this.alerts.dismiss(this.requestError.alert);
// Now make the request. If it's a failure, inspect the error that was
// returned and show an alert containing its contents.