[html-formfu] ping moritz: RequestToken

Carl Franks fireartist at gmail.com
Wed Apr 15 08:17:49 GMT 2009


2009/4/14 Carl Franks <fireartist at gmail.com>:
> 2009/4/14 Moritz Onken <onken at houseofdesign.de>:
>> Hi Carl,
>>
>>
>> there is still this failing test t/01basic-token.t which fails.
>> In t/lib/MyApp/Controller/TokenExpire.pm I set a negative expiration time
>> but it get's lost somewhere while the plugin tries to set this expiration
>> time on Element::RequestToken.
>>
>> I made accessors for all those config options in Element::RequestToken and
>> Plugin::RequestToken should set those on the element, but this does not
>> happen.
>
> Sorry, I'd forgotten about this!
>
> I think I've narrowed it down a bit.
>
> When adding an element with
>    $form->element({ type => 'Foo', arg => 'foo' })
> internally, that extra 'arg' is set after $element->new() is called.
>
> In Element::RequestToken->new, it calls
>    $self->default( $self->get_token )
> which uses expiration_time() before your custom value is set.
>
> I've tried getting around this, by moving the default(get_token) into
> a pre_process() method, but that just makes things worse ;)
> I'm still figuring out how the RequestToken works, so I'll need to
> have another look at this tomorrow.

I forgot to mention that I fixed the first problem of
expiration_time() not being set properly
- the fix is in HTML-FormFu svn r1434

Carl



More information about the HTML-FormFu mailing list