On 03/11/2012 11:47 PM, Tres Seaver wrote:
> On 03/11/2012 05:36 PM, alex bodnaru wrote:
>> hello friends,
>> thanks again for repoze.*
> Glad you find them useful!
>> one question: i've seen an api login method for repoze 2.
>> from repoze.who.api import get_api who_api = get_api(request.environ)
>> authenticated, headers = \ who_api.login(dict(login=Login,
>> how could i login a user in a program using repoze 1?
> You have put your finger on it: The separate API is really the major new
> feature in r.who 2.0.
>> i came up with the following solution, but is it the best way to go?
>> plugins = request.environ.get('repoze.who.plugins').values()
>> rememberers = [auth for auth in plugins if hasattr(auth, 'remember')]
>> res = rememberers and \ rememberers.remember(request.environ,
>> dict(login=Login, password=UserPass))
> That is pretty much the required workaround for the lack of an API in
> r.who 1.x.
thank you very much.
Repoze-dev mailing list