Skip to content
This repository was archived by the owner on May 26, 2020. It is now read-only.

Commit 75d9b81

Browse files
committed
Merge pull request #171 from diegueus9/master
Fixes #161. Emit the signal user_logged_in when the user is authenticated.
2 parents f077727 + b3dd1e4 commit 75d9b81

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rest_framework_jwt/authentication.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
import jwt
2+
3+
from django.contrib.auth.signals import user_logged_in
24
from django.utils.encoding import smart_text
35
from django.utils.translation import ugettext as _
46
from rest_framework import exceptions
@@ -40,6 +42,7 @@ def authenticate(self, request):
4042
raise exceptions.AuthenticationFailed()
4143

4244
user = self.authenticate_credentials(payload)
45+
user_logged_in.send(sender=user.__class__, request=request, user=user)
4346

4447
return (user, jwt_value)
4548

0 commit comments

Comments
 (0)