/** * Returns a basic authentication response if login is required and NULL if not. * * @access public * @return \mako\http\Response|null */ public function basicAuth() { if ($this->isLoggedIn() || $this->login($this->request->username(), $this->request->password()) === true) { return; } return $this->basicHTTPAuthenticationResponse(); }
/** * */ public function testPassword() { $server = $this->getServerData(); $request = new Request(['server' => $server]); $this->assertNull($request->password()); // $server['PHP_AUTH_PW'] = 'foobar'; $request = new Request(['server' => $server]); $this->assertEquals('foobar', $request->password()); }