Skip to content

Commit 9476751

Browse files
authored
Merge pull request #110 from modelrailroader/patch-1
Fix docs: Construct new TwoFactorAuth-class
2 parents 63b49ce + 0565d63 commit 9476751

File tree

2 files changed

+16
-19
lines changed

2 files changed

+16
-19
lines changed

docs/optional-configuration.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ title: Optional Configuration
77

88
The instance (`new TwoFactorAuth()`) can only be configured by the constructor with the following optional arguments
99

10-
Argument | Default value | Use
11-
------------------|---------------|-----
12-
`$issuer` | `null` | Will be displayed in the users app as the default issuer name when using QR code to import the secret
13-
`$digits` | `6` | The number of digits the resulting codes will be
14-
`$period` | `30` | The number of seconds a code will be valid
15-
`$algorithm` | `'sha1'` | The algorithm used (one of `sha1`, `sha256`, `sha512`, `md5`)
16-
`$qrcodeprovider` | `null` | QR-code provider
17-
`$rngprovider` | `null` | Random Number Generator provider
18-
`$timeprovider` | `null` | Time provider
10+
Argument | Default value | Use
11+
------------------|-------------------|-----
12+
`$issuer` | `null` | Will be displayed in the users app as the default issuer name when using QR code to import the secret
13+
`$digits` | `6` | The number of digits the resulting codes will be
14+
`$period` | `30` | The number of seconds a code will be valid
15+
`$algorithm` | `Algorithm::Sha1` | The algorithm used (one of `Algorithm::Sha1`, `Algorithm::Sha256`, `Algorithm::Sha512`, `Algorithm::Md5`)
16+
`$qrcodeprovider` | `null` | QR-code provider
17+
`$rngprovider` | `null` | Random Number Generator provider
18+
`$timeprovider` | `null` | Time provider
1919

2020
**Note:** the default values for `$digits`, `$period`, and `$algorithm` provide the widest variety of support amongst common authenticator apps such as Google Authenticator. If you choose to use different values for these arguments you will likely have to instruct your users to use a specific app which supports your chosen configuration.
2121

docs/qr-codes.md

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ You can also specify a size as a third argument which is 200 by default.
2020

2121
## Online Providers
2222

23-
[QRServerProvider](qr-codes/qr-server.html) (default)
23+
[QRServerProvider](qr-codes/qr-server.md) (default)
2424

2525
**Warning:** Whilst it is the default, this provider is not suggested for applications where absolute security is needed, because it uses an external service for the QR code generation. You can make use of the included offline providers listed below which generate locally.
2626

27-
[ImageChartsQRCodeProvider](qr-codes/image-charts.html)
27+
[ImageChartsQRCodeProvider](qr-codes/image-charts.md)
2828

29-
[QRicketProvider](qr-codes/qrickit.html)
29+
[QRicketProvider](qr-codes/qrickit.md)
3030

3131
## Offline Providers
3232

33-
[EndroidQrCodeProvider](qr-codes/endroid.html) and EndroidQrCodeWithLogoProvider
33+
[EndroidQrCodeProvider](qr-codes/endroid.md) and EndroidQrCodeWithLogoProvider
3434

35-
[BaconQRCodeProvider](qr-codes/bacon.html)
35+
[BaconQRCodeProvider](qr-codes/bacon.md)
3636

3737
**Note:** offline providers may have additional PHP requirements in order to function, you should study what is required before trying to make use of them.
3838

@@ -52,11 +52,8 @@ use RobThree\Auth\TwoFactorAuth;
5252
$qrCodeProvider = new YourChosenProvider();
5353

5454
$tfa = new TwoFactorAuth(
55-
null,
56-
6,
57-
30,
58-
'sha1',
59-
$qrCodeProvider
55+
issuer: "Your Company Or App Name",
56+
qrcodeprovider: $qrCodeProvider
6057
);
6158
```
6259

0 commit comments

Comments
 (0)