return token #718

This commit is contained in:
Simon 2024-08-10 19:36:33 +02:00
parent 5fc8f4d7a5
commit 4dd7ac496a
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 5 additions and 0 deletions

View File

@ -244,6 +244,11 @@ class TokenView(ApiBaseView):
permission_classes = [AdminOnly]
@staticmethod
def get(request):
"""get token"""
return Response({"token": str(request.user.auth_token)})
@staticmethod
def delete(request):
"""delete the token, new will get created automatically"""