Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

login redirect strips query params #47

Closed
atbinf opened this issue Dec 12, 2013 · 3 comments
Closed

login redirect strips query params #47

atbinf opened this issue Dec 12, 2013 · 3 comments

Comments

@atbinf
Copy link

atbinf commented Dec 12, 2013

When going to a url with query params and not authenticated, the came_from param has the query params stripped. Many times links may be provided to uses in emails to specific pages with query params, for example an id of the entity to display. Is there a reason the params are stripped?

I was able to patch this by mofifying line 116 of tg.configuration.auth.fastform.py from

path_info =environ['PATH_INFO']
to

path_info = '%s?%s' % (environ['PATH_INFO'],environ['QUERY_STRING'])

I am not sure if this is the best way to handle it but it is a hold over untill a fix can be added to the code base.

@amol-
Copy link
Member

amol- commented Dec 12, 2013

I'll take a look at it. In the mean time you can easily avoid the issue, without having to modify fastform code, by using positional arguments:

TG dispatches both /url?a=1&b=2 and /url/1/2 to the same controller, so you can easily avoid facing the issue by providing all the arguments as positional arguments.

@atbinf
Copy link
Author

atbinf commented Dec 12, 2013

Good point, I'll give positional arguments a try. Maybe this isn't a bug after all.

@amol-
Copy link
Member

amol- commented Jan 14, 2014

Commit c8d073d should resolve the issue by forwarding GET paremeters in came_from

@amol- amol- closed this as completed Jan 14, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant