Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit fb3d24f

Browse files
committed
Changed all "enabled" config options, see #3 (comment).
1 parent 1bb4de7 commit fb3d24f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/Providers/BaseProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ abstract class BaseProvider
1414
*/
1515
public function enabled(User $user)
1616
{
17-
$conf = config('twofactor-auth.enabled', 'per_user');
18-
if ($conf === 'per_user') {
17+
$conf = config('twofactor-auth.enabled', 'user');
18+
if ($conf === 'user') {
1919
return !is_null($user->twoFactorAuth);
2020
}
2121

22-
return $conf === 'always';
22+
return $conf === 'enabled';
2323
}
2424
}

src/TwoFactorAuthenticable.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ public function twoFactorAuth() : HasOne
2626
*/
2727
public function setTwoFactorAuthId(string $id) : void
2828
{
29-
$enabled = config('twofactor-auth.enabled', 'per_user');
30-
if ($enabled === 'per_user') {
29+
$enabled = config('twofactor-auth.enabled', 'user');
30+
if ($enabled === 'user') {
3131
// respect when 2fa is not set for user, never insert
3232
$this->twoFactorAuth->update(['id' => $id]);
3333
}
3434

35-
if ($enabled === 'always') {
35+
if ($enabled === 'enabled') {
3636
$this->upsertTwoFactorAuthId($id);
3737
}
3838
}

src/config/twofactor-auth.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
|--------------------------------------------------------------------------
99
|
1010
| Options:
11-
| - 'always': always require two-factor authentication
11+
| - 'enabled': always require two-factor authentication
1212
| - 'disabled': disabled, never require two-factor authentication
13-
| - 'per_user': look if a row exists in the two_factor_auths table for the
13+
| - 'user': look if a row exists in the two_factor_auths table for the
1414
| user
1515
|
1616
*/
1717

18-
'enabled' => 'per_user',
18+
'enabled' => 'user',
1919

2020
/*
2121
|--------------------------------------------------------------------------

0 commit comments

Comments
 (0)