Body: <p>Is there a User Event before the authentication is fired?</p>
  
  <p>I want to show a message if the user doesn't have a password yet and if it's his first login / check if he never logged in before - All in the frontend.</p>
  
  <p>If so, send the activation / set password email.</p>
  
  <p>So i tried the <code>EVENT_BEFORE_VALIDATE</code> </p>
  
  <pre><code>
   Event::on(
              Users::class,
              Users::EVENT_BEFORE_VALIDATE,
              function (UserEvent $event) {
  </code></pre>
  
  <p>Which returns nothing. </p>
  
  <p>And the <code>EVENT_BEFORE_AUTHENTICATE</code> event. This seems to what i am searching for. But it seems that the event only fires if the user already has a password. If the user never logged in / has no password it seems that this Event is never fired.</p>
  
  <pre><code>Event::on(
              User::class,
              User::EVENT_BEFORE_AUTHENTICATE,
              function (AuthenticateUserEvent $event) {
                  dd($event);
              }
          );
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-08-01T09:18:53.020Z
Comments.Text: Also looking for this sort of behaviour. If you found a solution, workaround or differnt approach I''d love to hear it! 
Comments.UserDisplayName: Mere Development
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2022-05-07T20:25:16.153Z
Comments.Text: any solutions found?
Comments.UserDisplayName: Ra3d K
Tags: <craft3><users><events><authentication>
Title: User Event before Login - check if user has password and logged in before
ThreadText: # User Event before Login - check if user has password and logged in before
  
  (Asked by: username_0 on 2019-11-02)
  
  Is there a User Event before the authentication is fired?
  
  I want to show a message if the user doesn't have a password yet and if it's his first login / check if he never logged in before - All in the frontend.
  
  If so, send the activation / set password email.
  
  So i tried the `EVENT_BEFORE_VALIDATE`
  
  ```
  
   Event::on(
              Users::class,
              Users::EVENT_BEFORE_VALIDATE,
              function (UserEvent $event) {
  
  ```
  
  Which returns nothing.
  
  And the `EVENT_BEFORE_AUTHENTICATE` event. This seems to what i am searching for. But it seems that the event only fires if the user already has a password. If the user never logged in / has no password it seems that this Event is never fired.
  
  ```
  Event::on(
              User::class,
              User::EVENT_BEFORE_AUTHENTICATE,
              function (AuthenticateUserEvent $event) {
                  dd($event);
              }
          );
  
  ```
  
  **Tags:** craft3, users, events, authentication
  
  > **Comments:**
  > **username_1**: Also looking for this sort of behaviour. If you found a solution, workaround or differnt approach I''d love to hear it!   
  > **username_2**: any solutions found?  
  
  ---
  
  ## 0 answers
  
  