code: def _social_auth_login(self, request, **kwargs):
      '''
          View function that redirects to social auth login,
          in case the user is not logged in.
      '''
      if request.user.is_authenticated():
          if not request.user.is_active or not request.user.is_staff:
              raise PermissionDenied()
      else:
          messages.add_message(request, messages.WARNING, 'Please authenticate first.')
          return redirect_to_login(request.get_full_path()f _social_auth_login(self, request, **kwargs):
      '''
          View function that redirects to social auth login,
          in case the user is not logged in.
      '''
      if request.user.is_authenticated():
          if not request.user.is_active or not request.user.is_staff:
              raise PermissionDenied()
      else:
          messages.add_message(request, messages.WARNING, 'Please authenticate first.')
          return redirect_to_login(request.get_full_path())
docs: View function that redirects to social auth login,
          in case the user is not logged in.