Confirm Password on Set Password Form Is there a way to send errors back to the set password form?  

I am listening to the users.onBeforeSetPassword event in which I want to confirm that the string in a confirm password field is the same as in the newPassword field.  

craft()-&gt;on('users.onBeforeSetPassword', function(Event $event) {
       // Only do anything if it is a front end submission
       if(craft()-&gt;request-&gt;isSiteRequest())
       {
           $newPassword = craft()-&gt;request-&gt;getPost('newPassword');
           $passwordConfirm = craft()-&gt;request-&gt;getPost('passwordConfirm');
           if(isset($passwordConfirm) &amp;&amp; strcmp($newPassword, $passwordConfirm) !== 0)
           {
               $event-&gt;params['user']-&gt;addErrors(array('newPassword' =&gt; Craft::t('Passwords do not match')));
               $event-&gt;performAction = false;
           }
       }
   });
  }
}


This does prevent the user from resetting their password but doesn't send a error message back to the template.  How can I pass a variable back to the template so I can show the user their error?
You could use the craft()-&gt;userSession-&gt;setFlash('your message here'); functionality. 

How it works is explained in this or this answer for example but it boils down to setting the message in your event handler and then checking in your template if there's a message and if there's one, display it.