You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This to remove confusion between the new system and Guard. When using the new
system, guard should not be installed. Guard did however influence the idea
behind the new system. Thus keeping the mentions of "guard" makes it confusing
to use the new system.
if (!$guardAuthenticatorinstanceof AuthenticatorInterface && !$guardAuthenticatorinstanceof GuardAuthenticatorInterface) {
76
-
thrownew \UnexpectedValueException('Invalid guard authenticator passed to '.__METHOD__.'. Expected AuthenticatorInterface of either Security Core or Security Guard.');
75
+
if (!$authenticatorinstanceof AuthenticatorInterface && !$authenticatorinstanceof GuardAuthenticatorInterface) {
76
+
thrownew \UnexpectedValueException('Invalid authenticator passed to '.__METHOD__.'. Expected AuthenticatorInterface of either Security Core or Security Guard.');
if ($responseinstanceof Response || null === $response) {
83
83
return$response;
84
84
}
85
85
86
-
thrownew \UnexpectedValueException(sprintf('The "%s::onAuthenticationSuccess()" method must return null or a Response object. You returned "%s".', \get_class($guardAuthenticator), get_debug_type($response)));
86
+
thrownew \UnexpectedValueException(sprintf('The "%s::onAuthenticationSuccess()" method must return null or a Response object. You returned "%s".', \get_class($authenticator), \is_object($response) ? \get_class($response) : \gettype($response)));
87
87
}
88
88
89
89
/**
@@ -95,7 +95,7 @@ public function handleAuthenticationSuccess(TokenInterface $token, Request $requ
if (!$authenticatorinstanceof AuthenticatorInterface && !$authenticatorinstanceof GuardAuthenticatorInterface) {
98
-
thrownew \UnexpectedValueException('Invalid guard authenticator passed to '.__METHOD__.'. Expected AuthenticatorInterface of either Security Core or Security Guard.');
98
+
thrownew \UnexpectedValueException('Invalid authenticator passed to '.__METHOD__.'. Expected AuthenticatorInterface of either Security Core or Security Guard.');
99
99
}
100
100
101
101
// create an authenticated token for the User
@@ -111,21 +111,21 @@ public function authenticateUserAndHandleSuccess(UserInterface $user, Request $r
111
111
* Handles an authentication failure and returns the Response for the
if (!$guardAuthenticatorinstanceof AuthenticatorInterface && !$guardAuthenticatorinstanceof GuardAuthenticatorInterface) {
119
-
thrownew \UnexpectedValueException('Invalid guard authenticator passed to '.__METHOD__.'. Expected AuthenticatorInterface of either Security Core or Security Guard.');
118
+
if (!$authenticatorinstanceof AuthenticatorInterface && !$authenticatorinstanceof GuardAuthenticatorInterface) {
119
+
thrownew \UnexpectedValueException('Invalid authenticator passed to '.__METHOD__.'. Expected AuthenticatorInterface of either Security Core or Security Guard.');
if ($responseinstanceof Response || null === $response) {
124
124
// returning null is ok, it means they want the request to continue
125
125
return$response;
126
126
}
127
127
128
-
thrownew \UnexpectedValueException(sprintf('The "%s::onAuthenticationFailure()" method must return null or a Response object. You returned "%s".', \get_class($guardAuthenticator), get_debug_type($response)));
128
+
thrownew \UnexpectedValueException(sprintf('The "%s::onAuthenticationFailure()" method must return null or a Response object. You returned "%s".', \get_class($authenticator), get_debug_type($response)));
$this->handleFailure(newProviderNotFoundException(sprintf('Token with provider key "%s" did not originate from any of the guard authenticators.', $token->getGuardProviderKey())), $token);
$this->handleFailure(newProviderNotFoundException(sprintf('Token with provider key "%s" did not originate from any of the authenticators.', $token->getAuthenticatorKey())), $token);
0 commit comments