mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-13 14:22:16 +00:00
Fixes #187, Inactive users are now rejected as failed logins
This commit is contained in:
@@ -73,7 +73,7 @@ class LoginHandler(BaseHandler):
|
|||||||
return {'auth': 'missing', 'missing': 'Username'}
|
return {'auth': 'missing', 'missing': 'Username'}
|
||||||
|
|
||||||
if u:
|
if u:
|
||||||
if request.GET.get('pass', None) and request.GET['pass'] == u.get_profile().api_service_password:
|
if request.GET.get('pass', None) and u.is_active and request.GET['pass'] == u.get_profile().api_service_password:
|
||||||
return {'auth': 'ok', 'id': u.id, 'username': u.username,
|
return {'auth': 'ok', 'id': u.id, 'username': u.username,
|
||||||
'email': u.email, 'groups': u.groups.all(),
|
'email': u.email, 'groups': u.groups.all(),
|
||||||
'staff': u.is_staff, 'superuser': u.is_superuser}
|
'staff': u.is_staff, 'superuser': u.is_superuser}
|
||||||
|
|||||||
Reference in New Issue
Block a user