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

Commit6d34aa6

Browse files
committed
bugsymfony#3478 Update custom_password_authenticator.rst (piotras-s)
This PR was merged into the 2.4 branch.Discussion----------Update custom_password_authenticator.rstCorrect me if I am wrong... but because we are passing here ```username``` as first argument to ```UsernamePasswordToken```, when one would like to use method ```getUser()``` from base ```Controller```:```...if (!$this->container->has('security.context')) { throw new \LogicException('The SecurityBundle is not registered in your application.'); } if (null === $token = $this->container->get('security.context')->getToken()) { return null; } if (!is_object($user = $token->getUser())) { return null; } return $user;...```it will fail to get actually logged in user and return null.Commits-------18657aa Update custom_password_authenticator.rst
2 parentsa171700 +18657aa commit6d34aa6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎cookbook/security/custom_password_authenticator.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ the user::
6666
}
6767

6868
return new UsernamePasswordToken(
69-
$user->getUsername(),
69+
$user,
7070
$user->getPassword(),
7171
$providerKey,
7272
$user->getRoles()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp