LoginRegister
LoginRegister copied to clipboard
Session login throttle issue
We need a friendly error message rather than an internal server error if the user enters the wrong password a couple of time and the throttle kicks in.
That's why I always suggested to use $session->login in a try catch. This is an old one and I once tried to make note on all login code (even ones from Ryan himself) around the forum.
This module does make the same mistake....
This code in Throttle Module does send the error to the ProcessLogin. But on any other login code, it throws an Exception, which is nice not at all.
if($this->wire('process') == 'ProcessLogin') parent::error($error);
else throw new WireException($error); // ensures the error can't be missed in unknown API usage