From 6c7e0e280713e2306c17bf076bac7a2527f90d55 Mon Sep 17 00:00:00 2001 From: lkassianik Date: Thu, 8 Jan 2015 15:56:22 -0800 Subject: [PATCH] T6870, Return to previous page after login via header Summary: Fixes T6870, logging in from a public object should land on that object. Test Plan: Navigate to a maniphest task in a logged out state, login, landing page should be maniphest task. Reviewers: epriestley, #blessed_reviewers Reviewed By: epriestley, #blessed_reviewers Subscribers: Korvin, epriestley Maniphest Tasks: T6870 Differential Revision: https://secure.phabricator.com/D11289 --- .../auth/application/PhabricatorAuthApplication.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/applications/auth/application/PhabricatorAuthApplication.php b/src/applications/auth/application/PhabricatorAuthApplication.php index b395d2b4eb..cdf0fe6211 100644 --- a/src/applications/auth/application/PhabricatorAuthApplication.php +++ b/src/applications/auth/application/PhabricatorAuthApplication.php @@ -60,12 +60,17 @@ final class PhabricatorAuthApplication extends PhabricatorApplication { // Don't show the "Login" item on auth controllers, since they're // generally all related to logging in anyway. } else { + $uri = new PhutilURI('/auth/start/'); + if ($controller) { + $path = $controller->getRequest()->getPath(); + $uri->setQueryParam('next', $path); + } $item = id(new PHUIListItemView()) ->addClass('core-menu-item') ->setName(pht('Log In')) // TODO: Login icon? ->setIcon('fa-sign-in') - ->setHref('/auth/start/') + ->setHref($uri) ->setAural(pht('Log In')) ->setOrder(900); $items[] = $item;