Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperDJ committed Jul 21, 2023
1 parent 707712d commit 29961b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Middlewares/PermissionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function handle($request, Closure $next, $permission, $guard = null)
// For machine-to-machine Passport clients
$bearerToken = $request->bearerToken();
if ($bearerToken) {
if (! $authGuard instanceof TokenGuard) {
if (! $authGuard instanceof TokenGuard && !$guard) {
$authGuard = Auth::guard('api');
}

Expand Down
2 changes: 1 addition & 1 deletion src/Middlewares/RoleMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function handle($request, Closure $next, $role, $guard = null)
// For machine-to-machine Passport clients
$bearerToken = $request->bearerToken();
if ($bearerToken) {
if (! $authGuard instanceof TokenGuard) {
if (! $authGuard instanceof TokenGuard && !$guard) {
$authGuard = Auth::guard('api');
}

Expand Down
2 changes: 1 addition & 1 deletion src/Middlewares/RoleOrPermissionMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function handle($request, Closure $next, $roleOrPermission, $guard = null
// For machine-to-machine Passport clients
$bearerToken = $request->bearerToken();
if ($bearerToken) {
if (! $authGuard instanceof TokenGuard) {
if (! $authGuard instanceof TokenGuard && !$guard) {
$authGuard = Auth::guard('api');
}

Expand Down

0 comments on commit 29961b3

Please sign in to comment.