3 final class PhabricatorAuthValidateController
4 extends PhabricatorAuthController
{
6 public function shouldRequireLogin() {
10 public function shouldAllowPartialSessions() {
14 public function shouldAllowLegallyNonCompliantUsers() {
18 public function handleRequest(AphrontRequest
$request) {
19 $viewer = $this->getViewer();
23 if (!strlen($request->getStr('expect'))) {
24 return $this->renderErrors(
27 'Login validation is missing expected parameter ("%s").',
32 $expect_phusr = $request->getStr('expect');
33 $actual_phusr = $request->getCookie(PhabricatorCookies
::COOKIE_USERNAME
);
34 if ($actual_phusr != $expect_phusr) {
37 "Attempted to set '%s' cookie to '%s', but your browser sent back ".
38 "a cookie with the value '%s'. Clear your browser's cookies and ".
45 "Attempted to set '%s' cookie to '%s', but your browser did not ".
46 "accept the cookie. Check that cookies are enabled, clear them, ".
54 if (!$viewer->getPHID()) {
56 'Login cookie was set correctly, but your login session is not '.
57 'valid. Try clearing cookies and logging in again.');
62 return $this->renderErrors($failures);
65 $finish_uri = $this->getApplicationURI('finish/');
66 return id(new AphrontRedirectResponse())->setURI($finish_uri);
69 private function renderErrors(array $messages) {
70 return $this->renderErrorPage(