Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f4272dd

Browse filesBrowse files
Merge branch '5.1'
* 5.1: (33 commits) [Cache] $lifetime cannot be null [Serializer] minor cleanup fix merge Run PHP 8 as 7.4.99 Remove calls to deprecated ReflectionParameter::getClass(). [VarDumper] fix PHP 8 support Removed "services" prototype node from "custom_authenticator" Add php 8 to travis. [Cache] Accessing undefined constants raises an Error in php8 [Cache] allow DBAL v3 Skip Doctrine DBAL on php 8 until we have a compatible version. [DomCrawler] Catch expected ValueError. Made method signatures compatible with their corresponding traits. [ErrorHandler] Apply php8 fixes from Debug component. [DomCrawler] Catch expected ValueError. [Validator] Catch expected ValueError. [VarDumper] ReflectionFunction::isDisabled() is deprecated. [BrowserKit] Raw body with custom Content-Type header Revert symfony/symfony#34986 Make ExpressionLanguageSyntax validator usable with annotation ...
2 parents 9dd46e4 + 0f4504b commit f4272dd
Copy full SHA for f4272dd

File tree

2 files changed

+3
-6
lines changed
Filter options

2 files changed

+3
-6
lines changed

‎Authentication/Token/AbstractToken.php

Copy file name to clipboardExpand all lines: Authentication/Token/AbstractToken.php
+2-5Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -270,13 +270,10 @@ private function hasUserChanged(UserInterface $user): bool
270270
return true;
271271
}
272272

273+
$currentUserRoles = array_map('strval', (array) $this->user->getRoles());
273274
$userRoles = array_map('strval', (array) $user->getRoles());
274275

275-
if ($this instanceof SwitchUserToken) {
276-
$userRoles[] = 'ROLE_PREVIOUS_ADMIN';
277-
}
278-
279-
if (\count($userRoles) !== \count($this->getRoleNames()) || \count($userRoles) !== \count(array_intersect($userRoles, $this->getRoleNames()))) {
276+
if (\count($userRoles) !== \count($currentUserRoles) || \count($userRoles) !== \count(array_intersect($userRoles, $currentUserRoles))) {
280277
return true;
281278
}
282279

‎Tests/Authentication/Token/AbstractTokenTest.php

Copy file name to clipboardExpand all lines: Tests/Authentication/Token/AbstractTokenTest.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public function getUserChanges()
152152
*/
153153
public function testSetUserDoesNotSetAuthenticatedToFalseWhenUserDoesNotChange($user)
154154
{
155-
$token = new ConcreteToken();
155+
$token = new ConcreteToken(['ROLE_FOO']);
156156
$token->setAuthenticated(true);
157157
$this->assertTrue($token->isAuthenticated());
158158

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.