Change 2FA service to generate the secret on our own and use an external QR service to display the image

This commit is contained in:
Dane Everitt 2019-06-21 21:55:09 -07:00
parent 2db7928b76
commit 092e7e79ff
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
5 changed files with 44 additions and 186 deletions

View file

@ -90,8 +90,10 @@ class SecurityController extends Controller
*/
public function generateTotp(Request $request)
{
$totpData = $this->twoFactorSetupService->handle($request->user());
return response()->json([
'qrImage' => $this->twoFactorSetupService->handle($request->user()),
'qrImage' => 'https://api.qrserver.com/v1/create-qr-code/?size=200x200&data=' . $totpData,
]);
}