Skip to content

Commit

Permalink
Revert sanctum fix
Browse files Browse the repository at this point in the history
I'll use another branch to work on this.
  • Loading branch information
stevebauman committed Apr 18, 2021
1 parent 927c61c commit 825648f
Showing 1 changed file with 1 addition and 25 deletions.
26 changes: 1 addition & 25 deletions src/Auth/CreatesUserProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace LdapRecord\Laravel\Auth;

use Illuminate\Support\Arr;
use Illuminate\Support\Facades\Auth;

trait CreatesUserProvider
Expand All @@ -14,30 +13,7 @@ trait CreatesUserProvider
*/
protected function getCurrentAuthGuard()
{
$guard = $this->resolveAuthenticatedGuard(
array_keys(config('auth.guards', []))
);

switch ($guard) {
case 'sanctum':
return $this->resolveAuthenticatedGuard(
Arr::wrap(config('sanctum.guard', 'web'))
);
default:
return $guard;
}
}

/**
* Resolve the authenticated guard from the given array of guards.
*
* @param array $guards
*
* @return string|null
*/
protected function resolveAuthenticatedGuard($guards = [])
{
foreach ($guards as $guard) {
foreach (config('auth.guards') as $guard => $config) {
if (Auth::guard($guard)->check()) {
return $guard;
}
Expand Down

0 comments on commit 825648f

Please sign in to comment.