1
0
Fork 0

sorting out this login issue

This commit is contained in:
Amarpreet Minhas 2020-01-22 00:40:15 -05:00
parent d802da6f8b
commit 5b0c07b09c

View file

@ -23,12 +23,12 @@ 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 })
} }
}; };