set user's backend when use TokenAuthentication

This commit is contained in:
Breeze.kay 2015-05-10 22:23:10 +08:00
parent b41808b79a
commit 19c25583fa

View File

@ -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):