handle error better
parent
385d3ed169
commit
bc5485fbbc
|
@ -77,7 +77,6 @@ export const checkPassword = (email, password) => async (dispatch, getState) =>
|
|||
dispatch(setLoggedIn(res))
|
||||
// dispatch(setWorking(false))
|
||||
} catch (e) {
|
||||
console.log(e.toString())
|
||||
dispatch(setError({
|
||||
type: 'password',
|
||||
error: e.toString()
|
||||
|
|
|
@ -88,6 +88,9 @@ export default class Ajax {
|
|||
if (xhr.status === 405) {
|
||||
reject(new AjaxError('405 Method Not Allowed', data, xhr))
|
||||
return
|
||||
} else if (xhr.status === 404) {
|
||||
reject(new AjaxError('404 Not Found', data, xhr))
|
||||
return
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
|
@ -6,7 +6,6 @@ import Progress from './components/Progress'
|
|||
import Carousel, {CarouselItem} from './containers/Carousel'
|
||||
import UnderlineInput from './components/UnderlineInput'
|
||||
import reducer from './reducers/login'
|
||||
|
||||
import {setEmail, setPassword, setCarousel, checkEmail, checkPassword} from './actions/login'
|
||||
|
||||
import STYLE from '../styles/login.scss'
|
||||
|
|
|
@ -33,6 +33,10 @@ const reducer = (state = {}, action) => {
|
|||
return {
|
||||
emailError: data.error
|
||||
}
|
||||
case 'password':
|
||||
return {
|
||||
passwordError: data.error
|
||||
}
|
||||
default: return {}
|
||||
}
|
||||
case Actions.clear_error:
|
||||
|
|
|
@ -64,7 +64,5 @@ module.exports.http = {
|
|||
// var middlewareFn = skipper({ strict: true });
|
||||
// return middlewareFn;
|
||||
// })(),
|
||||
|
||||
},
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ module.exports = {
|
|||
plugins: [
|
||||
new HtmlWebpackPlugin({
|
||||
template: 'assets/templates/login.html',
|
||||
links: [{ rel: 'stylesheet', type: 'text/css', href: 'login.css' }],
|
||||
links: process.env.NODE_ENV === 'production' ? [{ rel: 'stylesheet', type: 'text/css', href: 'login.css' }] : [],
|
||||
filename: path.join(__dirname, '/.tmp/public/login.html')
|
||||
}),
|
||||
new MiniCssExtractPlugin({
|
||||
|
|
Loading…
Reference in New Issue