mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-25 08:46:10 -06:00
Include token key when provisioning with user credentials
This commit is contained in:
parent
1f75c9f3e8
commit
c34c62a538
@ -88,6 +88,8 @@ class TokenProvisionView(APIView):
|
||||
token = Token(user=user)
|
||||
token.save()
|
||||
data = serializers.TokenSerializer(token, context={'request': request}).data
|
||||
# Manually append the token key, which is normally write-only
|
||||
data['key'] = token.key
|
||||
|
||||
return Response(data, status=HTTP_201_CREATED)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user