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

Commit a09ec73

Browse files
committed
Changed all "enabled" config options to strings.
1 parent 1a9b81c commit a09ec73

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/Providers/BaseProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ public function enabled(User $user)
1818
if ($conf === 'per_user') {
1919
return !is_null($user->twoFactorAuth);
2020
}
21-
return (bool) $conf;
21+
return $conf === 'always';
2222
}
2323
}

src/TwoFactorAuthenticable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function setTwoFactorAuthId(string $id) : void
3131
// respect when 2fa is not set for user, never insert
3232
$this->twoFactorAuth->update(['id' => $id]);
3333
}
34-
elseif ($enabled) {
34+
elseif ($enabled === 'always') {
3535
$this->upsertTwoFactorAuthId($id);
3636
}
3737
}

src/config/twofactor-auth.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
|--------------------------------------------------------------------------
99
|
1010
| Options:
11-
| - true: always require two-factor authentication
12-
| - false: never require two-factor authentication
11+
| - 'always': always require two-factor authentication
12+
| - 'disabled': disabled, never require two-factor authentication
1313
| - 'per_user': look if a row exists in the two_factor_auths table for the
1414
| user
1515
|
@@ -87,6 +87,7 @@
8787
| \App\User is used, but its primary key can be specified
8888
|
8989
*/
90+
9091
'models' => [
9192
'user' => [
9293
'pk' => 'id'

0 commit comments

Comments
 (0)