Issues (404)

Branch: dev

app/Http/Middleware/Require2FA.php (1 issue)

Labels
Severity
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)
13
    {
14
        $authenticator = app(Authenticator::class)->boot($request);
0 ignored issues
show
The function app was not found. Maybe you did not declare it correctly or list all dependencies? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

14
        $authenticator = /** @scrutinizer ignore-call */ app(Authenticator::class)->boot($request);
Loading history...
15
16
        if (!$authenticator->isActivated()) {
17
            throw new TwoFactorRequiredException();
18
        }
19
20
        return parent::handle($request, $next);
21
    }
22
}
23