fix tests
This commit is contained in:
@@ -50,7 +50,7 @@ class AuthController extends BaseApiController
|
||||
}
|
||||
|
||||
$user = User::query()->whereRaw('LOWER(email) = ?', [$email])->first();
|
||||
if (!$user) {
|
||||
if (! $user) {
|
||||
$security->logIpAttempt((string) $ip);
|
||||
Log::notice('api_login: unknown email', [
|
||||
'ip' => (string) $ip,
|
||||
@@ -111,7 +111,7 @@ class AuthController extends BaseApiController
|
||||
$security->logSuccessfulLogin($user->fresh(), $request);
|
||||
|
||||
$fresh = $user->fresh();
|
||||
if (!$fresh) {
|
||||
if (! $fresh) {
|
||||
Log::warning('api_login: fresh user reload failed after successful verification', [
|
||||
'ip' => (string) $ip,
|
||||
'email' => $this->maskEmail($email),
|
||||
@@ -139,7 +139,7 @@ class AuthController extends BaseApiController
|
||||
[$local, $domain] = explode('@', $email, 2);
|
||||
$localPrefix = substr($local, 0, min(2, strlen($local)));
|
||||
|
||||
return $localPrefix . str_repeat('*', max(strlen($local) - strlen($localPrefix), 0)) . '@' . $domain;
|
||||
return $localPrefix.str_repeat('*', max(strlen($local) - strlen($localPrefix), 0)).'@'.$domain;
|
||||
}
|
||||
|
||||
public function refresh(Request $request): JsonResponse
|
||||
@@ -160,7 +160,7 @@ class AuthController extends BaseApiController
|
||||
public function me(): JsonResponse
|
||||
{
|
||||
$user = Auth::user();
|
||||
if (!$user) {
|
||||
if (! $user) {
|
||||
return $this->respondError('Unauthorized.', 401);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user