#[Route(path: '/api/_action/user/user-recovery', defaults: ['auth_required' => false], name: 'api.action.user.user-recovery', methods: ['POST'])]
public function createUserRecovery(Request
$request, Context
$context): Response
{ $email =
(string) $request->request->
get('email'
);
$this->rateLimiter->
ensureAccepted( RateLimiter::USER_RECOVERY,
strtolower($email) . '-' .
$request->
getClientIp() );
$this->userRecoveryService->
generateUserRecovery($email,
$context);
return new Response();
} #[Route(path: '/api/_action/user/user-recovery/hash', defaults: ['auth_required' => false], name: 'api.action.user.user-recovery.hash', methods: ['GET'])]
public function checkUserRecovery(Request
$request, Context
$context): Response
{ $hash =
(string) $request->query->
get('hash'
);
if ($hash !== '' &&
$this->userRecoveryService->
checkHash($hash,
$context)) { return new Response();
}