Any suggestion?

Cheers,


El jueves, 22 de agosto de 2019, 23:27:34 (UTC-5), Patito Feo escribió:
>
> Hi and thanks for your answer,
>
> I did what the manual points to do. But the redirection still points to 
> user/login.html. In fact here is part of my config:
>
> auth.settings.login_url = URL( 'ingreso' )
> auth.settings.logged_url = URL( 'preferencias')
>
> auth.settings.on_failed_authentication = lambda url: redirect( URL( 
> 'ingreso' ) )
>
>
> I have defined a auth custom table, is there anything Im missing?
>
>
> Regards,
>
> El jueves, 22 de agosto de 2019, 19:01:04 (UTC-5), Dave S escribió:
>>
>> On Thursday, August 22, 2019 at 4:32:02 PM UTC-7, Patito Feo wrote:
>>>
>>> Hi,
>>>
>>> This does not worked.
>>> Redirecting still goes to user/login.html.
>>>
>>> Any ideas?
>>>
>>> Cheers,
>>>
>>
>>
>> For a little more context, here's a larger quote form the book:
>>
>> If the visitor is not logger in, and calls a function that requires 
>>> authentication, the user is redirected to auth.settings.login_url which 
>>> defaults to URL('default', 'user/login'). One can replace this behavior by 
>>> redefining:
>>>
>>> auth.settings.on_failed_authentication = lambda url: redirect(url)
>>> This is the function called for the redirection. The argument url` 
>>> passed to this function is the url for the login page.
>>>
>>> If the visitor does not have permission to access a given function, the 
>>> visitor is redirect to the URL defined by
>>>
>>> auth.settings.on_failed_authorization =     URL('user', 
>>> args='on_failed_authorization')
>>> You can change this variable and redirect the user elsewhere.
>>>
>>> Often on_failed_authorization is a URL but it can be a function that 
>>> returns the URL and it will be called on failed authorization.
>>>
>>
>>
>> from <URL:
>> http://web2py.com/books/default/chapter/29/09/access-control#Auth-Settings-and-messages
>> >
>>
>> Good luck!
>>
>> /dps
>>  
>>
>>>
>>> El jueves, 22 de agosto de 2019, 0:44:39 (UTC-5), Annet escribió:
>>>>
>>>> What about:
>>>>
>>>> auth.settings.on_failed_authentication = lambda url: redirect(url)
>>>>
>>>>
>>>> That is what the book says changing the default behaviour.
>>>>
>>>>
>>>> Kind regards,
>>>>
>>>> Annet
>>>>
>>>>
>>>>
>>>>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/0dbd96f1-0145-4c43-8de1-bd71d0eedb85%40googlegroups.com.

Reply via email to