Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/controller/PhabricatorAuthStartController.php
Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | if (!$providers) { | ||||
'This server is not configured with any enabled authentication '. | 'This server is not configured with any enabled authentication '. | ||||
'providers which can be used to log in. If you have accidentally '. | 'providers which can be used to log in. If you have accidentally '. | ||||
'locked yourself out by disabling all providers, you can use `%s` '. | 'locked yourself out by disabling all providers, you can use `%s` '. | ||||
'to recover access to an account.', | 'to recover access to an account.', | ||||
'./bin/auth recover <username>')); | './bin/auth recover <username>')); | ||||
} | } | ||||
$next_uri = $request->getStr('next'); | $next_uri = $request->getStr('next'); | ||||
if (!strlen($next_uri)) { | if (!phutil_nonempty_string($next_uri)) { | ||||
if ($this->getDelegatingController()) { | if ($this->getDelegatingController()) { | ||||
// Only set a next URI from the request path if this controller was | // Only set a next URI from the request path if this controller was | ||||
// delegated to, which happens when a user tries to view a page which | // delegated to, which happens when a user tries to view a page which | ||||
// requires them to login. | // requires them to login. | ||||
// If this controller handled the request directly, we're on the main | // If this controller handled the request directly, we're on the main | ||||
// login page, and never want to redirect the user back here after they | // login page, and never want to redirect the user back here after they | ||||
// login. | // login. | ||||
$next_uri = (string)$this->getRequest()->getRequestURI(); | $next_uri = (string)$this->getRequest()->getRequestURI(); | ||||
} | } | ||||
} | } | ||||
if (!$request->isFormPost()) { | if (!$request->isFormPost()) { | ||||
if (strlen($next_uri)) { | if (phutil_nonempty_string($next_uri)) { | ||||
PhabricatorCookies::setNextURICookie($request, $next_uri); | PhabricatorCookies::setNextURICookie($request, $next_uri); | ||||
} | } | ||||
PhabricatorCookies::setClientIDCookie($request); | PhabricatorCookies::setClientIDCookie($request); | ||||
} | } | ||||
$auto_response = $this->tryAutoLogin($providers); | $auto_response = $this->tryAutoLogin($providers); | ||||
if ($auto_response) { | if ($auto_response) { | ||||
return $auto_response; | return $auto_response; | ||||
▲ Show 20 Lines • Show All 217 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0