Google2FALaravel Authenticator always return True in Laravel 6

485 Views Asked by At

There is a problem using the Google-Authenticator Module "PragmaRX\Google2FALaravel" in my Laravel6 project.

I installed it following the manual on the github page. Setting up 2FA-Users via QRcode works like a charm, but the authentication middleware always returns "True" for authenticated, regardless if the user has passed the 2fa challenge or not.

    public function handle($request, Closure $next)
{
    $authenticator = app(Google2FAAuthenticator::class)->boot($request);

    if ($authenticator->isAuthenticated()) { **//always returns true**
        return $next($request);
    }

    return $authenticator->makeRequestOneTimePasswordResponse();
}

I assume it has something to do with the "CARTALYST/Sentinel" package i am using (instead of the built-in laravel "Auth" Manager), someone experienced similar behaviour and knows how to fix this?

0

There are 0 best solutions below