Skip to content

Commit 24ed0c0

Browse files
committed
minor #20107 [Security] fix: propose a better header naming for custom authenticator (94noni)
This PR was merged into the 5.4 branch. Discussion ---------- [Security] fix: propose a better header naming for custom authenticator Ref https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers Commits ------- 27a4f50 Update custom_authenticator.rst
2 parents 2ffd016 + 27a4f50 commit 24ed0c0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/custom_authenticator.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@ method that fits most use-cases::
3737
*/
3838
public function supports(Request $request): ?bool
3939
{
40-
return $request->headers->has('X-AUTH-TOKEN');
40+
return $request->headers->has('auth-token');
4141
}
4242

4343
public function authenticate(Request $request): Passport
4444
{
45-
$apiToken = $request->headers->get('X-AUTH-TOKEN');
45+
$apiToken = $request->headers->get('auth-token');
4646
if (null === $apiToken) {
4747
// The token header was empty, authentication fails with HTTP Status
4848
// Code 401 "Unauthorized"

0 commit comments

Comments
 (0)