# Instructions: Copy all of this into your db.py, and make the one change
in layout.html
# Solution: how to have a user redirected to a page AFTER register
# in this example, the URL('user/profile') will be used.
# app name: AuthRedirect <- just a NEW application, with no modication
# web2py Version 2.2.1 (2012-10-21 16:57:04) stable
# - - - - -
# in layout.html view, modify the line:
# <ul id="navbar" class="nav pull-right">{{='auth' in globals() and
auth.navbar(mode="dropdown") or ''}}</ul>
# to
# <ul id="navbar" class="nav pull-right">{{='auth' in globals() and
auth.navbar(mode="dropdown",referrer_actions=None) or ''}}</ul>
# this will cause the URL not to display
#
http://127.0.0.1:8000/AuthRedirect/default/user/login?_next=/AuthRedirect/default/index
# but rather
# http://127.0.0.1:8000/AuthRedirect/default/user/
# - - - - -
# one line of CODE BELOW placed in :
# /models/db.py - located BELOW the setting under > ## configure auth
policy lines
auth.settings.register_next = URL('user/profile')
Peter
On Sunday, 18 November 2012 22:51:14 UTC, Daniele wrote:
>
> Hey guys, I would like to set register_next to move on to a URL upon
> successful registration. However, it seems to be redirecting me to the
> login page right now. I believe this is because I have
>
> @auth.requires_login()
> def mypage:
>
> in the controller. How can I make it so that when a user registers, the
> page automatically is redirected to a page I specify?
>
> Thanks!
>
--