public static function authenticate($username, $password, $remember = false) { try { return parent::authenticate($username, $password, $remember); } catch (UserException $e) { if ($e->getCode() != 50) { throw new UserException('Invalid username/password'); } throw $e; } }