Skip to content
This repository has been archived by the owner on Jun 13, 2022. It is now read-only.

Commit

Permalink
Made the call simpler.
Browse files Browse the repository at this point in the history
  • Loading branch information
DarkGhostHunter committed Jul 10, 2020
1 parent dfeb87f commit 2bca7e6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
7 changes: 4 additions & 3 deletions src/Http/Middleware/RequireWebAuthn.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Closure;
use Illuminate\Contracts\Session\Session;
use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\Routing\UrlGenerator;
use Illuminate\Contracts\Routing\ResponseFactory;

Expand Down Expand Up @@ -41,17 +42,17 @@ class RequireWebAuthn
* @param \Illuminate\Contracts\Routing\ResponseFactory $responseFactory
* @param \Illuminate\Contracts\Routing\UrlGenerator $urlGenerator
* @param \Illuminate\Contracts\Session\Session $session
* @param int|null $remember
* @param \Illuminate\Contracts\Config\Repository $config
*/
public function __construct(ResponseFactory $responseFactory,
UrlGenerator $urlGenerator,
Session $session,
$remember = 10800)
Repository $config)
{
$this->responseFactory = $responseFactory;
$this->urlGenerator = $urlGenerator;
$this->session = $session;
$this->remember = $remember;
$this->remember = $config->get('larapass.confirm_timeout', 10800);
}

/**
Expand Down
11 changes: 0 additions & 11 deletions src/LarapassServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
use Webauthn\Counter\ThrowExceptionIfInvalid;
use Illuminate\Contracts\Auth\Authenticatable;
use Webauthn\TokenBinding\TokenBindingHandler;
use Illuminate\Contracts\Routing\UrlGenerator;
use Webauthn\PublicKeyCredentialSourceRepository;
use Illuminate\Contracts\Routing\ResponseFactory;
use Cose\Algorithm\Manager as CoseAlgorithmManager;
use DarkGhostHunter\Larapass\Auth\CredentialBroker;
use Webauthn\TokenBinding\IgnoreTokenBindingHandler;
Expand All @@ -27,7 +25,6 @@
use Webauthn\AttestationStatement\AttestationObjectLoader;
use DarkGhostHunter\Larapass\Auth\EloquentWebAuthnProvider;
use DarkGhostHunter\Larapass\WebAuthn\WebAuthnAttestCreator;
use DarkGhostHunter\Larapass\Http\Middleware\RequireWebAuthn;
use DarkGhostHunter\Larapass\WebAuthn\WebAuthnAssertValidator;
use DarkGhostHunter\Larapass\WebAuthn\WebAuthnAttestValidator;
use DarkGhostHunter\Larapass\Contracts\WebAuthnAuthenticatable;
Expand Down Expand Up @@ -194,14 +191,6 @@ protected function bindWebAuthnBasePackage()
$app['auth']->createUserProvider($config['provider'] ?? null)
);
});

$this->app->bind(RequireWebAuthn::class, static function ($app) {
return new RequireWebAuthn(
$app[ResponseFactory::class],
$app[UrlGenerator::class],
$app['config']->get('larapass.confirm_timeout')
);
});
}

/**
Expand Down

0 comments on commit 2bca7e6

Please sign in to comment.