Skip to content

Conversation

@rightson
Copy link
Owner

Fixed the bug where password confirmation validation showed
'answer?.password undefined' error. Changed the type annotation
from restrictive { password?: string } to any to properly
access the password field from inquirer's answers object.

The issue was that the type annotation was too narrow and didn't
match the actual structure provided by inquirer's validate callback.

Fixed the bug where password confirmation validation showed
'answer?.password undefined' error. Changed the type annotation
from restrictive `{ password?: string }` to `any` to properly
access the password field from inquirer's answers object.

The issue was that the type annotation was too narrow and didn't
match the actual structure provided by inquirer's validate callback.
The previous fix didn't work because the answers parameter was null.
This commit implements a more robust solution by storing the password
in a variable (enteredPassword) when it's first validated, then
comparing the confirmation input against this stored value directly.

This approach doesn't rely on inquirer passing previous answers to
the validate callback, making it more reliable across different
inquirer versions.
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