fix(core): harden settlement and wallet integration

This commit is contained in:
wchino
2026-07-22 01:40:37 +08:00
parent 150c3e7ebd
commit 35f6e46958
54 changed files with 2564 additions and 359 deletions

View File

@@ -11,6 +11,10 @@ use App\Exceptions\PlayerAuthenticationException;
final class PlayerNativeAuthService
{
public function __construct(
private readonly NativeJwtSecretGuard $nativeJwtSecretGuard,
) {}
/**
* @return array{access_token: string, expires_in: int, token_type: string, player: array<string, mixed>}
*/
@@ -85,14 +89,7 @@ final class PlayerNativeAuthService
public function issueToken(Player $player, ?int $ttlSeconds = null): string
{
$secret = (string) config('lottery.player_auth.native.secret', '');
if ($secret === '') {
throw new PlayerAuthenticationException(
'原生登录未配置',
ErrorCode::PlayerSsoSecretNotConfigured->value,
503,
);
}
$secret = $this->nativeJwtSecretGuard->validatedSecret();
$ttl = $ttlSeconds ?? (int) config('lottery.player_auth.native.ttl_seconds', 28800);
$now = time();