code: def login(self, request):
          
          try:
              user = authenticate(request)
  
              if not user:
                  raise AuthenticationFailed("User not authenticated.")
  
              if not user.is_active:
                  raise AuthenticationFailed("This user has been disabled.")
  
              login(request, user)
  
              return Response(UserSerializer(user).data)
          except AuthError as ex:
              # This indicates an error that may require attention by the
              # Treeherder or Taskcluster teams.  Logging this to New Relic to
              # increase visibility.
              newrelic.agent.record_exception()
              logger.exception("Error", exc_info=ex)
              raise AuthenticationFailed(str(ex))
docs: Verify credentials