Skip to content

Commit

Permalink
hotfix: fix password masking and otp length (mosip#52)
Browse files Browse the repository at this point in the history
* fix: use otp length config

* fix: fix password masking icon logic

---------

Co-authored-by: Bunsy <[email protected]>
Signed-off-by: Sreang Rathanak <[email protected]>
  • Loading branch information
2 people authored and Sreang Rathanak committed Jan 15, 2024
1 parent 84ca7bd commit e342628
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions signup-ui/src/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
onClick={togglePasswordVisibility}
>
{showPassword ? (
<Icons.eye className="h-5 w-5 text-gray-500" />
) : (
<Icons.eyeOff className="h-5 w-5 text-gray-500" />
) : (
<Icons.eye className="h-5 w-5 text-gray-500" />
)}
</button>
)}
Expand Down
6 changes: 5 additions & 1 deletion signup-ui/src/pages/SignUpPage/SignUpPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ export const SignUpPage = ({ settings }: SignUpPageProps) => {
}),
// Step 2 - OTP Validation
yup.object({
otp: yup.string().matches(/^\d{6}$/gm),
otp: yup
.string()
.matches(
new RegExp(`^\\d{${settings.response.configs["otp.length"]}}$`)
),
}),
// Step 3 - Status Validation
yup.object({}),
Expand Down

0 comments on commit e342628

Please sign in to comment.