diff --git a/.env b/.env index d3d9f9b..d9901f4 100644 --- a/.env +++ b/.env @@ -21,6 +21,8 @@ TRUSTED_PROXIES=127.0.0.1,172.20.0.1,172.20.0.0/16 TRUSTED_HOSTS=^.*$ ###< symfony/framework-bundle ### +SITE_BASE_URL=https://escapepage.dev + ###> doctrine/doctrine-bundle ### # Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml diff --git a/.env.prod b/.env.prod index 6b4348d..24e79af 100644 --- a/.env.prod +++ b/.env.prod @@ -14,6 +14,8 @@ TRUSTED_PROXIES=127.0.0.1,172.20.0.1,172.20.0.0/16 TRUSTED_HOSTS=^.*$ ###< symfony/framework-bundle ### +SITE_BASE_URL=https://escapepage.com + ###> mercure ### # Use the production URL for CORS in production MERCURE_JWT_SECRET=55UtgFXsZu09TSTdeIA7ljK4HUo9DLkRzEB7MD5tqOLjRfAb diff --git a/config/packages/routing.yaml b/config/packages/routing.yaml index 8166181..8f7cf44 100644 --- a/config/packages/routing.yaml +++ b/config/packages/routing.yaml @@ -2,7 +2,7 @@ framework: router: # Configure how to generate URLs in non-HTTP contexts, such as CLI commands. # See https://symfony.com/doc/current/routing.html#generating-urls-in-commands - #default_uri: http://localhost + default_uri: '%env(SITE_BASE_URL)%' when@prod: framework: diff --git a/src/Tech/Service/EmailVerifier.php b/src/Tech/Service/EmailVerifier.php index a798efc..6dbcddc 100644 --- a/src/Tech/Service/EmailVerifier.php +++ b/src/Tech/Service/EmailVerifier.php @@ -43,7 +43,7 @@ class EmailVerifier */ public function handleEmailConfirmation(Request $request, User $user): void { - $this->verifyEmailHelper->validateEmailConfirmation($request->getUri(), (string) $user->getId(), $user->getEmail()); + $this->verifyEmailHelper->validateEmailConfirmationFromRequest($request, (string) $user->getId(), $user->getEmail()); $user->setIsVerified(true);