Redirect to login on IsAuthenticated.has_permissions == False

The current apistar.hooks will check if the client is Authenticated, return False if not, and raise Exceptions.forbidden.

The short story is that I’d like to customize the response to redirect the client to /login. I could expand upon the Forbidden class, but I’m not sure how to get apistar to use that, or if that’s even the right direction to take.

maybe returning a response with location in header ?

return Response(status=403, headers={‘location’: ‘/login/’})