diff --git a/src/actions/index.js b/src/actions/index.js index d894f68..0959fec 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -23,5 +23,10 @@ export const userLogin = (username, password) => async (dispatch) => { username: username, password: password }) - dispatch({ type: 'USER_LOGIN', payload: response }) + if (response.status === 401) { + alert("Please check your credentials") + } + if (response.status === 200) { + dispatch({ type: 'USER_LOGIN', payload: response }) + } }; diff --git a/src/components/AuthMenu.js b/src/components/AuthMenu.js index 95f2b73..9ef009c 100644 --- a/src/components/AuthMenu.js +++ b/src/components/AuthMenu.js @@ -67,7 +67,7 @@ class AuthMenu extends Component { this.setState(state => ({ auth_menu_visible: false })) - console.log(res) + this.props.close() } ) .catch(err => { diff --git a/src/components/NavBar.js b/src/components/NavBar.js index ecc3f8e..cc0e320 100644 --- a/src/components/NavBar.js +++ b/src/components/NavBar.js @@ -29,7 +29,7 @@ class NavBar extends Component {