Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

187
Visualizações
How can I use https in my Frontend Project in React?

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

the error:

POST https://localhost/authenticate/ net::ERR_CERT_INVALID
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda