Skip to content

Commit

Permalink
Merge pull request #5 from LifeOnScreen/development
Browse files Browse the repository at this point in the history
[Fix] Timestamps generation
  • Loading branch information
janicerar authored Oct 23, 2018
2 parents e18a241 + 3a7124e commit a9b684a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
4 changes: 2 additions & 2 deletions config/lifeonscreen2fa.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

'models' => [
/**
* Change this variable to your User model.
* Change this variable to path to user model.
*/
'user' => 'App\User',
],
'tables' => [
/**
* Table in witch users are stored.
* Table in which users are stored.
*/
'user' => 'users',
],
Expand Down
11 changes: 6 additions & 5 deletions src/Google2fa.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,12 @@ public function authenticate()
->toArray();

User2fa::where('user_id', auth()->user()->id)->delete();
User2fa::insert([
'user_id' => auth()->user()->id,
'google2fa_secret' => $secretKey,
'recovery' => json_encode($data['recovery']),
]);

$user2fa = new User2fa();
$user2fa->user_id = auth()->user()->id;
$user2fa->google2fa_secret = $secretKey;
$user2fa->recovery = json_encode($data['recovery']);
$user2fa->save();

return response(view('google2fa::recovery', $data));
}
Expand Down
11 changes: 6 additions & 5 deletions src/Http/Middleware/Google2fa.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ public function handle($request, Closure $next)
->toArray();

User2fa::where('user_id', auth()->user()->id)->delete();
User2fa::insert([
'user_id' => auth()->user()->id,
'google2fa_secret' => $secretKey,
'recovery' => json_encode($data['recovery']),
]);

$user2fa = new User2fa();
$user2fa->user_id = auth()->user()->id;
$user2fa->google2fa_secret = $secretKey;
$user2fa->recovery = json_encode($data['recovery']);
$user2fa->save();

return response(view('google2fa::recovery', $data));
}
Expand Down

0 comments on commit a9b684a

Please sign in to comment.