Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show First 20 Lines • Show All 839 Lines • ▼ Show 20 Lines | public static function findAndAuthenticate($username, $password, $clientIP = null, $verifyMFA = true): array | ||||
if (!$attempt->isAccepted()) { | if (!$attempt->isAccepted()) { | ||||
$attempt->deny($error); | $attempt->deny($error); | ||||
$attempt->save(); | $attempt->save(); | ||||
$attempt->notify(); | $attempt->notify(); | ||||
} | } | ||||
} | } | ||||
if ($user) { | if ($user) { | ||||
\Log::info("Authentication failed for {$user->email}"); | \Log::info("Authentication failed for {$user->email}. Error: $error"); | ||||
} | } | ||||
return ['reason' => $error, 'errorMessage' => $message ?? \trans("auth.error.{$error}")]; | return ['reason' => $error, 'errorMessage' => $message ?? \trans("auth.error.{$error}")]; | ||||
} | } | ||||
\Log::info("Successful authentication for {$user->email}"); | \Log::info("Successful authentication for {$user->email}"); | ||||
return ['user' => $user]; | return ['user' => $user]; | ||||
Show All 34 Lines |