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

162
Visualizações
How Can I display points instead of password with reactJs?

actually I want to display the users from my db in a table..I have a password that I want to display points instead of it..anyone could help me doing this? this how I display the password

      <td> <Lock size={14} color=" #273746 " /> &nbsp; {item.password}</td>

I would be very thankful if anyone of you can help mee

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

0

If you want to generate a string of asterisks with the same length as the original string (e.g. item.password), then you can utilize the String.prototype.repeat method:

"*".repeat("mysecretpassword".length); // "****************"

However, I would advise showing a constant number of asterisks not related to the passwords because it is significantly easier to hack a password if a malicious person knew the number of characters was in it by counting the asterisks if they had, for example, taken a picture of the hidden passwords list. Therefore, I think you're best bet would be to just hard code a certain number of asterisks and show it for all of the passwords:

"**********"
about 4 years ago · Juan Pablo Isaza Relatório

0

answers above look correct but I just need to remember you that you shouldn't ever get text/plain passwords from your API. further, you shouldn't keep passwords in text/plain on database. if you really need to keep them in text/plain form, you already need to mask them on back-end before sending them to the client (front-end).

about 4 years ago · Juan Pablo Isaza Relatório

0

You can use Javascript string replace function. You can find it here : https://www.w3schools.com/jsref/jsref_replace.asp

{item.password.replace({item.password}, "**********")}

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