Verification done? Try many + 5
This commit is contained in:
@@ -31,7 +31,7 @@ class ActivationController extends AbstractController
|
||||
try {
|
||||
$emailVerifier->handleEmailConfirmation($request, $user);
|
||||
} catch (VerifyEmailExceptionInterface $exception) {
|
||||
$this->addFlash('error', $exception->getReason() . ' If the link has expired, you can <a href="' . $this->generateUrl('app_verify_resend_email') . '">request a new one here</a>.');
|
||||
$this->addFlash('error', $exception->getReason() . ' If the link has expired, you can request a new one through the email</a>.');
|
||||
|
||||
return $this->redirectToRoute('app_register');
|
||||
}
|
||||
|
||||
@@ -78,6 +78,27 @@ class EmailVerifier
|
||||
if (isset($parts['port'])) {
|
||||
$request->server->set('SERVER_PORT', $parts['port']);
|
||||
}
|
||||
if (isset($parts['path'])) {
|
||||
$baseUrl = rtrim($parts['path'], '/');
|
||||
$request->server->set('SCRIPT_NAME', $baseUrl . '/index.php');
|
||||
$request->server->set('SCRIPT_FILENAME', $baseUrl . '/index.php');
|
||||
|
||||
// Prepend base path to REQUEST_URI if not already there
|
||||
$requestUri = $request->server->get('REQUEST_URI');
|
||||
if (str_starts_with($requestUri, '/') && !str_starts_with($requestUri, $baseUrl . '/')) {
|
||||
$request->server->set('REQUEST_URI', $baseUrl . $requestUri);
|
||||
}
|
||||
|
||||
// Force Request to re-calculate internal properties
|
||||
$reflection = new \ReflectionObject($request);
|
||||
foreach (['baseUrl', 'pathInfo', 'requestUri'] as $propName) {
|
||||
if ($reflection->hasProperty($propName)) {
|
||||
$prop = $reflection->getProperty($propName);
|
||||
$prop->setAccessible(true);
|
||||
$prop->setValue($request, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->verifyEmailHelper->validateEmailConfirmationFromRequest($request, (string) $user->getId(), $user->getEmail());
|
||||
|
||||
Reference in New Issue
Block a user