Skip to content

fix: 修复无参数值请求时,getBasicAuthorization方法$header默认值类型错误引发的异常 #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Guards/TokenGuard.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public function user(): ?AuthenticatableInterface
/**
* Get the token for the current request.
*/
public function getTokenForRequest(): string
public function getTokenForRequest(): string|null
{
$token = $this->request->query($this->inputKey);

Expand Down Expand Up @@ -162,7 +162,7 @@ protected function getBearerToken(): ?string
*/
protected function getBasicAuthorization(): array
{
$header = $this->request->header('Authorization');
$header = $this->request->header('Authorization', '');

if (Str::startsWith($header, 'Basic ')) {
try {
Expand Down