Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Jan 22, 2021
1 parent eab928d commit f5695ae
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 16 deletions.
13 changes: 0 additions & 13 deletions config/sanctum.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1'
)),

/*
|--------------------------------------------------------------------------
| Sanctum Guards
|--------------------------------------------------------------------------
|
| Here you may specify which authentication guards Sanctum will use while
| authenticating users. This values should correspond with the
| guards that are already present in your "auth" configuration file.
|
*/

'guards' => ['web'],

/*
|--------------------------------------------------------------------------
| Expiration Minutes
Expand Down
5 changes: 2 additions & 3 deletions src/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Illuminate\Contracts\Auth\Factory as AuthFactory;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;

class Guard
{
Expand Down Expand Up @@ -51,9 +52,7 @@ public function __construct(AuthFactory $auth, $expiration = null, $provider = n
*/
public function __invoke(Request $request)
{
$guards = config('sanctum.guards');

foreach ($guards as $guard) {
foreach (Arr::wrap(config('sanctum.guard', 'web')) as $guard) {
if ($user = $this->auth->guard($guard)->user()) {
return $this->supportsTokens($user)
? $user->withAccessToken(new TransientToken)
Expand Down

0 comments on commit f5695ae

Please sign in to comment.