fix(core): harden settlement and wallet integration
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user