LoginRegister icon indicating copy to clipboard operation
LoginRegister copied to clipboard

Session login throttle issue

Open adrianbj opened this issue 6 years ago • 1 comments

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.

adrianbj avatar May 22 '18 22:05 adrianbj

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

somatonic avatar Oct 16 '18 15:10 somatonic