jwt-auth
jwt-auth copied to clipboard
Jwt-auth dos not recognized token via bearer header but can via GET
trafficstars
Subject of the issue
Describe your issue here.
Your environment
| Q | A |
|---|---|
| Bug? | yes |
| New Feature? | no |
| Framework | Laravel |
| Framework version | 9.x.y |
| Package version | current |
| PHP version | 8 |
Steps to reproduce
Tell us how to reproduce this issue.
Expected behaviour
Recognized token via bearer header as well as GET
Actual behavior
When am using PostMan, I can not authenticate my request via bearer. only via GET,
http://example.dev/me?token=eyJhbGciOiJIUzI1NiI...
it seems Laravel can not see any header here
\vendor\laravel\framework\src\Illuminate\Http\Concerns\InteractsWithInput.php
public function bearerToken()
{
$header = $this->header('Authorization', '');
$position = strrpos($header, 'Bearer ');
if ($position !== false) {
$header = substr($header, $position + 7);
return str_contains($header, ',') ? strstr($header, ',', true) : $header;
}
}
same as this https://github.com/tymondesigns/jwt-auth/issues/1026 but i don't understand how to fix the project to BE AUTOMATED