ignore csrf on login view

This commit is contained in:
Simon 2024-08-10 17:18:00 +02:00
parent 2ee037c745
commit 37d6a13cbf
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 3 additions and 0 deletions

View File

@ -1,6 +1,8 @@
"""all user api views"""
from common.views import ApiBaseView
from django.utils.decorators import method_decorator
from django.views.decorators.csrf import csrf_exempt
from rest_framework.authtoken.models import Token
from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.response import Response
@ -49,6 +51,7 @@ class UserConfigView(ApiBaseView):
return Response(response)
@method_decorator(csrf_exempt, name='dispatch')
class LoginApiView(ObtainAuthToken):
"""resolves to /api/user/login/
POST: return token and username after successful login