This page contains forum extracts regarding the authentication module (auth)
from http://groups.google.com/ group/web2py/browse_thread/ thread/85482675720982a1
From: Jurgis Pralgauskis < jurgis.pralgaus...@gmail.com >
Date: Wed, 6 May 2009 06:12:29 -0700 (PDT)
Local: Wed, May 6 2009 9:12 am
Subject: weird errors (probably with crud)
there seems to be crud+auth problem
becauase if I not enable auth4crud
# crud.settings.auth=auth # (optional) enforces
authorization on crud
things work nicely
by the way,
the registration confirmation email contains very incomplete link :/
Click on the link http://...verify_email/ 6a2cd595-17a1-4044-b5ef- 1153e272f78e
to verify your email
From: mdipierro < mdipie...@cs.depaul.edu >
Date: Wed, 6 May 2009 11:48:29 -0700 (PDT)
Local: Wed, May 6 2009 2:48 pm
Subject: Re: weird errors (probably with crud)
|
It is a feature, not a bug. You are supposed to customize the message
auth.messages.verify_email = 'Click on the link
http://hostname/appname/ default/user/verify_email/%( key)s to verify
your email'
else web2py does not know what the public URL is.
Massimo
====================================================================================
|
From http://groups.google.com/group/web2py/browse_thread/thread/63c5c76ce4f99e5d
From: annet <annet.verm...@gmail.com> Date: Wed, 6 May 2009 10:17:44 -0700 (PDT) Local: Wed, May 6 2009 1:17 pm Subject: requires_login(next='')
In t2 you could do: @t2.requires_login(next='login') In tools.py @auth.requires_login(next='../authtool/login') doesn't work: TypeError: requires_login() got an unexpected keyword argument 'next'
What's the equivalent of t2.requires_login(next='login') in tools.py?
In the online documentation I read: In your controller (for example in default.py) expose the auth object (for example via a user action)
I created a controller authtool and defined the actions like this: def register(): return dict(form=auth.register()) def login(): return dict(form=auth.login(next='../crudtool/index')) ....
Furthermore I created a controller crudtool in which I will define crud actions. When I expose the index function in crudtool: @auth.requires_login() def index(): return dict(message="hello from crudtool.py")
it redirects to: http://127.0.0.1:8000/mock/crudtool/user/login, but there is no function user and args login. Whereas it should redirect me to http://127.0.0.1:8000/mock/authtool/login I thought I would solve this using the next attribute...
Kind regards, Annet
From: mdipierro <mdipie...@cs.depaul.edu> Date: Wed, 6 May 2009 10:45:46 -0700 (PDT) Local: Wed, May 6 2009 1:45 pm Subject: Re: requires_login(next='')
auth.settings.login_next='.....'
Massimo
|