Make 'next' paramater name configurable when forwarding to login_url #565

rbu opened this Issue Jul 19, 2012 · 1 comment


None yet

2 participants

rbu commented Jul 19, 2012

Tornado makes the login_url configrable, but the query string name for the referer page is hardcoded to "next". This makes it harder to integrate tornado with a login form that is running on another site/framework, such as repoze.who-friendlyform which expects the parameter to be "came_from".

It would be nice if the parameter were configurable.


I started to make this change, but adding another narrow configuration option feels a little heavy for the amount of code involved. You can do this by overriding get_login_url in your base handler class:
def get_login_url(self):
return BASE_LOGIN_URL + "?" + urllib.urlencode({"came_from": self.request.uri})

When @authenticated sees that the login url already has a "?", it assumes that the redirect url is already baked in and won't add it again.

@bdarnell bdarnell closed this May 13, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment