Showing
2 changed files
with
4 additions
and
4 deletions
... | @@ -63,7 +63,7 @@ function LoginPage(props) { | ... | @@ -63,7 +63,7 @@ function LoginPage(props) { |
63 | 63 | ||
64 | dispatch(login(UserData)) | 64 | dispatch(login(UserData)) |
65 | .then(res => { | 65 | .then(res => { |
66 | - if (res.payload.logged) { | 66 | + if (res.payload.loginSuccess) { |
67 | props.history.push('/register'); | 67 | props.history.push('/register'); |
68 | } else { | 68 | } else { |
69 | alert(res.payload.error); | 69 | alert(res.payload.error); | ... | ... |
... | @@ -31,13 +31,13 @@ export function login(data) { | ... | @@ -31,13 +31,13 @@ export function login(data) { |
31 | } | 31 | } |
32 | }; | 32 | }; |
33 | 33 | ||
34 | -export default function (state = InitialState, action) { | 34 | +export default function (state = {}, action) { |
35 | switch (action.type) { | 35 | switch (action.type) { |
36 | case REGISTER: | 36 | case REGISTER: |
37 | - return {...state, register: action.payload}; | 37 | + return {...state, success: action.payload}; |
38 | break; | 38 | break; |
39 | case LOGIN: | 39 | case LOGIN: |
40 | - return {...state, logged: action.payload}; | 40 | + return {...state, loginSuccess: action.payload}; |
41 | break; | 41 | break; |
42 | default: | 42 | default: |
43 | return state; | 43 | return state; | ... | ... |
-
Please register or login to post a comment