After login the user should be redirected to their intended page

Description

If I follow a link directly to a ticket for example, I'll get redirected to the login page, then once I log in I'll be sitting at the main trac page. I should be redirected to the ticket I originally tried to go to.

I have a similar issue but mine it's a little worse, since my trac installation is not the default root of my server after I log in the application redirects me to a page which has nothing to do with trac.

After the user logs in, the application will take the user to the_referer_url.

I think this can solve the problem, however there is a little issue when the user logs out because it'll be redirected to the log in page and referer will be the url to the trac section the user was when he/she clicked the log out link. If he decides to log in again using that browser window he will be redirected to that page. Some people can think that's not right.

May be, before doing the redirection it's necessary to ask if the user is loggin out, and in that case the referer is not req.abs_href(req.path_info) but the wiki page or the start page.

I had forgotten the spurious reopening of this ticket. As the poster who reopened it noted, [2462] fixed #1771 and not #1180. That would, of course, be because #1180 was fixed by [2375].

Please note that this has not been tested by me on 0.11 at all, nor will it likely be in the near future as I do not have a Trac running anywhere at the moment, nor will I in the foreseeable future. It did work on my installation at the time of the fix and it worked for jfernandez who was needing the fix at the time on his 0.11dev.

The change [2375] is done for 0.10 branch, so I expect it to be tested with 0.10 version of Trac. Also the ticket is assigned to 0.10 Trac release.

If this change worked for 0.11dev, I think it should be in 0.11 or 0.11dev branch.

[2375] does not work with Trac 0.10, because the function req.redirect() it calls, expect parameter permanent of type boolean. Passing dictionary to this parameter will just evaluate it to True so the redirection will be permanent. Thus, it will not redirect back to the referrer after the login screen.

I tested it on 0.10.4 version and it does not work. To make it work, please apply the patch: ticket:1180:1180.patch​

Add Comment

This ticket has been modified since you started editing. You should review the
other modifications which have been appended above,
and any conflicts shown in the preview below.
You can nevertheless proceed and submit your changes if you wish so.