Sorry for the late response. Try this:
if session.logincount != 1:
auth.settings.login_captcha = Recaptcha(...)
form=auth.login()
On Thursday, March 1, 2012 6:18:02 AM UTC-8, mweissen wrote:
>
> Hi,
>
> I want to do the following.
> - login using auth.login
> - if login fails captcha should be switched on and every further login (in
> the same session) should require a correct captcha.
>
> I have tried something like
>
> def mylogin():
> session.logincount = (session.logincount or 0) + 1
> form=auth.login()
> if session.logincount != 1:
> form.element('table').insert(-1, '', Recaptcha(.....),''))
> return dict(form=form)
>
> mylogin works, but I could not connect it with auth...
> Maybe using auth.settings.login_url or auth.settings.login_onvalidation
> is the answer?
>
> Regards, Martin
>
>
--