0

In our project, the signup process automatically logs in the user after registration like this:

$token = new UsernamePasswordToken($user, null, $firewallName, $user->getRoles());
$this->get('security.context')->setToken($token);

Which works just fine unless we also send an email in the same action.

For emails we are using swiftmailer.

Can anyone shed some light on this? Why does this happen? What can I do to keep the user logged, and also send the email?

mrzard
  • 311
  • 1
  • 4

1 Answers1

0

Finally figured it out.

This only happens when you have spooling enabled in swiftmailer. Once spooling is disabled, everything works as expected.

Now, why spooling breaks this is beyond me, I'll keep on digging.

mrzard
  • 311
  • 1
  • 4