From c4224731252095cce7ef488bb1353d8b3fc65c65 Mon Sep 17 00:00:00 2001 From: Asara Date: Sat, 5 Oct 2019 22:24:13 -0400 Subject: [PATCH] Add default credentials to axios --- src/actions/index.js | 3 +-- src/apis/sudoscientist.js | 6 +----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/actions/index.js b/src/actions/index.js index 46322ac..043738f 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -22,8 +22,7 @@ export const userLogin = (username, password) => async (dispatch) => { const response = await sudoscientist.post('/auth/signin', { username: username, password: password - }, - {withCredentials: true}, + } ) if (response.status === 401) { console.log("Please check your credentials") diff --git a/src/apis/sudoscientist.js b/src/apis/sudoscientist.js index 9bb7419..97e9d3f 100644 --- a/src/apis/sudoscientist.js +++ b/src/apis/sudoscientist.js @@ -2,9 +2,5 @@ import axios from 'axios'; export default axios.create({ baseURL: 'http://api.sudosci.test:8080/v1/api/', - withCredentials: true, - headers: { - 'Accept': 'application/json', - 'Content-Type': 'application/json', - } + withCredentials: true });