[email protected] wrote:
> found:
>
> - the login form must contain max_age param
> - fix the FriendlyFormPlugin
> in line 129 add those lines:
>
> max_age = form.get('max_age', None)
>
>  if credentials and max_age:
>     credentials['max_age'] = max_age
>   
You should be able to do this, I believe, without adding elements to the
login form:

from repoze.who.friendlyform import FriendlyFormPlugin

class FriendlyTimeoutPlugin( FriendlyFormPlugin ):
    def identify( self, environ ):
        identity = super( FriendlyTimeoutPlugin, self ).identify( environ )
        if identity:
            identity['max_age'] = 10
        return identity

Then in your project/config/app_cfg.py:

base_config.sa_auth.form_plugin = FriendlyTimeoutPlugin( ... )

but you'll have to manually pass all the parameters to the plugin that
are normally passed in via sa_auth in app_cfg.py.  That seems
sub-optimal to me (trivial change causes lots of changes to the client
code), but it should work.

HTH,
Mike

-- 
________________________________________________
  Mike C. Fletcher
  Designer, VR Plumber, Coder
  http://www.vrplumber.com
  http://blog.vrplumber.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to