title: Firebase handle reset password emails for not verified users
body: <p>When a new user registers the web application a verification email is sent to him. I prevent new users to log in before verification.</p>
  
  <p>Meanwhile if the verification link expires and the user forgets the password he will click the reset password link and will receive an email.</p>
  
  <p>So I think that I should handle reset password action together with verification at once. Otherwise user will not be able to login even after changing the password.</p>
  
  <pre><code>function handleResetPassword(auth, actionCode) {
      auth.verifyPasswordResetCode(actionCode)
         .then(function (email) {
            // Showing the reset screen and ask the user for
            // the new password.
         }).catch(function (error) {
           //
         });
  };
  </code></pre>
  
  <p>When user saves the new password:</p>
  
  <pre><code>function saveNewPassword() {
      auth.confirmPasswordReset(actionCode, vm.form.password).then(function (resp) {
          // Password reset has been confirmed and new password updated.
          // Now auto sign in user
          auth.signInWithEmailAndPassword(vm.email, vm.form.password).catch(function (error) {
              // Handle Errors here.
          });
  
          firebase.auth().onAuthStateChanged(function (user) {
              if (user) {
                  // user signed in. 
                  // check whether the user is verified
                  // if not set true
                  user.updateProfile({ emailVerified: true })
              }
          });
  
      }).catch(function (error) {
          // 
  
      });
  }
  </code></pre>
  
  <p>But the code below doesn't work as I expected as it has no affect. I can change other user data (e.g. displayName) but not (emailVerified). It only works with firebase email verification.</p>
  
  <pre><code>user.updateProfile({ emailVerified: true })
  </code></pre>
  
  <p>What is the recommended approach for this type of user scenario ?</p>