fix test issues
API CI/CD / Validate (composer + pint) (push) Successful in 3m30s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m1s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
API CI/CD / Validate (composer + pint) (push) Successful in 3m30s
API CI/CD / Test (PHPUnit) (push) Failing after 5m4s
API CI/CD / Build frontend assets (push) Successful in 1m1s
API CI/CD / Security audit (push) Failing after 49s
API CI/CD / Deploy to shared hosting (PHP) (push) Has been skipped
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\User;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Throwable;
|
||||
|
||||
/**
|
||||
* Centralizes API login lockout, suspension, and audit logging behavior.
|
||||
@@ -145,7 +146,7 @@ class ApiLoginSecurityService
|
||||
'token' => $jwtToken,
|
||||
'access_token' => $jwtToken,
|
||||
'token_type' => 'bearer',
|
||||
'expires_in' => (int) config('jwt.ttl') * 60,
|
||||
'expires_in' => $this->jwtTtlSeconds(),
|
||||
'user' => [
|
||||
'id' => (int) $user->id,
|
||||
'name' => $fullName,
|
||||
@@ -158,4 +159,15 @@ class ApiLoginSecurityService
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
private function jwtTtlSeconds(): int
|
||||
{
|
||||
try {
|
||||
$ttl = config('jwt.ttl');
|
||||
} catch (Throwable) {
|
||||
$ttl = null;
|
||||
}
|
||||
|
||||
return (int) ($ttl ?? 60) * 60;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user