Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#497 [FEAT] Adicionar confirmação de senha na hora de atualizar/criar… #510

Merged
merged 4 commits into from
Feb 19, 2025

Conversation

Gst-22
Copy link
Contributor

@Gst-22 Gst-22 commented Jan 27, 2025

… senha

Copy link
Contributor

@YuriTobias YuriTobias left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excelente! Sugestões vide código: alterar o label e o name da div de confirmação de senha para distinguir da div de senha; e, substituir "confirmHash" por "hashValidation". Aprovado!

@@ -277,7 +277,7 @@ function CreateUserPage(props) {
const generateRandomHash = () => {
//Random hash with special chars and exactly 12 characters
const randomHash = Array.from({ length: 12 }, () => String.fromCharCode(Math.floor(Math.random() * 93) + 33)).join('');
setNewUser((prev) => ({ ...prev, hash: randomHash }));
setNewUser((prev) => ({ ...prev, hash: randomHash , confirmHash: randomHash }));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
setNewUser((prev) => ({ ...prev, hash: randomHash , confirmHash: randomHash }));
setNewUser((prev) => ({ ...prev, hash: randomHash , hashValidation: randomHash }));

@@ -412,6 +412,26 @@ function CreateUserPage(props) {
</div>
</div>
</div>
<div className="mb-3">
<label label="hash" className="form-label color-steel-blue fs-5 fw-medium">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<label label="hash" className="form-label color-steel-blue fs-5 fw-medium">
<label label="hash-validation" className="form-label color-steel-blue fs-5 fw-medium">

<div className="col">
<input
type={passwordVisibility ? 'text' : 'password'}
name="hash"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name="hash"
name="hash-validation"

@@ -577,16 +597,16 @@ function CreateUserPage(props) {
<TextButton
text={isEditing ? 'Concluir' : 'Criar'}
hsl={[97, 43, 70]}
onClick={() => {
onClick={ newUser.hash === newUser.confirmHash ? () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onClick={ newUser.hash === newUser.confirmHash ? () => {
onClick={ newUser.hash === newUser.hashValidation ? () => {

id="hash"
className="form-control rounded-4 bg-light-pastel-blue color-grey fw-medium fs-5 border-0"
autoComplete="new-password"
onChange={(e) => setNewUser({ ...newUser, confirmHash: e.target.value })}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
onChange={(e) => setNewUser({ ...newUser, confirmHash: e.target.value })}
onChange={(e) => setNewUser({ ...newUser, hashValidation: e.target.value })}

@Gst-22
Copy link
Contributor Author

Gst-22 commented Feb 17, 2025

Já que a issue de remover a obrigatoriedade do usuário inserir a senha para atualizar o próprio perfil tratava de uma área semelhante do código, decidi incluir nessa mesma pull request.

@Gst-22 Gst-22 merged commit fe3a230 into main Feb 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Adicionar confirmação de senha na hora de atualizar/criar senha
2 participants