-
Notifications
You must be signed in to change notification settings - Fork 1
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
BA-2362 Add validations to reset change password #238
BA-2362 Add validations to reset change password #238
Conversation
|
WalkthroughThe pull request updates password validation logic in two authentication modules. In both the expired password and reset password flows, the non-empty check for passwords has been replaced with a minimum length requirement and a regex check (using Changes
Sequence Diagram(s)sequenceDiagram
participant U as User
participant A as Auth Module
participant V as Validator
U->>+A: Submit password change/reset request
A->>+V: Validate password (min length, regex check)
V-->>-A: Return validation result (pass/fail)
A-->>-U: Respond with success or error
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure. 🔧 ESLint
ERR_PNPM_OPTIONAL_DEPS_REQUIRE_PROD_DEPS Optional dependencies cannot be installed without production dependencies Tip ⚡🧪 Multi-step agentic review comment chat (experimental)
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
🚧 Files skipped from review as they are similar to previous changes (8)
⏰ Context from checks skipped due to timeout of 90000ms (3)
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/authentication/modules/access/useResetPassword/constants.ts (1)
9-12
: Consider applying consistent validation to confirmNewPasswordWhile the validation for newPassword has been improved with regex pattern checking, confirmNewPassword still only uses nonempty validation. Although the refinement ensures both passwords match, applying consistent validation would make the code more maintainable.
newPassword: z.string().min(1, ZOD_MESSAGE.required).regex(PASSWORD_REGEX, { message: ZOD_MESSAGE.password, }), - confirmNewPassword: z.string().nonempty(ZOD_MESSAGE.required), + confirmNewPassword: z.string().min(1, ZOD_MESSAGE.required).regex(PASSWORD_REGEX, { + message: ZOD_MESSAGE.password, + }),
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
packages/authentication/modules/access/useChangeExpiredPassword/constants.ts
(1 hunks)packages/authentication/modules/access/useResetPassword/constants.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Analyze (javascript)
🔇 Additional comments (4)
packages/authentication/modules/access/useResetPassword/constants.ts (2)
1-1
: LGTM: Added PASSWORD_REGEX importGood addition of the PASSWORD_REGEX import to support the enhanced password validation.
9-11
: Improved password validation with regex patternThe change strengthens security by adding regex validation to ensure password complexity, rather than just checking for non-emptiness.
packages/authentication/modules/access/useChangeExpiredPassword/constants.ts (2)
1-1
: LGTM: Added PASSWORD_REGEX importGood addition of the PASSWORD_REGEX import to support the enhanced password validation.
9-11
: Improved currentPassword validation with regex patternThe change strengthens security by adding regex validation to ensure password complexity, rather than just checking for non-emptiness.
packages/authentication/modules/access/useChangeExpiredPassword/constants.ts
Outdated
Show resolved
Hide resolved
ed2f9a4
to
2e32d4c
Compare
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/authentication/CHANGELOG.md (1)
7-7
: Changelog Description Clarity
The bullet point "- Add password validations to reset and change expired password" effectively communicates the change. Consider a minor rewording for clarity—perhaps "Add password validations for resetting and changing expired passwords"—to ensure it reads smoothly for both technical and non-technical stakeholders.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
packages/authentication/CHANGELOG.md
(1 hunks)packages/authentication/package.json
(1 hunks)packages/components/CHANGELOG.md
(1 hunks)packages/components/package.json
(1 hunks)
✅ Files skipped from review due to trivial changes (3)
- packages/components/package.json
- packages/authentication/package.json
- packages/components/CHANGELOG.md
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Component Test Packages
🔇 Additional comments (1)
packages/authentication/CHANGELOG.md (1)
3-4
: New Version Entry Added
The new version heading "## 4.1.9" clearly marks the update and aligns with the recent changes to password validations.
9f7c1da
to
699963b
Compare
|
Summary by CodeRabbit
Summary by CodeRabbit
New Features
Tests
Chores
@baseapp-frontend/authentication
and@baseapp-frontend/components
to reflect the latest changes.