Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthStartController.php
| Show All 40 Lines | if (strlen($session_token)) { | ||||
| break; | break; | ||||
| default: | default: | ||||
| // The session cookie is invalid, so clear it. | // The session cookie is invalid, so clear it. | ||||
| $request->clearCookie(PhabricatorCookies::COOKIE_USERNAME); | $request->clearCookie(PhabricatorCookies::COOKIE_USERNAME); | ||||
| $request->clearCookie(PhabricatorCookies::COOKIE_SESSION); | $request->clearCookie(PhabricatorCookies::COOKIE_SESSION); | ||||
| return $this->renderError( | return $this->renderError( | ||||
| pht( | pht( | ||||
| "Your login session is invalid. Try reloading the page and ". | 'Your login session is invalid. Try reloading the page and '. | ||||
| "logging in again. If that does not work, clear your browser ". | 'logging in again. If that does not work, clear your browser '. | ||||
| "cookies.")); | 'cookies.')); | ||||
| } | } | ||||
| } | } | ||||
| $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]); | ||||
| } | } | ||||
| } | } | ||||
| if (!$providers) { | if (!$providers) { | ||||
| if ($this->isFirstTimeSetup()) { | if ($this->isFirstTimeSetup()) { | ||||
| // If this is a fresh install, let the user register their admin | // If this is a fresh install, let the user register their admin | ||||
| // account. | // account. | ||||
| return id(new AphrontRedirectResponse()) | return id(new AphrontRedirectResponse()) | ||||
| ->setURI($this->getApplicationURI('/register/')); | ->setURI($this->getApplicationURI('/register/')); | ||||
| } | } | ||||
| return $this->renderError( | return $this->renderError( | ||||
| pht( | pht( | ||||
| "This Phabricator install is not configured with any enabled ". | 'This Phabricator install is not configured with any enabled '. | ||||
| "authentication providers which can be used to log in. If you ". | 'authentication providers which can be used to log in. If you '. | ||||
| "have accidentally locked yourself out by disabling all providers, ". | 'have accidentally locked yourself out by disabling all providers, '. | ||||
| "you can use `phabricator/bin/auth recover <username>` to ". | 'you can use `phabricator/bin/auth recover <username>` to '. | ||||
| "recover access to an administrative account.")); | 'recover access to an administrative account.')); | ||||
| } | } | ||||
| $next_uri = $request->getStr('next'); | $next_uri = $request->getStr('next'); | ||||
| if (!$next_uri) { | if (!$next_uri) { | ||||
| $next_uri_path = $this->getRequest()->getPath(); | $next_uri_path = $this->getRequest()->getPath(); | ||||
| if ($next_uri_path == '/auth/start/') { | if ($next_uri_path == '/auth/start/') { | ||||
| $next_uri = '/'; | $next_uri = '/'; | ||||
| } else { | } else { | ||||
| ▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines | |||||