Just for the record, there's already an SQLAlchemy/Elixir-based repoze.who authenticator: http://code.gustavonarea.net/repoze.who.plugins.sa/
So you don't have to write it yourself. Cheers. PS: Regarding your problem, I think RedirectingFormPlugin is a good solution. But anyway, I think this conversation deserves its own thread. On Monday January 26, 2009 20:18:04 TJ Ninneman wrote: > > Have you managed to deal with the problem of login handlers and error > > messages, that is what happens if a user tries to log in and for > > whatever reason, fails? > > > > I'm currently using repoze.who, and haven't managed to overcome this > > major point, even though I've discussed it at length with Chris > > McDonough. > > > > Cheers, > > Tom > > LOL, no I haven't. We are still early enough in development of this > site that I just figured I'd go back and figure that out later. > > What about setting a session based flash message in your custom auth > plugin: > > class UserModelPlugin(object): > > def authenticate(self, environ, identity): > try: > username = identity['login'] > password = identity['password'] > except KeyError: > return None > > success = authenticate_user(model.User, model.meta.Session, > username, password) > if success: > return success > else: > environ['beaker.session']['flash'] = "Some sort of explanatory > failure message" > return None > > Of course you have to be using the session middleware and put your > auth middleware after your session middleware. > > TJ > > > -- Gustavo Narea <http://gustavonarea.net/>. Get rid of unethical constraints! Get freedomware: http://www.getgnulinux.org/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "pylons-discuss" 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/pylons-discuss?hl=en -~----------~----~----~----~------~----~------~--~---
