Opened 14 years ago
Closed 14 years ago
#13932 closed (invalid)
URL with Hash and login_required
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | contrib.auth | Version: | 1.2 |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Unreviewed | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
If i try to open any login required site(decorator @login_required()) with hash on URL (like http://example.com/#profiles/user/edit), it will redirected to http://example.com/login/?next=/#profiles/user/edit
But after login, it redirected to http://example.com/ and not to http://example.com/#profiles/user/edit
Change History (3)
follow-up: 2 comment:1 by , 14 years ago
comment:2 by , 14 years ago
Sorry, my previous comment was wrong, because I can't reproduce the bug.
My actions:
- Request the URL http://127.0.0.1:8000/#blabla/blabla/blabla, which is @login_required protected
- Got the redirect to http://127.0.0.1:8000/login/?next=/#blabla/blabla/blabla
- Signed in
- Got the redirect to http://127.0.0.1:8000/#blabla/blabla/blabla back
So please provide more details or test case.
comment:3 by , 14 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Redirects at the HTTP level can't preserve anchors and that's how the login pass works. The server never sees the anchor and without Ajax-y tricks, there's nothing we can do. Closing for now, based on what's known here.
Sure, your link http://example.com/login/?next=/#profiles/user/edit is actually the link http://example.com/login/?next=/ with html id #profiles/user/edit.
So Django understand it as http://example.com/login/?next=/, it's normal and can't be fixed.