mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-24 20:05:24 +02:00
Check URI validity after QR code upload
This commit is contained in:
@@ -4,6 +4,7 @@ namespace App\Classes;
|
||||
|
||||
use OTPHP\TOTP;
|
||||
use OTPHP\Factory;
|
||||
use Assert\AssertionFailedException;
|
||||
|
||||
class TimedTOTP
|
||||
{
|
||||
@@ -16,10 +17,11 @@ class TimedTOTP
|
||||
*/
|
||||
public static function get($uri)
|
||||
{
|
||||
|
||||
try {
|
||||
$otp = Factory::loadFromProvisioningUri($uri);
|
||||
}
|
||||
catch (InvalidArgumentException $exception) {
|
||||
catch (AssertionFailedException $exception) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user