This patch logs the remote address when a login attempt fails.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import six
from itsdangerous import BadSignature
import six
from itsdangerous import BadSignature
from mediagoblin.auth.tools import (send_verification_email, register_user,
check_login_simple)
from mediagoblin.auth.tools import (send_verification_email, register_user,
check_login_simple)
+_log = logging.getLogger(__name__)
+
@allow_registration
@auth_enabled
@allow_registration
@auth_enabled
return redirect(request, "index")
login_failed = True
return redirect(request, "index")
login_failed = True
+ remote_addr = request.access_route[-1] or request.remote_addr
+ _log.warn("Failed login attempt from %r", remote_addr)
return render_to_response(
request,
return render_to_response(
request,