You should do:
auth.settings.on_failed_authorization = fff
You were calling the function fff() instead of assigning it to
on_failed_authorization. Auth will call the function itself at the
appropriate time.
Anthony
On Wednesday, October 19, 2011 10:21:18 AM UTC-4, d wrote:
>
> Hi All,
>
> I
Thanks Anthony,
After change to
auth.settings.on_failed_authorization = fff
for controller which requires log in and if user not logged in, it
redirect to log in page. But purpose of using fff function is to raise
http error but not redirecting to log in page.
def fff():
raise HTTP(403, "H
I think you actually want:
auth.settings.on_failed_authentication = fff
Note, authentication rather than authorization. I believe
on_failed_authentication will be called before any redirect to the login
page, and on_failed_authorization gets called after login if the condition
for authorizatio
Thanks a lot for reply. It is the problem.
And there is minor change in fff function needed
def fff(args):
raise HTTP(403, "HTTP 403: Not authenticated to access this URL.")
because if do not put args in fff(), it complains error
Now it works fine. Thanks a lot!
This forum is really useful
On Wed, Oct 19, 2011 at 1:31 PM, d wrote:
> so, any idea where is problem? is it because fff() function is not
> right?
>
Any @auth. decorators first check if the user is logged in.
So it is checking for logged in user before fire your fff function.
You can supress (only in trunk) with require
5 matches
Mail list logo