laminas-api-tools / api-tools-api-problem

Laminas Module providing API-Problem assets and rendering
https://api-tools.getlaminas.org/documentation
BSD 3-Clause "New" or "Revised" License
8 stars 18 forks source link

Alternative Rendering #8

Open weierophinney opened 4 years ago

weierophinney commented 4 years ago

I use the zf-api-problem, zf-mvc-auth module in combination with apigility. Since I have to ship a regular webapplication also within the project I use the zf-mvc-auth events to handle both api and webapp authentication stuff. Everything works quite nice on the apigility side.

However my webapplication is based on session for login/logout. So all protected routes within my webapp are automatically handled by zf-mvc-auth and my listeners that generate everything needed. As soon as I try to access a protected resource a 403 Error is created which is correct also, but this response is always a application/problem+json, which is obviously correct for the api but incorrect on side of the webapp where I want to have a regular error site. Is there some way to change or configure the way how the problems get rendered?

BR Daniel


Originally posted by @dhofstetter at https://github.com/zfcampus/zf-api-problem/issues/25