Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit84249ad

Browse files
committed
[#6228] backport to the 2.3 branch
1 parent55ae7d3 commit84249ad

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

‎cookbook/security/entity_provider.rst

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -433,30 +433,19 @@ interface requires three methods: ``loadUserByUsername($username)``,
433433

434434
use Symfony\Component\Security\Core\User\UserInterface;
435435
use Symfony\Component\Security\Core\User\UserProviderInterface;
436-
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
437436
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
438437
use Doctrine\ORM\EntityRepository;
439438

440439
class UserRepository extends EntityRepository implements UserProviderInterface
441440
{
442441
public function loadUserByUsername($username)
443442
{
444-
$user = $this->createQueryBuilder('u')
443+
return $this->createQueryBuilder('u')
445444
->where('u.username = :username OR u.email = :email')
446445
->setParameter('username', $username)
447446
->setParameter('email', $username)
448447
->getQuery()
449448
->getOneOrNullResult();
450-
451-
if (null === $user) {
452-
$message = sprintf(
453-
'Unable to find an active admin AppBundle:User object identified by "%s".',
454-
$username
455-
);
456-
throw new UsernameNotFoundException($message);
457-
}
458-
459-
return $user;
460449
}
461450

462451
public function refreshUser(UserInterface $user)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp