Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthStartController.php
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | if (strlen($session_token)) { | ||||
if ($did_clear) { | if ($did_clear) { | ||||
return $this->renderError( | return $this->renderError( | ||||
pht( | pht( | ||||
'Your login session is invalid, and clearing the session '. | 'Your login session is invalid, and clearing the session '. | ||||
'cookie was unsuccessful. Try clearing your browser cookies.')); | 'cookie was unsuccessful. Try clearing your browser cookies.')); | ||||
} | } | ||||
$redirect_uri = $request->getRequestURI(); | $redirect_uri = $request->getRequestURI(); | ||||
$redirect_uri->setQueryParam('cleared', 1); | $redirect_uri->replaceQueryParam('cleared', 1); | ||||
return id(new AphrontRedirectResponse())->setURI($redirect_uri); | return id(new AphrontRedirectResponse())->setURI($redirect_uri); | ||||
} | } | ||||
} | } | ||||
// If we just cleared the session cookie and it worked, clean up after | // If we just cleared the session cookie and it worked, clean up after | ||||
// ourselves by redirecting to get rid of the "cleared" parameter. The | // ourselves by redirecting to get rid of the "cleared" parameter. The | ||||
// the workflow will continue normally. | // the workflow will continue normally. | ||||
if ($did_clear) { | if ($did_clear) { | ||||
$redirect_uri = $request->getRequestURI(); | $redirect_uri = $request->getRequestURI(); | ||||
$redirect_uri->setQueryParam('cleared', null); | $redirect_uri->removeQueryParam('cleared'); | ||||
return id(new AphrontRedirectResponse())->setURI($redirect_uri); | return id(new AphrontRedirectResponse())->setURI($redirect_uri); | ||||
} | } | ||||
$providers = PhabricatorAuthProvider::getAllEnabledProviders(); | $providers = PhabricatorAuthProvider::getAllEnabledProviders(); | ||||
foreach ($providers as $key => $provider) { | foreach ($providers as $key => $provider) { | ||||
if (!$provider->shouldAllowLogin()) { | if (!$provider->shouldAllowLogin()) { | ||||
unset($providers[$key]); | unset($providers[$key]); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 286 Lines • Show Last 20 Lines |