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