Browse Source

stop execution when unauthenticated, to prevent the page to show when canceling auth popup

Ceeram 13 years ago
parent
commit
b28ea65b24
1 changed files with 3 additions and 3 deletions
  1. 3 3
      lib/Cake/Controller/Component/Auth/BasicAuthenticate.php

+ 3 - 3
lib/Cake/Controller/Component/Auth/BasicAuthenticate.php

@@ -117,9 +117,9 @@ class BasicAuthenticate extends BaseAuthenticate {
  * @return boolean True
  */
 	public function unauthenticated(CakeRequest $request, CakeResponse $response) {
-		$response->header($this->loginHeaders());
-		$response->statusCode(401);
-		$response->send();
+		$Exception = new UnauthorizedException();
+		$Exception->responseHeader($this->loginHeaders());
+		throw $Exception;
 		return true;
 	}