Skip to content

Enhance password validation logic in keystore#3

Open
just-a-boy wants to merge 1 commit into
ALightbolt4G:mainfrom
just-a-boy:patch-1
Open

Enhance password validation logic in keystore#3
just-a-boy wants to merge 1 commit into
ALightbolt4G:mainfrom
just-a-boy:patch-1

Conversation

@just-a-boy

Copy link
Copy Markdown

Bug description

When nitron keystore asks for password confirmation, the validator for passwordConfirm expects values.password to exist.

But with the installed prompts version, the validate callback only receives the current value, not the full answers object. So values.password is undefined, causing the confirm check to fail even when both entries match.

Result

  • Keystore password accepts a valid password
  • Confirm password rejects it with Passwords do not match
  • The bug is in src/keystore.ts validation logic

Fix

Store the first password in a local variable when the user enters it, then compare the confirmation against that stored value instead of values.password.

## Bug description

When `nitron keystore` asks for password confirmation, the validator for `passwordConfirm` expects `values.password` to exist.

But with the installed `prompts` version, the `validate` callback only receives the current value, not the full answers object. So `values.password` is `undefined`, causing the confirm check to fail even when both entries match.

### Result
- `Keystore password` accepts a valid password
- `Confirm password` rejects it with `Passwords do not match`
- The bug is in `src/keystore.ts` validation logic

### Fix
Store the first password in a local variable when the user enters it, then compare the confirmation against that stored value instead of `values.password`.
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.

1 participant