mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-13 22:32:15 +00:00
Fix the authentication handler to actually work
This commit is contained in:
@@ -15,12 +15,18 @@ class V2AuthenticationHandler(BaseHandler):
|
||||
|
||||
allowed_methods = ('GET')
|
||||
|
||||
def read(self, request, username, password):
|
||||
def read(self, request):
|
||||
"""
|
||||
Validates login details for the provided user as
|
||||
long as 'username' and 'password' are provided.
|
||||
"""
|
||||
|
||||
username = request.GET.get('username', None)
|
||||
password = request.GET.get('password', None)
|
||||
|
||||
if not username or not password:
|
||||
return rc.BAD_REQUEST
|
||||
|
||||
try:
|
||||
user = User.object.get(username=username)
|
||||
except User.DoesNotExist:
|
||||
|
||||
Reference in New Issue
Block a user