DarkGhostHunter / Laraguard

"On-premises 2FA Authentication for all your users out-of-the-box
MIT License
266 stars 24 forks source link

verification code never validate #24

Closed MazettePatacaisse closed 4 years ago

MazettePatacaisse commented 4 years ago

Hello, I'm trying to implement laraguard but i'm encountered some issues. I'm on "Enabling Two Factor Authentication" step qr code is showing - google auth app generate a code when i scan but it's always false^^ Have ou got an idea why ? i have installed ntp in my server but no success - Timezone with laravel app are same as server......... I don't understand where is the problem.

Ok. Issue Solved. Work very well.

DarkGhostHunter commented 4 years ago

What was the problem?

MazettePatacaisse commented 4 years ago

A stupid error^^ For a user profile, I use a profile method that handle GET AND POST request My error was tu put your createTwoFactorAuth() at the very top of my method .

public function profile(Request $request)
    {
      $secret = $request->user()->createTwoFactorAuth();

     // Next GET treatment
    // Next POST treatment

    }

By proceeding in this way, with each call of the method, the secret key was reloaded before anything ...

Inattention error