src/Middleware.php 1 location
|
@@ 8-20 (lines=13) @@
|
5 |
|
use Closure; |
6 |
|
use PragmaRX\Google2FALaravel\Support\Authenticator; |
7 |
|
|
8 |
|
class Middleware |
9 |
|
{ |
10 |
|
public function handle($request, Closure $next) |
11 |
|
{ |
12 |
|
$authenticator = app(Authenticator::class)->boot($request); |
13 |
|
|
14 |
|
if ($authenticator->isAuthenticated()) { |
15 |
|
return $next($request); |
16 |
|
} |
17 |
|
|
18 |
|
return $authenticator->makeRequestOneTimePasswordResponse(); |
19 |
|
} |
20 |
|
} |
21 |
|
|
src/MiddlewareStateless.php 1 location
|
@@ 8-20 (lines=13) @@
|
5 |
|
use Closure; |
6 |
|
use PragmaRX\Google2FALaravel\Support\Authenticator; |
7 |
|
|
8 |
|
class MiddlewareStateless |
9 |
|
{ |
10 |
|
public function handle($request, Closure $next) |
11 |
|
{ |
12 |
|
$authenticator = app(Authenticator::class)->bootStateless($request); |
13 |
|
|
14 |
|
if ($authenticator->isAuthenticated()) { |
15 |
|
return $next($request); |
16 |
|
} |
17 |
|
|
18 |
|
return $authenticator->makeRequestOneTimePasswordResponse(); |
19 |
|
} |
20 |
|
} |
21 |
|
|