SymfonyCasts / verify-email-bundle

Simple, stylish Email Verification for Symfony
https://symfonycasts.com
MIT License
414 stars 34 forks source link

Avoid using Request::getUri() #155

Closed weaverryan closed 8 months ago

weaverryan commented 10 months ago

In MakerBundle, during verification, we use $request->getUri() to get the URL to validation - https://github.com/symfony/maker-bundle/blob/main/src/Resources/skeleton/verifyEmail/EmailVerifier.tpl.php#L44

However, UriSigner has a checkRequest() method, which is simpler - and it also gets the URL in a different way, purposely avoiding getUri(): https://github.com/symfony/symfony/blob/7.1/src/Symfony/Component/HttpFoundation/UriSigner.php#L78-L84

We should:

A) In VerifyEmailHelper, deprecate the first argument of validateEmailConfirmation() from being a string and now force it to be a Request object. IF a Request is passed, use UriSigner::checkRequest().

B) Update MakerBundle to pass in the Request object.