mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-11 04:07:39 +03:00
method fix for custom authentication
This commit is contained in:
parent
4599cd97cb
commit
cd9a192027
|
@ -202,7 +202,7 @@ If the `.authenticate_header()` method is not overridden, the authentication sch
|
|||
The following example will authenticate any incoming request as the user given by the username in a custom request header named 'X_USERNAME'.
|
||||
|
||||
class ExampleAuthentication(authentication.BaseAuthentication):
|
||||
def has_permission(self, request, view, obj=None):
|
||||
def authenticate(self, request):
|
||||
username = request.META.get('X_USERNAME')
|
||||
if not username:
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue
Block a user