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

Commit2eaa41a

Browse files
authored
Update access_token.rst
1 parentf6a583c commit2eaa41a

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

‎security/access_token.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,18 @@ using a fictive Doctrine repository.
6363
{
6464
}
6565
66-
public function getUserIdentifierFrom(string $token): string
66+
public function getUserIdentifierFrom(string $accessToken): string
6767
{
6868
// The handler tries to find the access token.
69-
$accessToken = $this->repository->findOneByValue($token);
69+
$token = $this->repository->findOneByValue($accessToken);
7070
7171
// If no access token is found or if it expired, the handler throws and exception.
72-
if ($accessToken === null || !$accessToken->isValid()) {
72+
if ($token === null || !$token->isValid()) {
7373
throw new BadCredentialsException('Invalid credentials.');
7474
}
7575
7676
// The access token is valid, the handler returned the associated user ID.
77-
return $accessToken->getUserId();
77+
return $token->getUserId();
7878
}
7979
}
8080
@@ -140,7 +140,7 @@ Customizing the Authenticators
140140

141141
You can define a specific extractor by creating a service that implements the interface
142142
:class:``Symfony\Component\Security\Http\Authenticator\AccessToken\AccessTokenExtractorInterface``::.
143-
This interface has a unique method ``extractToken(Request $request): ?string`` and shall return the access token
143+
This interface has a unique method ``extractAccessToken(Request $request): ?string`` and shall return the access token
144144
if any or ``null`` otherwise.
145145

146146
..configuration-block::
@@ -154,9 +154,9 @@ if any or ``null`` otherwise.
154154
155155
class CustomExtractor implements AccessTokenExtractorInterface
156156
{
157-
public functionextractToken(Request $request): ?string
157+
public functionextractAccessToken(Request $request): ?string
158158
{
159-
... // Extract the token from the request object or return null
159+
... // Extract theaccesstoken from the request object or return null
160160
}
161161
}
162162

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp