auth.register includes the following:
 
        if self.is_logged_in():
            redirect(self.settings.logged_url)
 
You've got a call to auth.register inside an 'if auth.is_logged_in()' 
condition, so once logged in, it will redirect to self.settings.logged_url, 
which defaults to /user/profile. If the 'statusbar' div is in your 
layout.html view, then auth.register will be called again when you get to 
/user/profile, which would enter an infinite loop.
 
In any case, why do you want the login_widget and register_widget inside 
your 'if auth.is_logged_in()' condition -- presumably if you are logged in 
you don't need to register or log in again, right?
 
Anthony

On Sunday, April 24, 2011 8:37:05 AM UTC-4, encompass wrote: 

> GREAT!  This got me in what I think is the right direction, but I seem to 
> be having some issues with auth.register()
> I made this in the view:
>                 <div id="statusbar">
>                     {{if auth.is_logged_in():}}
>                     <ul>
>                         <li><a href="{{=URL('default', 'user', 
> args='logout')}}">Logout</a></li>
>                         <li><a href="{{=URL('default', 'user', 
> args='profile')}}">Profile</a></li>
>                     </ul>
>                     <div id="login_widget">
>                         {{=auth.login()}}
>                     </div>
>                     <div id="register_widget">
>                         {{=auth.register()}}
>                     </div>
>                     {{else:}}
>                     <ul>
>                         <li><a href="{{=URL('default', 'user', 
> args='login')}}">Login</a></li>
>                         <li><a href="{{=URL('default', 'user', 
> args='register')}}">Register</a></li>
>                     </ul>
>                     {{pass}}
>                 </div>
> But it seems that when I do this I and then go to a page with the code my 
> browser throws me an error saying it's in a redirect loop...
> "The page isn't redirecting properly
> Firefox has detected that the server is redirecting the request for this 
> address in a way that will never complete."
> If I take out the =auth.register it will work...
> WEIRD!!!
> Any ideas into the problem?
> ---
> Best Regards,
> Jason Brower
>

Reply via email to