mirror of
https://github.com/RobThree/TwoFactorAuth.git
synced 2026-08-25 15:36:35 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 85408c4e77 | |||
| 3516aae5a3 | |||
| a2fa4c11a9 | |||
| 57970d3d5f |
@@ -10,11 +10,16 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version: ['8.2', '8.3']
|
php-version: [8.2, 8.3, 8.4, 8.5]
|
||||||
bacon-version: ['^2', '^3']
|
bacon-version: ["^2", "^3"]
|
||||||
|
exclude:
|
||||||
|
- php-version: 8.4
|
||||||
|
bacon-version: "^2"
|
||||||
|
- php-version: 8.5
|
||||||
|
bacon-version: "^2"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- uses: shivammathur/setup-php@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -10,11 +10,24 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version: ['8.2', '8.3']
|
php-version: [8.2, 8.3, 8.4, 8.5]
|
||||||
endroid-version: ["^3", "^4", "^5", "^6"]
|
endroid-version: ["^3", "^4", "^5", "^6"]
|
||||||
|
exclude:
|
||||||
|
- php-version: 8.4
|
||||||
|
endroid-version: "^3"
|
||||||
|
- php-version: 8.4
|
||||||
|
endroid-version: "^4"
|
||||||
|
- php-version: 8.4
|
||||||
|
endroid-version: "^5"
|
||||||
|
- php-version: 8.5
|
||||||
|
endroid-version: "^3"
|
||||||
|
- php-version: 8.5
|
||||||
|
endroid-version: "^4"
|
||||||
|
- php-version: 8.5
|
||||||
|
endroid-version: "^5"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- uses: shivammathur/setup-php@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -10,10 +10,10 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php-version: ['8.2', '8.3']
|
php-version: [8.2, 8.3, 8.4, 8.5]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v5
|
||||||
|
|
||||||
- uses: shivammathur/setup-php@v2
|
- uses: shivammathur/setup-php@v2
|
||||||
with:
|
with:
|
||||||
|
|||||||
@@ -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