mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-24 22:26:35 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 85408c4e77 | |||
| 3516aae5a3 | |||
| a2fa4c11a9 | |||
| 57970d3d5f |
@@ -21,17 +21,20 @@ Example code:
|
|||||||
|
|
||||||
```php
|
```php
|
||||||
use RobThree\Auth\TwoFactorAuth;
|
use RobThree\Auth\TwoFactorAuth;
|
||||||
|
use RobThree\Auth\Providers\Qr\QRServerProvider; // if using library's provider
|
||||||
use RobThree\Auth\Providers\Qr\BaconQrCodeProvider; // if using Bacon
|
use RobThree\Auth\Providers\Qr\BaconQrCodeProvider; // if using Bacon
|
||||||
use RobThree\Auth\Providers\Qr\EndroidQrCodeProvider; // if using Endroid
|
use RobThree\Auth\Providers\Qr\EndroidQrCodeProvider; // if using Endroid
|
||||||
|
|
||||||
|
// using the default Qr Code provider from the library
|
||||||
|
$tfa = new TwoFactorAuth(new QRServerProvider(), "Your app name");
|
||||||
// using Bacon
|
// using Bacon
|
||||||
$tfa = new TwoFactorAuth(new BaconQrCodeProvider());
|
$tfa = new TwoFactorAuth(new BaconQrCodeProvider(), "Your app name");
|
||||||
// using Endroid
|
// using Endroid
|
||||||
$tfa = new TwoFactorAuth(new EndroidQrCodeProvider());
|
$tfa = new TwoFactorAuth(new EndroidQrCodeProvider(), "Your app name");
|
||||||
// using a custom object implementing IQRCodeProvider interface
|
// using a custom object implementing IQRCodeProvider interface
|
||||||
$tfa = new TwoFactorAuth(new MyQrCodeProvider());
|
$tfa = new TwoFactorAuth(new MyQrCodeProvider(), "Your app name");
|
||||||
// using named argument and a variable
|
// using named argument and a variable
|
||||||
$tfa = new TwoFactorAuth(qrcodeprovider: $qrGenerator);
|
$tfa = new TwoFactorAuth(qrcodeprovider: $qrGenerator, issuer: "Your app name");
|
||||||
```
|
```
|
||||||
|
|
||||||
## 3. Shared secrets
|
## 3. Shared secrets
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ abstract class BaseHTTPQRCodeProvider implements IQRCodeProvider
|
|||||||
throw new QRException(curl_error($curlhandle));
|
throw new QRException(curl_error($curlhandle));
|
||||||
}
|
}
|
||||||
|
|
||||||
curl_close($curlhandle);
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user