[ 
https://issues.apache.org/jira/browse/WICKET-6660?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16829605#comment-16829605
 ] 

Dennis Lotz commented on WICKET-6660:
-------------------------------------

Why do you expect that people want their passwords trimmed? What if a password 
manager generates a password this way. I don't think it is a good idea to 
transform password inputs in any way.

But nevertheless It wasn't trimmed in Wicket 6.x. After upgrading from Wicket 
6.x to Wicket 8.40 I couldn't log in. That is the reason why I assumed it is a 
bug.

> PasswordTextField should not be trimmed
> ---------------------------------------
>
>                 Key: WICKET-6660
>                 URL: https://issues.apache.org/jira/browse/WICKET-6660
>             Project: Wicket
>          Issue Type: Wish
>    Affects Versions: 8.4.0
>            Reporter: Dennis Lotz
>            Priority: Minor
>
> Because {{PasswordTextField}} is a {{FormComponent}} and 
> {{shouldTrimInput()}} is not overridden, passwords do get trimmed. Workaround 
> is to override the method manually for every {{PasswordTextField. }}
> {code:java}
> new PasswordTextField("password"){
>       @Override
>       protected boolean shouldTrimInput() {
>               return false;
>       }
> }
> {code}
> If you use {{org.apache.wicket.authroles.authentication.panel.SignInPanel}} 
> this gets very verbose :(
> {code:java}
> add(new SignInPanel("signInPanel") {
>       @Override
>       protected void onInitialize() {
>               super.onInitialize();
>               super.getForm().replace(new PasswordTextField("password"){
>                       @Override
>                       protected boolean shouldTrimInput() {
>                               return false;
>                       }
>               });
>       }
> });
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to