This commit is contained in:
antv
2026-07-02 17:02:02 +07:00
parent 89790539b7
commit f594a45e84
17 changed files with 200 additions and 122 deletions
+5 -4
View File
@@ -11,14 +11,15 @@ class AuthService implements AuthServiceInterface
{
public function attemptLogin(array $credentials, Request $request): array
{
if (!Auth::attempt(['mail' => $credentials['mail'], 'password' => $credentials['password']])) {
// Manual MD5 password check
$user = User::where('mail', $credentials['mail'])->first();
if (!$user || $user->pass !== md5($credentials['password'])) {
return ['success' => false, 'error_key' => 'mail', 'error_msg' => __('auth.failed')];
}
// Log the user in manually
Auth::login($user);
$request->session()->regenerate();
$user = Auth::user();
if ($user->status != User::STATUS_ACTIVE) {
Auth::logout();
return ['success' => false, 'error_key' => 'mail', 'error_msg' => __('auth.inactive')];