Skip to content

Commit

Permalink
Add response message when not authenticated
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and chalasr committed Aug 12, 2024
1 parent 58d4b11 commit d554d8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Security/Authenticator/OAuth2Authenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function supports(Request $request): ?bool

public function start(Request $request, ?AuthenticationException $authException = null): Response
{
return new Response('', 401, ['WWW-Authenticate' => 'Bearer']);
return new Response($authException?->getMessage() ?? 'Authentication required', 401, ['WWW-Authenticate' => 'Bearer']);
}

/**
Expand Down

0 comments on commit d554d8d

Please sign in to comment.