Hash existing API keys, and do checks against the hash

This commit is contained in:
Alejandro Celaya
2024-11-05 23:23:06 +01:00
parent 9f6975119e
commit 1b9c8377ae
5 changed files with 61 additions and 10 deletions

View File

@@ -67,8 +67,7 @@ readonly class ApiKeyService implements ApiKeyServiceInterface
private function getByKey(string $key): ApiKey|null
{
return $this->em->getRepository(ApiKey::class)->findOneBy([
// 'key' => ApiKey::hashKey($key),
'key' => $key,
'key' => ApiKey::hashKey($key),
]);
}
}