API is only available to logged-in users

This commit is contained in:
Neil Martinsen-Burrell 2022-10-27 15:34:17 -05:00
parent 01553a4d91
commit 7e02661416
No known key found for this signature in database
GPG key ID: 6A3C818CC10D0184
2 changed files with 13 additions and 2 deletions

View file

@ -1,9 +1,13 @@
"""Internal API views"""
from django.views.decorators.http import require_http_methods
from django.http import JsonResponse
from django.contrib.auth.decorators import login_required
@require_http_methods(["GET"])
@login_required
def available(request, domain=""):
"""Is a given domain available or not.