mirror of
https://github.com/maelgangloff/domain-watchdog.git
synced 2025-12-18 02:05:36 +00:00
feat: logging validation link
This commit is contained in:
parent
2def3bbc8e
commit
628c65fd0b
10
INSTALL.md
10
INSTALL.md
@ -45,7 +45,11 @@ git clone https://github.com/maelgangloff/domain-watchdog.git
|
||||
```shell
|
||||
symfony server:start
|
||||
```
|
||||
6. Don't forget to set up workers to process the [message queue](https://symfony.com/doc/current/messenger.html)
|
||||
6. Build assets:
|
||||
```shell
|
||||
php bin/console assets:install
|
||||
```
|
||||
7. Don't forget to set up workers to process the [message queue](https://symfony.com/doc/current/messenger.html)
|
||||
|
||||
#### Frontend
|
||||
|
||||
@ -96,6 +100,10 @@ git pull origin master
|
||||
```shell
|
||||
php bin/console cache:clear
|
||||
```
|
||||
4. Build assets:
|
||||
```shell
|
||||
php bin/console assets:install
|
||||
```
|
||||
|
||||
### Frontend
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ class RegistrationController extends AbstractController
|
||||
'username' => $user->getUserIdentifier(),
|
||||
]);
|
||||
|
||||
$this->emailVerifier->sendEmailConfirmation('app_verify_email', $user,
|
||||
$email = $this->emailVerifier->sendEmailConfirmation('app_verify_email', $user,
|
||||
(new TemplatedEmail())
|
||||
->from(new Address($this->mailerSenderEmail, $this->mailerSenderName))
|
||||
->to($user->getEmail())
|
||||
@ -91,6 +91,12 @@ class RegistrationController extends AbstractController
|
||||
->htmlTemplate('emails/success/confirmation_email.html.twig')
|
||||
);
|
||||
|
||||
$signedUrl = (string) $email->getContext()['signedUrl'];
|
||||
$this->logger->notice('The validation link for user {username} is {signedUrl}', [
|
||||
'username' => $user->getUserIdentifier(),
|
||||
'signedUrl' => $signedUrl,
|
||||
]);
|
||||
|
||||
return new Response(null, 201);
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ readonly class EmailVerifier
|
||||
/**
|
||||
* @throws TransportExceptionInterface
|
||||
*/
|
||||
public function sendEmailConfirmation(string $verifyEmailRouteName, User $user, TemplatedEmail $email): void
|
||||
public function sendEmailConfirmation(string $verifyEmailRouteName, User $user, TemplatedEmail $email): TemplatedEmail
|
||||
{
|
||||
$signatureComponents = $this->verifyEmailHelper->generateSignature(
|
||||
$verifyEmailRouteName,
|
||||
@ -39,6 +39,8 @@ readonly class EmailVerifier
|
||||
$email->context($context);
|
||||
|
||||
$this->mailer->send($email);
|
||||
|
||||
return $email;
|
||||
}
|
||||
|
||||
public function handleEmailConfirmation(Request $request, User $user): void
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user