diff --git a/app/gabsocial/features/auth_login/index.js b/app/gabsocial/features/auth_login/index.js index 705c42bc6..35c60022f 100644 --- a/app/gabsocial/features/auth_login/index.js +++ b/app/gabsocial/features/auth_login/index.js @@ -4,6 +4,7 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { createAuthApp, logIn } from 'gabsocial/actions/auth'; import { fetchMe } from 'gabsocial/actions/me'; import { Link } from 'react-router-dom'; +import { showAlert } from 'gabsocial/actions/alerts'; export default @connect() class LoginForm extends ImmutablePureComponent { @@ -27,8 +28,8 @@ class LoginForm extends ImmutablePureComponent { const { username, password } = this.getFormData(event.target); dispatch(logIn(username, password)).then(() => { return dispatch(fetchMe()); - }).catch(() => { - // TODO: Handle bad request + }).catch((error) => { + dispatch(showAlert('Login failed', 'Invalid username or password.')); this.setState({isLoading: false}); }); this.setState({isLoading: true}); diff --git a/app/gabsocial/features/landing_page/index.js b/app/gabsocial/features/landing_page/index.js index acbaf00b5..ef89f32e7 100644 --- a/app/gabsocial/features/landing_page/index.js +++ b/app/gabsocial/features/landing_page/index.js @@ -3,6 +3,7 @@ import { connect } from 'react-redux' import ImmutablePureComponent from 'react-immutable-pure-component'; import { Link } from 'react-router-dom'; import LoginForm from 'gabsocial/features/auth_login'; +import NotificationsContainer from 'gabsocial/features/ui/containers/notifications_container'; const mapStateToProps = (state, props) => ({ instance: state.get('instance'), @@ -118,6 +119,7 @@ class LandingPage extends ImmutablePureComponent { + ) }