-
Notifications
You must be signed in to change notification settings - Fork 0
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
The head ref may contain hidden characters: "497-adicionar-confirma\u00E7\u00E3o-de-senha"
Conversation
There was a problem hiding this 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!
src/pages/CreateUserPage.jsx
Outdated
@@ -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 })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setNewUser((prev) => ({ ...prev, hash: randomHash , confirmHash: randomHash })); | |
setNewUser((prev) => ({ ...prev, hash: randomHash , hashValidation: randomHash })); |
src/pages/CreateUserPage.jsx
Outdated
@@ -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"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name="hash" | |
name="hash-validation" |
src/pages/CreateUserPage.jsx
Outdated
@@ -577,16 +597,16 @@ function CreateUserPage(props) { | |||
<TextButton | |||
text={isEditing ? 'Concluir' : 'Criar'} | |||
hsl={[97, 43, 70]} | |||
onClick={() => { | |||
onClick={ newUser.hash === newUser.confirmHash ? () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onClick={ newUser.hash === newUser.confirmHash ? () => { | |
onClick={ newUser.hash === newUser.hashValidation ? () => { |
src/pages/CreateUserPage.jsx
Outdated
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 })} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onChange={(e) => setNewUser({ ...newUser, confirmHash: e.target.value })} | |
onChange={(e) => setNewUser({ ...newUser, hashValidation: e.target.value })} |
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. |
… senha