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
{{ message }}
This repository was archived by the owner on May 31, 2024. It is now read-only.
@@ -25,7 +23,7 @@ class AnonymousToken extends AbstractToken
25
23
/**
26
24
* @param string $secret A secret used to make sure the token is created by the app and not by a malicious client
27
25
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
* PreAuthenticatedToken implements a pre-authenticated token.
18
16
*
@@ -24,10 +22,10 @@ class PreAuthenticatedToken extends AbstractToken
24
22
private$providerKey;
25
23
26
24
/**
27
-
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
28
-
* @param mixed $credentials The user credentials
29
-
* @param string $providerKey The provider key
30
-
* @param (Role|string)[] $roles An array of roles
25
+
* @param string|object $user The user can be a UserInterface instance, or an object implementing a __toString method or the username as a regular string
if (null !== $token && !method_exists($token, 'getRoleNames')) {
43
+
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
* Token representing a user who temporarily impersonates another one.
16
+
*
17
+
* @author Christian Flothmann <christian.flothmann@sensiolabs.de>
18
+
*/
19
+
class SwitchUserToken extends UsernamePasswordToken
20
+
{
21
+
private$originalToken;
22
+
23
+
/**
24
+
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
25
+
* @param mixed $credentials This usually is the password of the user
26
+
* @param string $providerKey The provider key
27
+
* @param string[] $roles An array of roles
28
+
* @param TokenInterface $originalToken The token of the user who switched to the current user
* UsernamePasswordToken implements a username and password token.
18
16
*
@@ -24,10 +22,10 @@ class UsernamePasswordToken extends AbstractToken
24
22
private$providerKey;
25
23
26
24
/**
27
-
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
28
-
* @param mixed $credentials This usually is the password of the user
29
-
* @param string $providerKey The provider key
30
-
* @param (Role|string)[] $roles An array of roles
25
+
* @param string|object $user The username (like a nickname, email address, etc.), or a UserInterface instance or an object implementing a __toString method
26
+
* @param mixed $credentials This usually is the password of the user
if ($this->roleHierarchyinstanceof RoleHierarchy) {
96
+
if (method_exists($token, 'getRoleNames')) {
97
+
$rolesFromToken = $token->getRoleNames();
98
+
} else {
99
+
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
@trigger_error(sprintf('Not implementing the getRoleNames() method in %s which implements %s is deprecated since Symfony 4.3.', \get_class($token), TokenInterface::class), E_USER_DEPRECATED);
0 commit comments