I do all the stuff which I found on stackoverflow.. but it doesn´t work for me..
I will show you an example ..
I do this in my package.json in Frontend :
"scripts": {
"start": "set HTTPS=true && react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
And that would be my userAction Login but it doesn´t work:
export const login = (userID, password) => async (dispatch) => {
try {
dispatch({ type: USER_LOGIN_REQUEST });
const url = "https://localhost/authenticate/";
const response = await axios.post(
url,
{
withCredentials: true,
headers: {
Accept: "application/json",
"Content-Type": "application/json",
},
},
{
auth: {
username: userID,
password,
},
}
);
const config = {
auth: {
username: userID,
password,
},
};
In my backend it would be this way and it works :
###
POST https://localhost:443/authenticate/
Authorization: Basic YWRtaW46MTIz