Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,16 @@ public function handleRequest(AphrontRequest $request) {
return id(new AphrontRedirectResponse())->setURI('/');
}

$next_uri = PhabricatorCookies::getNextURICookie($request);
if (!phutil_nonempty_string($next_uri)) {
if ($this->getDelegatingController()) {
$next_uri = (string)$request->getRequestURI();
if (!$request->isFormPost()) {
PhabricatorCookies::setNextURICookie($request, $next_uri);
}
}
}

$engine = new PhabricatorAuthSessionEngine();

// If this cookie is set, the user is headed into a high security area
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ public function handleRequest(AphrontRequest $request) {
return new Aphront400Response();
}

$next_uri = PhabricatorCookies::getNextURICookie($request);
if (!phutil_nonempty_string($next_uri)) {
if ($this->getDelegatingController()) {
$next_uri = (string)$request->getRequestURI();
if (!$request->isFormPost()) {
PhabricatorCookies::setNextURICookie($request, $next_uri);
}
}
}

$panels = $this->loadPanels();

$multifactor_key = id(new PhabricatorMultiFactorSettingsPanel())
Expand Down Expand Up @@ -190,11 +200,17 @@ private function newGuidance() {
'You can make adjustments from the [[ /settings/ | Settings ]] panel '.
'later.');

$request = $this->getRequest();
$next = PhabricatorCookies::getNextURICookie($request);
if (!PhabricatorEnv::isValidLocalURIForLink($next)) {
$next = '/';
}

return $this->newDialog()
->setTitle(pht('Multi-Factor Authentication Setup Complete'))
->setWidth(AphrontDialogView::WIDTH_FULL)
->appendChild(new PHUIRemarkupView($viewer, $guidance))
->addCancelButton('/', pht('Continue'));
->addCancelButton($next, pht('Continue'));
}

$views = array();
Expand Down