From 7cc4068c4470876c526830778cbdac2fdfd6dc26 Mon Sep 17 00:00:00 2001 From: Michael Farrell Date: Thu, 12 Jul 2012 11:13:15 +0930 Subject: Fixed #18616 -- added user_login_fail signal to contrib.auth Thanks to Brad Pitcher for documentation --- docs/releases/1.5.txt | 4 ++++ docs/topics/auth.txt | 21 ++++++++++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) (limited to 'docs') diff --git a/docs/releases/1.5.txt b/docs/releases/1.5.txt index d87efda0af..546170b2a8 100644 --- a/docs/releases/1.5.txt +++ b/docs/releases/1.5.txt @@ -191,6 +191,10 @@ Django 1.5 also includes several smaller improvements worth noting: recommended as good practice to provide those templates in order to present pretty error pages to the user. +* :mod:`django.contrib.auth` provides a new signal that is emitted + whenever a user fails to login successfully. See + :data:`~django.contrib.auth.signals.user_login_failed` + Backwards incompatible changes in 1.5 ===================================== diff --git a/docs/topics/auth.txt b/docs/topics/auth.txt index 0a19f5ed5a..421c371cc9 100644 --- a/docs/topics/auth.txt +++ b/docs/topics/auth.txt @@ -876,13 +876,15 @@ The auth framework uses two :doc:`signals ` that can be used for notification when a user logs in or out. .. data:: django.contrib.auth.signals.user_logged_in + :module: +.. versionadded:: 1.3 Sent when a user logs in successfully. Arguments sent with this signal: ``sender`` - As above: the class of the user that just logged in. + The class of the user that just logged in. ``request`` The current :class:`~django.http.HttpRequest` instance. @@ -891,6 +893,8 @@ Arguments sent with this signal: The user instance that just logged in. .. data:: django.contrib.auth.signals.user_logged_out + :module: +.. versionadded:: 1.3 Sent when the logout method is called. @@ -905,6 +909,21 @@ Sent when the logout method is called. The user instance that just logged out or ``None`` if the user was not authenticated. +.. data:: django.contrib.auth.signals.user_login_failed + :module: +.. versionadded:: 1.5 + +Sent when the user failed to login successfully + +``sender`` + The name of the module used for authentication. + +``credentials`` + A dictonary of keyword arguments containing the user credentials that were + passed to :func:`~django.contrib.auth.authenticate()` or your own custom + authentication backend. Credentials matching a set of 'sensitive' patterns, + (including password) will not be sent in the clear as part of the signal. + Limiting access to logged-in users ---------------------------------- -- cgit v1.3