Skip to content

Commit

Permalink
Rename static property
Browse files Browse the repository at this point in the history
  • Loading branch information
stevebauman committed May 17, 2021
1 parent e963b70 commit 672d3d1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions src/Middleware/WindowsAuthenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,18 @@ class WindowsAuthenticate
public static $userDomainValidator = UserDomainValidator::class;

/**
* The auth factory instance.
* The fallback callback to resolve users with.
*
* @var Auth
* @var Closure|string|null
*/
protected $auth;
public static $userResolverFallback;

/**
* The fallback callback to resolve users with.
* The auth factory instance.
*
* @var Closure|string|null
* @var Auth
*/
protected static $fallback;
protected $auth;

/**
* Constructor.
Expand Down Expand Up @@ -195,7 +195,7 @@ public static function validateDomainUsing($callback)
*/
public static function fallback($callback = null)
{
static::$fallback = $callback;
static::$userResolverFallback = $callback;
}

/**
Expand Down Expand Up @@ -452,11 +452,11 @@ protected function userIsApartOfDomain(Model $user, $username, $domain = null)
*/
protected function failedRetrievingUser(UserProvider $provider, $username, $domain = null)
{
if (! static::$fallback) {
if (! static::$userResolverFallback) {
return;
}

return with(static::$fallback, function ($callback) {
return with(static::$userResolverFallback, function ($callback) {
return is_string($callback) ? new $callback : $callback;
})($provider, $username, $domain);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Feature/WindowsAuthMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ protected function tearDown(): void
WindowsAuthenticate::$domainVerification = true;
WindowsAuthenticate::$logoutUnauthenticatedUsers = false;
WindowsAuthenticate::$rememberAuthenticatedUsers = false;
WindowsAuthenticate::$userResolverFallback = null;
WindowsAuthenticate::$userDomainExtractor = null;
WindowsAuthenticate::$userDomainValidator = UserDomainValidator::class;
WindowsAuthenticate::fallback(null);

LdapRecord::$failingQuietly = true;

Expand Down

0 comments on commit 672d3d1

Please sign in to comment.