Skip to content

Commit f522e54

Browse files
chore: Revert to current main code "SocialLoginController" and lint User model new code
1 parent 05f7464 commit f522e54

2 files changed

Lines changed: 6 additions & 19 deletions

File tree

app/Http/Controllers/SocialLoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public function callback($provider)
157157
if(!$user->canLogin()) {
158158
throw new AuthenticationException
159159
(
160-
"username does not match an existing record."
160+
"We are sorry, username does not match an existing record."
161161
);
162162
}
163163

app/libs/Auth/Models/User.php

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,13 @@ class User extends BaseEntity implements AuthenticatableContract, IOpenIdUser, I
7676
self::SpamTypeHam
7777
];
7878

79-
public const MFAMethod_OTP = 'email_otp';
80-
public const MFAMethod_SMS = 'sms_otp';
81-
public const MFAMethod_TOTP = 'totp';
79+
public const MFAMethod_OTP = 'email_otp';
80+
public const MFAMethod_SMS = 'sms_otp';
81+
public const MFAMethod_TOTP = 'totp';
8282
public const MFAMethod_PASSKEY = 'passkey';
8383

8484
public const ValidMFAMethods = [
85-
self::MFAMethod_OTP,
86-
// self::MFAMethod_SMS,
87-
// self::MFAMethod_TOTP,
88-
// self::MFAMethod_PASSKEY
85+
self::MFAMethod_OTP
8986
];
9087

9188
/**
@@ -2504,18 +2501,8 @@ public function shouldRequire2FA(): bool
25042501
*/
25052502
public function enable2FA(string $method): void
25062503
{
2507-
$methods = $this->getAvailableTwoFactorMethods();
2508-
if (!in_array($method, $methods, true)) {
2509-
throw new ValidationException(
2510-
sprintf(
2511-
"Invalid 2FA method '%s'. Allowed methods: %s",
2512-
$method,
2513-
implode(', ', $methods)
2514-
)
2515-
);
2516-
}
2517-
$this->setTwoFactorEnabled(true);
25182504
$this->setTwoFactorMethod($method);
2505+
$this->setTwoFactorEnabled(true);
25192506
$this->setTwoFactorEnforcedAt(new \DateTime('now', new \DateTimeZone('UTC')));
25202507
}
25212508

0 commit comments

Comments
 (0)