Revert "Request basic auth when auth required for all formats except html"

This reverts commit c07af02da527acb36db7caab3461600c94c9739e.
It was showing basic auth dialog in instances with public mode off when
user was not logged and accessed homepage. We need solve that somehow
differently.
Don't require session in internal API