Hello Anthony,

Well i have done a custom login in the index page, so after the user logs 
in the login form is still shown.... so i am trying to redirect the user to 
a different page after the login

controller:
    
 # -*- coding: utf-8 -*-
### required - do no delete
def user(): return dict(form=auth())
def download(): return response.download(request,db)
def call(): return service()
### end requires
def index():
return dict(form=auth.login())


def home():
return dict()

def error():
return dict()


View:

{{extend 'layout.html'}}

<div id="login_form">



{{=form}}

</div>

This code gives me the login form in the index page, but after the login 
the login form is still shown



On Friday, March 2, 2012 10:48:24 PM UTC+5:30, Anthony wrote:
>
> I am using the following, but does not work:
>>      
>>
>>      auth.settings.login_next = URL('index')
>>
>> I have put the above line inside my db.py.... 
>>
>>
> The above only works if the user somehow goes directly to the login page. 
> However, if the user gets to the login page via a redirect that resulted 
> from trying to access a controller action protected by an @auth decorator, 
> then they will automatically be redirected back to the requested URL after 
> login (which is generally the behavior you want). Is that what you are 
> observing, or does login_next always fail to work, even when directly 
> accessing the login page?
>
> Anthony
>

On Friday, March 2, 2012 10:48:24 PM UTC+5:30, Anthony wrote:
>
> I am using the following, but does not work:
>>      
>>
>>      auth.settings.login_next = URL('index')
>>
>> I have put the above line inside my db.py.... 
>>
>>
> The above only works if the user somehow goes directly to the login page. 
> However, if the user gets to the login page via a redirect that resulted 
> from trying to access a controller action protected by an @auth decorator, 
> then they will automatically be redirected back to the requested URL after 
> login (which is generally the behavior you want). Is that what you are 
> observing, or does login_next always fail to work, even when directly 
> accessing the login page?
>
> Anthony
>

Reply via email to