Skip to content

Commit f907cd4

Browse files
committed
Merge branch '5.4' into 6.4
* 5.4: Update custom_authenticator.rst
2 parents 547066b + 1666a1c commit f907cd4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

security/custom_authenticator.rst

+3-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ method that fits most use-cases::
3737
*/
3838
public function supports(Request $request): ?bool
3939
{
40-
return $request->headers->has('X-AUTH-TOKEN');
40+
// "auth_token" is an example of a custom, non-standard HTTP header used in this application
41+
return $request->headers->has('auth-token');
4142
}
4243

4344
public function authenticate(Request $request): Passport
4445
{
45-
$apiToken = $request->headers->get('X-AUTH-TOKEN');
46+
$apiToken = $request->headers->get('auth-token');
4647
if (null === $apiToken) {
4748
// The token header was empty, authentication fails with HTTP Status
4849
// Code 401 "Unauthorized"

0 commit comments

Comments
 (0)