@churchapps/content-providers 0.1.7 → 0.1.9

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.
package/dist/index.js CHANGED
@@ -421,7 +421,10 @@ var TokenHelper = class {
421
421
  client_id: config.clientId
422
422
  });
423
423
  const response = await fetch(`${config.oauthBase}/token`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: params.toString() });
424
- if (!response.ok) return null;
424
+ if (!response.ok) {
425
+ console.warn(`[TokenHelper] Token refresh failed: ${response.status} ${response.statusText}`);
426
+ return null;
427
+ }
425
428
  const data = await response.json();
426
429
  return { access_token: data.access_token, refresh_token: data.refresh_token || auth.refresh_token, token_type: data.token_type || "Bearer", created_at: Math.floor(Date.now() / 1e3), expires_in: data.expires_in, scope: data.scope || auth.scope };
427
430
  } catch {
@@ -1133,7 +1136,7 @@ var LessonsChurchProvider = class {
1133
1136
  title: s.name,
1134
1137
  thumbnail: s.image,
1135
1138
  path: `${currentPath}/${s.id}`
1136
- }));
1139
+ })).sort((a, b) => a.title.localeCompare(b.title));
1137
1140
  }
1138
1141
  async getLessons(studyId, currentPath) {
1139
1142
  const pathFn = this.config.endpoints.lessons;