Completed
Push — master ( 241ec6...70b488 )
by Antonio Carlos
04:26
created

Middleware   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 13
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 2
1
<?php
2
3
namespace PragmaRX\Google2FALaravel;
4
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