mirror of
https://github.com/ansible/awx.git
synced 2026-05-07 09:27:36 -02:30
add auth timeout header to login response
This commit is contained in:
@@ -543,7 +543,12 @@ class AuthTokenView(APIView):
|
|||||||
token_key=t.key)
|
token_key=t.key)
|
||||||
t.invalidate(reason='limit_reached')
|
t.invalidate(reason='limit_reached')
|
||||||
|
|
||||||
return Response({'token': token.key, 'expires': token.expires})
|
# Note: This header is normally added in the middleware whenever an
|
||||||
|
# auth token is included in the request header.
|
||||||
|
headers = {
|
||||||
|
'Auth-Token-Timeout': int(settings.AUTH_TOKEN_EXPIRATION)
|
||||||
|
}
|
||||||
|
return Response({'token': token.key, 'expires': token.expires}, headers=headers)
|
||||||
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
return Response(serializer.errors, status=status.HTTP_400_BAD_REQUEST)
|
||||||
|
|
||||||
class OrganizationList(ListCreateAPIView):
|
class OrganizationList(ListCreateAPIView):
|
||||||
|
|||||||
Reference in New Issue
Block a user