Opened 13 years ago
Closed 13 years ago
#8868 closed defect (fixed)
After login trac always redirects to default page loosing initial target
Reported by: | anonymous | Owned by: | anatoly techtonik |
---|---|---|---|
Priority: | normal | Component: | NoAnonymousPlugin |
Severity: | critical | Keywords: | redirect |
Cc: | s.major@… | Trac Release: | 0.12 |
Description
If user access a specified target, e.g. a wiki page or certain ticket and has to log-in in between, the target gets lost and user is redirected to the default page. It is similar to a problem described here for PermRedirectPlugin. Actually the solution proposed there (attachment:ticket:2210:PermRedirect-urlfix.2.diff) by simply replacing
req.redirect(req.href.login())
with
ref_url = req.base_url + req.path_info if(req.query_string): ref_url = ref_url + "?" + req.query_string login_url = req.href.login(referer=ref_url) req.redirect(login_url)
also works for the NoAnonymousPlugin
Attachments (0)
Change History (5)
comment:1 Changed 13 years ago by
Cc: | s.major@… added; anonymous removed |
---|
comment:2 follow-up: 3 Changed 13 years ago by
comment:3 Changed 13 years ago by
Replying to techtonik: But it seems to happen only if you use the browser history. Usually I always land at the last visited place after relogin (provided the tab reminded open). Still you could check for referer ending with "logout" and replace with the base url.
comment:4 Changed 13 years ago by
Thanks for the patch. I've committed the change in r10369. Please, test that it works correctly.
comment:5 Changed 13 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
I've tested it myself and it works on 0.11.
You might get an infinite loop if redirected to logout action.