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

186
Visualizações
Mitigate user removing required field from form

I have a few forms for signing in/up or continuing as guest using the firebase. I want the user to be forced to put in an email so I can identify the user when they come to pick up their order and send them a receipt after they've paid. There is nothing preventing the user from just inspecting element and removing the required field, and the firebase functions are called from the front end so I cant even use my server to double check there is an email.

Is there a way to mitigate this? Aside from Firebase specific solutions, is there a way to mitigate this issue with all required fields? There is obviously a way as other websites implement this but I'm not sure how

Maybe run a script to check if the required attribute has been removed but that too can be deleted or edited.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You can check if the field in question exists and has a value.

const form = document.forms.form;

form.onsubmit = () => {
  event.preventDefault();
  signInAnonymously(event.currentTarget.elements.email);
};

function signInAnonymously(email) {
  if (email && email.value) {
    console.log("Authenticate with Firebase anonymously");
  } else {
    console.log("Email is required")
  }
}
<form name="form">
<label>
  <b>Email:</b>
  <input name="email" type="email" required>
</label>
<button>Sign In Anonymously</button>
</form>

about 4 years ago · Juan Pablo Isaza Relatório
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