@openstax/ts-utils 1.21.10 → 1.21.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,10 +23,11 @@ const accountsGateway = (initializer) => (configProvider) => {
23
23
  const request = async (method, path, options, statuses = [200, 201]) => {
24
24
  const host = (await accountsBase).replace(/\/+$/, '');
25
25
  const url = `${host}/api/${path}`;
26
+ const token = options.token || await accountsAuthToken;
26
27
  const config = {
27
- headers: {
28
- Authorization: `Bearer ${options.token || await accountsAuthToken}`,
29
- },
28
+ headers: token
29
+ ? { Authorization: `Bearer ${token}` }
30
+ : {},
30
31
  method,
31
32
  };
32
33
  if (options.body) {