sorting out this login issue
This commit is contained in:
parent
d802da6f8b
commit
5b0c07b09c
1 changed files with 3 additions and 3 deletions
|
@ -20,15 +20,15 @@ export const fetchUserProfile = (user) => async (dispatch) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const userLogin = (username, password) => async (dispatch) => {
|
export const userLogin = (username, password) => async (dispatch) => {
|
||||||
const response = await sudoscientist.post('/auth/signin', {
|
const response = await sudoscientist.post('/auth/signin',{
|
||||||
username: username,
|
username: username,
|
||||||
password: password
|
password: password
|
||||||
}
|
})
|
||||||
)
|
|
||||||
if (response.status === 401) {
|
if (response.status === 401) {
|
||||||
dispatch({ type: 'USER_LOGIN', payload: null })
|
dispatch({ type: 'USER_LOGIN', payload: null })
|
||||||
}
|
}
|
||||||
if (response.status === 200) {
|
if (response.status === 200) {
|
||||||
|
console.log(document.cookie)
|
||||||
dispatch({ type: 'USER_LOGIN', payload: response })
|
dispatch({ type: 'USER_LOGIN', payload: response })
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Reference in a new issue