[html-formfu] password element: empty after submission

Carl Franks fireartist at gmail.com
Tue Nov 11 16:37:31 GMT 2008


2008/11/11 Jens Schwarz <blacky6767 at gmx.de>:
>
> -------- Original-Nachricht --------
>> Datum: Tue, 11 Nov 2008 13:58:32 +0100
>> Von: "Jens Schwarz" <blacky6767 at gmx.de>
>> An: html-formfu at lists.scsys.co.uk
>> Betreff: Re: [html-formfu] password element: empty after submission
>
>> (...)
>>   - type: Password
>>     name: mypass
>>     label: Enter password
>>     filters:
>>       - type: Callback
>>         callback: <catalyst root>::Controller::somewhere::myhashedpassword
>> (...)
>
> Hmm, I guess you native-english speakers say something like "Don't count your chickens before they are hatched." :)
> The yml above works fine ... but:
> If I want to add a contraint like ...
>
> constraints:
>  - type: Length
>    min: 8
>    message: Your password should at least be 8 characters long
>
> ... the Callback filter messes up this constraint because it first hashes the password to a 40 characters long SHA1 string which therefor passes the contraint even if the entered string was less than 8 characters. I just tried to dig into Inflator/Validator/Transformer in hope to find something appropriate but I seems there are not many examples.

I suppose a Transformer would be the most appropriate hook for this.
Try just changing the filter config to:

   transformers:
     - type: Callback
       callback: <catalyst root>::Controller::somewhere::myhashedpassword

Carl



More information about the HTML-FormFu mailing list