code: def get_success_url(self):
          
          redirect_to = self.request.POST.get(
              self.redirect_field_name,
              self.request.GET.get(self.redirect_field_name, '')
          )
          url_is_safe = is_safe_url(
              url=redirect_to,
              # allowed_hosts=self.get_success_url_allowed_hosts(),
              # require_https=self.request.is_secure(),
          )
          if not url_is_safe:
              return resolve_url(settings.LOGIN_REDIRECT_URL)
          return redirect_to
docs: Ensure the user-originating redirection URL is safe.