Moved azure login to local app. Removed ability for new users to be created automatically
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from django.contrib.auth.backends import ModelBackend
|
||||
|
||||
from .handlers import AuthHandler
|
||||
|
||||
|
||||
class AzureBackend(ModelBackend):
|
||||
def authenticate(self, request, token=None, *args, **kwargs):
|
||||
if not token: # pragma: no cover
|
||||
return
|
||||
user = AuthHandler(request).authenticate(token)
|
||||
|
||||
# Return only if `is_active`
|
||||
if self.user_can_authenticate(user):
|
||||
return user
|
||||
Reference in New Issue
Block a user