Allow to use the API when Login required site setting is on

Hello,

currently it is not possible to use the API when Login required site setting is on because of a filter which always redirects to the login page.

I've changed this filter so that it is possible to use the API if Login required is enabled and a correct API token is provided.

Thanks!