Run populateFromUri() from uri setter instead of external call

This commit is contained in:
Bubka
2020-11-17 15:30:50 +01:00
parent 7bdd286fb2
commit 648c8f8006
3 changed files with 12 additions and 34 deletions

View File

@ -69,7 +69,7 @@ class QrCodeController extends Controller
// return the OTP object
$twofaccount = new TwoFAccount;
$twofaccount->populateFromUri($uri);
$twofaccount->uri = $uri;
return response()->json($twofaccount->makeVisible(['uri', 'secret', 'algorithm']), 200);
}