diff options
Diffstat (limited to 'djangorestframework/authenticators.py')
| -rw-r--r-- | djangorestframework/authenticators.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/djangorestframework/authenticators.py b/djangorestframework/authenticators.py index 29875c64..ce7abd10 100644 --- a/djangorestframework/authenticators.py +++ b/djangorestframework/authenticators.py @@ -71,8 +71,11 @@ class BasicAuthenticator(BaseAuthenticator): class UserLoggedInAuthenticator(BaseAuthenticator): """Use Djagno's built-in request session for authentication.""" def authenticate(self, request): - if getattr(request, 'user', None) and request.user.is_active: + if getattr(request, 'user', None) and request.user.is_active: + # Temporarily request.POST with .RAW_CONTENT, so that we use our more generic request parsing + request._post = self.mixin.RAW_CONTENT resp = CsrfViewMiddleware().process_view(request, None, (), {}) + del(request._post) if resp is None: # csrf passed return request.user return None |
