Skip to content

Add password fields and secure validation#48

Closed
rikardodlpj88 wants to merge 4 commits into
devfrom
fix/ADM/user-creation-form
Closed

Add password fields and secure validation#48
rikardodlpj88 wants to merge 4 commits into
devfrom
fix/ADM/user-creation-form

Conversation

@rikardodlpj88
Copy link
Copy Markdown
Contributor

  1. Add Password and Confirm Password inputs to the New User form.

  2. Update Zod schema and safeParse call to include password and confirmPassword.

  3. Enforce password complexity rules (min. 8 characters, uppercase, lowercase, number, special symbol) and verify both fields match, showing “Passwords do not match” on the confirm field.

  4. Map and display validation errors for both password and confirmPassword.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 18, 2025

Deploy Preview for pharmatechadmin ready!

Name Link
🔨 Latest commit 9600c8d
🔍 Latest deploy log https://app.netlify.com/projects/pharmatechadmin/deploys/682fc46452a6d30008949bf3
😎 Deploy Preview https://deploy-preview-48--pharmatechadmin.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@gus211 gus211 left a comment

Choose a reason for hiding this comment

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

Por lo que cambié el registerSchema.ts en el PR #49 va a haber conflictos entre ese PR y éste #48.

Ya le agregué la prop showPasswordToggle a los inputs de password y confirmPassword porque al ser contraseñas se debe poder mostar/ocultar y actualicé la rama.

En general lo veo bien, lgtm.

@gus211 gus211 marked this pull request as draft May 23, 2025 00:31
@@ -125,7 +131,7 @@ export default function NewUserPage() {
const payload = {
Copy link
Copy Markdown
Contributor

@gus211 gus211 May 23, 2025

Choose a reason for hiding this comment

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

Agregaste los inputs de password y confirmPassword, lo validas y eso está bien, sin embargo, acá en el payload no estás enviando password entonces no tiene sentido.

Además, ya probé agregandolo y aparece el error property password should not exist porque el endpoint api.user.create(payload, token); NO espera password entonces en el backend hay que hacer ese fix.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@andres15alvarez
Copy link
Copy Markdown
Member

Se cierra el PR ya que por seguridad la contraseña se asignara de manera random desde el backend, enviandola por correo al usuario creado

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.

3 participants