@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.cjs CHANGED
@@ -477,7 +477,10 @@ var TokenHelper = class {
477
477
  client_id: config.clientId
478
478
  });
479
479
  const response = await fetch(`${config.oauthBase}/token`, { method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, body: params.toString() });
480
- if (!response.ok) return null;
480
+ if (!response.ok) {
481
+ console.warn(`[TokenHelper] Token refresh failed: ${response.status} ${response.statusText}`);
482
+ return null;
483
+ }
481
484
  const data = await response.json();
482
485
  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 };
483
486
  } catch {
@@ -1189,7 +1192,7 @@ var LessonsChurchProvider = class {
1189
1192
  title: s.name,
1190
1193
  thumbnail: s.image,
1191
1194
  path: `${currentPath}/${s.id}`
1192
- }));
1195
+ })).sort((a, b) => a.title.localeCompare(b.title));
1193
1196
  }
1194
1197
  async getLessons(studyId, currentPath) {
1195
1198
  const pathFn = this.config.endpoints.lessons;