Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/Maker/MakeRegistrationForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
use Symfony\Component\Validator\Validation;
use Symfony\Contracts\Translation\TranslatorInterface;
use SymfonyCasts\Bundle\VerifyEmail\Exception\VerifyEmailExceptionInterface;
use SymfonyCasts\Bundle\VerifyEmail\Model\VerifyEmailSignatureComponents;
use SymfonyCasts\Bundle\VerifyEmail\SymfonyCastsVerifyEmailBundle;
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelper;
use SymfonyCasts\Bundle\VerifyEmail\VerifyEmailHelperInterface;

/**
Expand Down Expand Up @@ -444,13 +444,13 @@ private function getMissingComponentsComposerMessage(): ?string
$missing = false;
$composerMessage = 'composer require';

// verify-email-bundle 1.1.1 includes support for translations and a fix for the bad expiration time bug.
// we need to check that if the bundle is installed, it is version 1.1.1 or greater
// verify-email-bundle 1.17.0 includes the new validateEmailConfirmationFromRequest method.
// we need to check that if the bundle is installed, it is version 1.17.0 or greater
if (class_exists(SymfonyCastsVerifyEmailBundle::class)) {
$reflectedComponents = new \ReflectionClass(VerifyEmailSignatureComponents::class);
$reflectedComponents = new \ReflectionClass(VerifyEmailHelper::class);

if (!$reflectedComponents->hasMethod('getExpirationMessageKey')) {
throw new RuntimeCommandException('Please upgrade symfonycasts/verify-email-bundle to version 1.1.1 or greater.');
if (!$reflectedComponents->hasMethod('validateEmailConfirmationFromRequest')) {
throw new RuntimeCommandException('Please upgrade symfonycasts/verify-email-bundle to version 1.17.0 or greater.');
}
} else {
$missing = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@
class <?= $class_name; ?> extends AbstractController
{
<?php if ($will_verify_email): ?>
private <?= $generator->getPropertyType($email_verifier_class_details) ?>$emailVerifier;

public function __construct(<?= $email_verifier_class_details->getShortName() ?> $emailVerifier)
public function __construct(private <?= $generator->getPropertyType($email_verifier_class_details) ?>$emailVerifier)
{
$this->emailVerifier = $emailVerifier;
}

<?php endif; ?>
Expand Down
2 changes: 1 addition & 1 deletion src/Resources/skeleton/verifyEmail/EmailVerifier.tpl.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function sendEmailConfirmation(string $verifyEmailRouteName, UserInterfac
*/
public function handleEmailConfirmation(Request $request, UserInterface $user): void
{
$this->verifyEmailHelper->validateEmailConfirmation($request->getUri(), $user-><?= $id_getter ?>(), $user-><?= $email_getter?>());
$this->verifyEmailHelper->validateEmailConfirmationFromRequest($request, $user-><?= $id_getter ?>(), $user-><?= $email_getter?>());

$user->setIsVerified(true);

Expand Down