mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
set user's backend when use TokenAuthentication
This commit is contained in:
parent
b41808b79a
commit
19c25583fa
|
@ -175,6 +175,8 @@ class TokenAuthentication(BaseAuthentication):
|
|||
if not token.user.is_active:
|
||||
raise exceptions.AuthenticationFailed(_('User inactive or deleted.'))
|
||||
|
||||
token.user.backend = "{0}.{1}".format(self.__class__.__module__, self.__class__.__name__)
|
||||
|
||||
return (token.user, token)
|
||||
|
||||
def authenticate_header(self, request):
|
||||
|
|
Loading…
Reference in New Issue
Block a user