lukin / keywind

Keywind is a component-based Keycloak Login Theme built with Tailwind CSS
Apache License 2.0
737 stars 261 forks source link

Cancel button on change password is no-op when fields empty #72

Open jblachly opened 7 months ago

jblachly commented 7 months ago

The cancel button at the change password screen does nothing when fields are empty (not validating).

In Firefox, it appears to be a no-op. Safari shows "Fill out this field" hint when clicking cancel. Interestingly, passwords don't need to match in order to pass "validation" for purposes of cancelling.

Behavior is as expected in all browsers using default theme.

Keycloak version: 21.1.2 Keywind version: 6e5ef061bfdaafd7d22a3c812104ffe42aaa55b8

jblachly commented 5 months ago

This is because keywind includes the required attribute on the password and password confirmation fields, in combination with the fact that the "cancel" button is a form submit button.

https://github.com/lukin/keywind/blob/bdf966fdae0071ccd46dab4efdc38458a643b409/theme/keywind/login/components/atoms/input.ftl#L13

Note that the base theme does not include the required attributes: https://github.com/keycloak/keycloak/blob/main/themes/src/main/resources/theme/base/login/login-update-password.ftl