Skip to content

Commit 6b080bb

Browse files
committed
Added plantype to deviceflow
1 parent 2e27525 commit 6b080bb

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@churchapps/content-providers": minor
3+
---
4+
5+
Pass the approver's plan-type binding through the OAuth device flow. When the B1Admin approval page binds a screen to a plan type, the token endpoint returns `plan_type_id`; `DeviceFlowHelper.pollDeviceFlowToken` now surfaces it as `planTypeId` on the success result so TV apps can enable their "Today's Plan" view immediately after connecting.

‎content-providers/src/helpers/DeviceFlowHelper.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ export class DeviceFlowHelper {
2424

2525
if (response.ok) {
2626
const data = await response.json();
27-
return toAuthData(data, { scope: config.scopes.join(" ") });
27+
const auth = toAuthData(data, { scope: config.scopes.join(" ") });
28+
return data.plan_type_id ? { ...auth, planTypeId: data.plan_type_id as string } : auth;
2829
}
2930

3031
const errorData = await response.json();

‎content-providers/src/interfaces.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function isContentFile(item: ContentItem): item is ContentFile {
101101
}
102102

103103
export type DeviceFlowPollResult =
104-
| ContentProviderAuthData
104+
| (ContentProviderAuthData & { planTypeId?: string })
105105
| { error: string; shouldSlowDown?: boolean }
106106
| null;
107107

0 commit comments

Comments
 (0)