1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-18 21:02:41 +01:00

Update RedirectController for handleRequest

Summary: Ref T8628.

Test Plan: Performed an action that uses the redirect controller (trying to visit a repo page while not logged in). Logged in and was redirected as expected

Reviewers: #blessed_reviewers, epriestley

Reviewed By: #blessed_reviewers, epriestley

Subscribers: epriestley, yelirekim

Maniphest Tasks: T8628

Differential Revision: https://secure.phabricator.com/D16571
This commit is contained in:
Josh Cox 2016-09-15 20:45:36 -04:00
parent 2e4b5b45a2
commit 799ecdc278

View file

@ -2,9 +2,6 @@
final class PhabricatorRedirectController extends PhabricatorController { final class PhabricatorRedirectController extends PhabricatorController {
private $uri;
private $allowExternal;
public function shouldRequireLogin() { public function shouldRequireLogin() {
return false; return false;
} }
@ -13,15 +10,12 @@ final class PhabricatorRedirectController extends PhabricatorController {
return false; return false;
} }
public function willProcessRequest(array $data) { public function handleRequest(AphrontRequest $request) {
$this->uri = $data['uri']; $uri = $request->getURIData('uri');
$this->allowExternal = idx($data, 'external', false); $external = $request->getURIData('external', false);
}
public function processRequest() {
return id(new AphrontRedirectResponse()) return id(new AphrontRedirectResponse())
->setURI($this->uri) ->setURI($uri)
->setIsExternal($this->allowExternal); ->setIsExternal($external);
} }
} }