feat(altcha): add altcha validation layer to login
Some checks reported warnings
Cadoles/hydra-sql/pipeline/head This commit is unstable
Cadoles/hydra-sql/pipeline/pr-develop This commit is unstable

This commit is contained in:
2025-03-24 17:20:17 +01:00
parent 1cb5ae6bc3
commit 3f667eede1
38 changed files with 500 additions and 95 deletions

24
src/Flag/FlagAccessor.php Normal file
View File

@@ -0,0 +1,24 @@
<?php
namespace App\Flag;
use Predis\ClientInterface;
class FlagAccessor
{
public function __construct(
private readonly ClientInterface $redis
) {
}
public function isFlagEnabled(FlagEnum $flagName, bool $fallbackValue = false): bool
{
$flagValue = $this->redis->get($flagName->value);
if (null === $flagValue) {
return $fallbackValue;
}
return (bool) $flagValue;
}
}