@goodandready/dsh-subscriptions 0.4.20 → 0.4.22
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/lib/index.js +6 -4
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -373,7 +373,7 @@ export function apply(ctx, config) {
|
|
|
373
373
|
verifier: row.verifier,
|
|
374
374
|
challenge: row.challenge,
|
|
375
375
|
state: row.state,
|
|
376
|
-
}, code,
|
|
376
|
+
}, code, fetchForRef(ref))
|
|
377
377
|
const slots = normalizeSlots(live().slots)
|
|
378
378
|
const slot = slots.find((s) => s.ref === ref)
|
|
379
379
|
if (slot && slot.label) blob.label = slot.label
|
|
@@ -756,7 +756,9 @@ export function apply(ctx, config) {
|
|
|
756
756
|
return
|
|
757
757
|
}
|
|
758
758
|
const q = queryOf(req)
|
|
759
|
-
const
|
|
759
|
+
const provider = q.get('provider') || ''
|
|
760
|
+
const index = Number(q.get('index') || '1')
|
|
761
|
+
const ref = refForSlot(provider, index)
|
|
760
762
|
if (!ref) { writeJson(res, 404, { ok: false, error: { code: 'slot', message: 'slot not found' } }); return }
|
|
761
763
|
try {
|
|
762
764
|
writeJson(res, 200, { ok: true, ...(await resetCredits.inspect(ref)) })
|
|
@@ -921,7 +923,7 @@ export function apply(ctx, config) {
|
|
|
921
923
|
}
|
|
922
924
|
try {
|
|
923
925
|
const cfg = vendorConfig(provider, live())
|
|
924
|
-
const start = await vendor.deviceStart(cfg,
|
|
926
|
+
const start = await vendor.deviceStart(cfg, fetchForRef(oauthRef(provider, index)))
|
|
925
927
|
const state = 'dev-' + Date.now() + '-' + Math.random().toString(36).slice(2, 10)
|
|
926
928
|
sweepPending(Date.now())
|
|
927
929
|
pending.set(state, {
|
|
@@ -970,7 +972,7 @@ export function apply(ctx, config) {
|
|
|
970
972
|
const vendor = getVendor(row.provider)
|
|
971
973
|
try {
|
|
972
974
|
const cfg = vendorConfig(row.provider, live())
|
|
973
|
-
const out = await vendor.devicePoll(cfg, { deviceAuthId: row.deviceAuthId, userCode: row.userCode },
|
|
975
|
+
const out = await vendor.devicePoll(cfg, { deviceAuthId: row.deviceAuthId, userCode: row.userCode }, fetchForRef(row.ref))
|
|
974
976
|
if (out.status !== 'authorized') {
|
|
975
977
|
writeJson(res, 200, { ok: true, status: out.status })
|
|
976
978
|
return
|
package/package.json
CHANGED