* [UI] Make auth header configurable * Refactor authorizeFn to move side effects out * Refactor tests to reduce duplication