oauth basic

This commit is contained in:
xiaomlove
2024-03-08 03:35:41 +08:00
parent e653fdac6d
commit 08ef14a420
9 changed files with 86 additions and 6 deletions

View File

@@ -11,6 +11,7 @@ use Illuminate\Validation\UnauthorizedException;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Throwable;
use Laravel\Passport\Exceptions\AuthenticationException as PassportAuthenticationException;
class Handler extends ExceptionHandler
{
@@ -48,6 +49,9 @@ class Handler extends ExceptionHandler
return abort(403);
}
});
$this->renderable(function (PassportAuthenticationException $e) {
return response()->redirectTo(getSchemeAndHttpHost() . "/login.php");
});
//Other Only handle in json request
if (!request()->expectsJson()) {