[patch] Always redirect to referer after login
|Reported by:||Owned by:||Steffen Hoffmann|
Currently, trac honours referer only when user was presented with login form and enters her username/password; if the user was sent to login page while already being logged in, she is not redirected back, but rather redirected to front page.
This makes it difficult to create user-friendly links to private trac pages (e.g. new ticket or ticket view), that would ask user login beforehands.
This is fixed easily:
diff -u -r accountmanagerplugin-orig/0.11/acct_mgr/web_ui.py accountmanagerplugin/0.11/acct_mgr/web_ui.py
old new 473 473 # overrides 474 474 def _do_login(self, req): 475 475 if not req.remote_user: 476 req.redirect(self.env.abs_href()) 476 ) 477 477 res = auth.LoginModule._do_login(self, req) 478 478 if req.args.get('rememberme', '0') == '1': 479 479 # Set the session to expire in 30 days (and not when to browser is
Change History (11)
comment:1 Changed 6 years ago by
|Keywords:||login redirect added|
|Summary:||Always redirect to referer after login → [patch] Always redirect to referer after login|
comment:6 Changed 6 years ago by
|Owner:||changed from John Hampton to Steffen Hoffmann|
|Status:||new → assigned|