-
-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #92 from mRoca/bugfix/event-dispacher-propagation
Fix authentication event propagation
- Loading branch information
Showing
4 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,16 +2,17 @@ | |
|
||
namespace Lexik\Bundle\JWTAuthenticationBundle\Event; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Security\Core\Exception\AuthenticationException; | ||
|
||
/** | ||
* AuthenticationFailureEvent | ||
* | ||
* @author Emmanuel Vella <[email protected]> | ||
*/ | ||
class AuthenticationFailureEvent extends GetResponseEvent | ||
class AuthenticationFailureEvent extends Event | ||
{ | ||
/** | ||
* @var Request | ||
|
@@ -24,12 +25,20 @@ class AuthenticationFailureEvent extends GetResponseEvent | |
protected $exception; | ||
|
||
/** | ||
* @param Request $request | ||
* @var Response | ||
*/ | ||
public function __construct(Request $request, AuthenticationException $exception) | ||
protected $response; | ||
|
||
/** | ||
* @param Request $request | ||
* @param AuthenticationException $exception | ||
* @param Response $response | ||
*/ | ||
public function __construct(Request $request, AuthenticationException $exception, Response $response) | ||
{ | ||
$this->request = $request; | ||
$this->exception = $exception; | ||
$this->response = $response; | ||
} | ||
|
||
/** | ||
|
@@ -47,4 +56,12 @@ public function getException() | |
{ | ||
return $this->exception; | ||
} | ||
|
||
/** | ||
* @return Response | ||
*/ | ||
public function getResponse() | ||
{ | ||
return $this->response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,17 @@ | |
|
||
namespace Lexik\Bundle\JWTAuthenticationBundle\Event; | ||
|
||
use Symfony\Component\EventDispatcher\Event; | ||
use Symfony\Component\HttpFoundation\Request; | ||
use Symfony\Component\HttpKernel\Event\GetResponseEvent; | ||
use Symfony\Component\HttpFoundation\Response; | ||
use Symfony\Component\Security\Core\User\UserInterface; | ||
|
||
/** | ||
* AuthenticationSuccessEvent | ||
* | ||
* @author Dev Lexik <[email protected]> | ||
*/ | ||
class AuthenticationSuccessEvent extends GetResponseEvent | ||
class AuthenticationSuccessEvent extends Event | ||
{ | ||
/** | ||
* @var array | ||
|
@@ -29,16 +30,23 @@ class AuthenticationSuccessEvent extends GetResponseEvent | |
*/ | ||
protected $request; | ||
|
||
/** | ||
* @var Response | ||
*/ | ||
protected $response; | ||
|
||
/** | ||
* @param array $data | ||
* @param UserInterface $user | ||
* @param Request $request | ||
* @param Response $response | ||
*/ | ||
public function __construct(array $data, UserInterface $user, Request $request) | ||
public function __construct(array $data, UserInterface $user, Request $request, Response $response) | ||
{ | ||
$this->data = $data; | ||
$this->user = $user; | ||
$this->data = $data; | ||
$this->user = $user; | ||
$this->request = $request; | ||
$this->response = $response; | ||
} | ||
|
||
/** | ||
|
@@ -74,4 +82,12 @@ public function getRequest() | |
{ | ||
return $this->request; | ||
} | ||
|
||
/** | ||
* @return Response | ||
*/ | ||
public function getResponse() | ||
{ | ||
return $this->response; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters