I've run into this problem recently at work, when we wanted to lock accounts with a custom message after too many failed retries.
Thus far, the best (but still ugly) workaround that I've found is to have our custom Repoze authenticator add a query string parameter to the FriendlyFormPlugin post_login_url property, then look for that parameter in the controller. It's not totally reliable - sometimes the parameter doesn't arrive in the controller, perhaps due to caching of some kind - but it often seems to work. I wish Repoze would pass through the username that was attempted when it is reporting a login failure to the application, so that the application could check up on that username and figure out the cause of failure. Or simply allow custom parameters to be set in the authenticator and passed through to the app. Haven't found a good way yet. On Tuesday, 9 November 2010 02:31:08 UTC+10, Yannick Gingras wrote: > > > Greetings TG users, > I have been digging down in the auth code that I get from the quick > start and there does not seem to be a way to have custom error > messages for login failures. I see that I can change the flash > message but nevertheless, it's one message for all the possible > failures. > > What would be a the least painful way to have custom messages for > cases like: > - no user name > - no password > - invalid password > - user account has been locked by site admins > > Doing that at form validation time would be trivial so I'm thinking of > stripping the friendly form plugin from the equation but I can't see > an easy way to do that. > > Would it be easier to tell TG not to initially the auth stack and to > create the repoze.who auth cookied by hand? > > Thanks in advance for your help, > > -- > Yannick Gingras > http://ygingras.net > http://montrealpython.org -- lead organizer > http://ajah.ca -- technical lead > > -- You received this message because you are subscribed to the Google Groups "TurboGears" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/turbogears?hl=en. For more options, visit https://groups.google.com/groups/opt_out.

