We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 547066b + 1666a1c commit f907cd4Copy full SHA for f907cd4
security/custom_authenticator.rst
@@ -37,12 +37,13 @@ method that fits most use-cases::
37
*/
38
public function supports(Request $request): ?bool
39
{
40
- return $request->headers->has('X-AUTH-TOKEN');
+ // "auth_token" is an example of a custom, non-standard HTTP header used in this application
41
+ return $request->headers->has('auth-token');
42
}
43
44
public function authenticate(Request $request): Passport
45
- $apiToken = $request->headers->get('X-AUTH-TOKEN');
46
+ $apiToken = $request->headers->get('auth-token');
47
if (null === $apiToken) {
48
// The token header was empty, authentication fails with HTTP Status
49
// Code 401 "Unauthorized"
0 commit comments