title: Add a constraint on the Symfony login form
body: <p>I've encountered a new issue on my <strong>Symfony</strong> application and I cannot find anything to help me.</p>
  <p>In my database, a user has an <code>activation_token</code> field.</p>
  <p>When the user creates his account on my website, it generates a random token that will be used to validate his account. It will send him an email with the token in order to verify/activate his account and when he will click on it, it will set the <code>activation_token</code> field to <code>null</code>.</p>
  <p>Creating the account works. Sending the email works. Validating the account works. I only have 1 issue.</p>
  <p>I'd like to add a constraint that when the <code>activation_token</code> field is not null, the user won't be able to log in. In short, the user will need to validate his account at first in order to be able to log in. But I have no clue how to add a constraint like that.</p>
  <p>Currently, I can log in even if I didn't validate my account and that's exactly what I want to prevent.</p>
  <p>I haven't created a custom login form in PHP, I'm using the <strong>Security bundle from Symfony</strong>. Here we have a <a href="https://i.stack.imgur.com/hCMVN.png" rel="nofollow noreferrer">screenshot</a> of my <code>security.yaml</code> file.</p>
  <p>I don't know if it's possible to add a constraint with the Security bundle or not.</p>