On Friday, January 11, 2019 at 11:44:27 AM UTC-5, Vlad wrote:
>
> I am probably missing something simple:
>
> when I explicitly go to http://127.0.0.1:8000/app/default/user/register - 
> I get auto-logged in after the registration. Same if I choose "register" on 
> the menu.
>
> However, when the following gets executed: 
>
>     auth.settings.login_after_registration = True
>     auth.settings.long_expiration = 3600*24*30
>     auth.settings.remember_me_form = True
>     redirect(URL('app', 'default/user', 'register'))
>
> after such a registration I am not logged in, and have to login manually.
>

Keep in mind that your model and controller code runs on each request. 
Above, you set several Auth settings but then immediately redirect, which 
initiates a new request -- so those settings never get a chance to take 
effect. You must make those settings within the same request that is 
handling the registration.

Anthony

-- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to