Registration - Remove confirm password

Hello,
We’re building a mobile app and there is a ux requirement to design screens and remove the confirm password field from registration screen.

I have created a new theme and was able to deploy the ftl and it worked fine but when I try to register, it throws an error - confirm password doesn't match
To resolve this issue, I have created a new jar by implementing FormActionFactory and removing the check for confirm password, I have also added FormActionFactory in metadata/services.

The jar deployment works fine but it doesn’t trigger custom class, instead it still gives this error. How can I override my cusotm class so that keycloak class doens’t get invoked ?

Go into Admin/Authentication, select the flow you are using currently and copy it to a new one (define clear new name).
Add your modified authenticator to that flow, remove the old one.
Go to the bindings tab and select your new flow (name you created above) to be used instead of the default flow (which you copied).
You cannot modify the default flows.

Yes I saw this exactly in. keycloak documentation and followed the steps, however I found out that keycloak default RegisterPassword class still executes and validate the confirmPassword, I had to override the default RegisterPassword class in my custom jar so that the classloader loads the custom class instead of default one; It’s a hecky solution but it works.

Is there any new way of how to disable password confirmation field in registration form?