Skip to content

Commit f13a5cc

Browse files
authoredAug 21, 2016
Merge pull request #996 from DeKaN/patch-1
Fix example for email auth
2 parents 61dfbc2 + 8ad3234 commit f13a5cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed
 

‎docs/backends/email.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ Password handling
4141

4242
Here's an example of password handling to add to the pipeline::
4343

44-
def user_password(strategy, user, is_new=False, *args, **kwargs):
45-
if strategy.backend.name != 'email':
44+
def user_password(strategy, backend, user, is_new=False, *args, **kwargs):
45+
if backend.name != 'email':
4646
return
4747

4848
password = strategy.request_data()['password']
@@ -51,7 +51,7 @@ Here's an example of password handling to add to the pipeline::
5151
user.save()
5252
elif not user.validate_password(password):
5353
# return {'user': None, 'social': None}
54-
raise AuthException(strategy.backend)
54+
raise AuthForbidden(backend)
5555

5656
.. _python-social-auth: https://github.com/omab/python-social-auth
5757
.. _EmailAuth: https://github.com/omab/python-social-auth/blob/master/social/backends/email.py#L5

0 commit comments

Comments
 (0)
Please sign in to comment.