Angular services authentication

Some ui commons angular services declare config to handle authentication and some not. What is the proper way to do it? In particular are the lines 2-5 necessary?

You should not need to do this. There is now a common interceptor at

This example is newer:

As an aside, I think that we have gotten the “xyzService” pattern wrong, and we need to rewrite this very soon before it grows too much. Specifically, we are inappropriately oversimplifying the API, e.g. when you do a query you only get the first page of results back with no indication that you didn’t get everything.