Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a3406da

Browse files
committed
Improved error message when no supported user provider is found
1 parent ef8b34c commit a3406da

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Component/Security/Core/User/ChainUserProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function refreshUser(UserInterface $user)
9191
$e->setUsername($user->getUsername());
9292
throw $e;
9393
} else {
94-
throw new UnsupportedUserException(sprintf('The account "%s" is not supported.', \get_class($user)));
94+
throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', \get_class($user)));
9595
}
9696
}
9797

src/Symfony/Component/Security/Http/Firewall/ContextListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ protected function refreshUser(TokenInterface $token)
292292
return null;
293293
}
294294

295-
throw new \RuntimeException(sprintf('There is no user provider for user "%s".', $userClass));
295+
throw new \RuntimeException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $userClass));
296296
}
297297

298298
private function safelyUnserialize(string $serializedToken)

src/Symfony/Component/Security/Http/RememberMe/AbstractRememberMeServices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ final protected function getUserProvider(string $class): UserProviderInterface
234234
}
235235
}
236236

237-
throw new UnsupportedUserException(sprintf('There is no user provider that supports class "%s".', $class));
237+
throw new UnsupportedUserException(sprintf('There is no user provider for user "%s". Shouldn\'t the "supportsClass()" method of your user provider return true for this classname?', $class));
238238
}
239239

240240
/**

0 commit comments

Comments
 (0)