Passed
Push — task/laravel-breadcrumbs ( 3beccb...a96280 )
by Yonathan
10:46 queued 10s
created

Require2FA   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 2
eloc 5
c 0
b 0
f 0
dl 0
loc 11
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 9 2
1
<?php
2
3
namespace App\Http\Middleware;
4
5
use App\Exceptions\TwoFactorRequiredException;
6
use Closure;
7
use PragmaRX\Google2FALaravel\Support\Authenticator;
8
use PragmaRX\Google2FALaravel\Middleware;
9
10
class Require2FA extends Middleware
11
{
12
    public function handle($request, Closure $next)
1 ignored issue
show
Coding Style Documentation introduced by
Missing doc comment for function handle()
Loading history...
13
    {
14
        $authenticator = app(Authenticator::class)->boot($request);
15
16
        if (!$authenticator->isActivated()) {
17
            throw new TwoFactorRequiredException();
18
        }
19
20
        return parent::handle($request, $next);
21
    }
22
}
23