Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
rbu opened this Issue · 1 comment

2 participants

@rbu

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.

@bdarnell
Owner

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.