From 2a28dca2573f9b447944858c674e5aef7c417252 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Sun, 12 May 2019 00:26:07 -0600 Subject: [PATCH] interim fix: fallback to module-level key --- lib/admin/js/telebit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/admin/js/telebit.js b/lib/admin/js/telebit.js index 4908f46..fcb46be 100644 --- a/lib/admin/js/telebit.js +++ b/lib/admin/js/telebit.js @@ -85,11 +85,11 @@ if ('undefined' !== typeof fetch) { common._sign = function (opts) { var p; if ('POST' === opts.method || opts.json) { - p = Keypairs.signJws({ jwk: opts.key, payload: opts.json || {} }).then(function (jws) { + p = Keypairs.signJws({ jwk: opts.key || common._key, payload: opts.json || {} }).then(function (jws) { opts.json = jws; }); } else { - p = Keypairs.signJwt({ jwk: opts.key , claims: { iss: false, exp: '60s' } }).then(function (jwt) { + p = Keypairs.signJwt({ jwk: opts.key || common._key, claims: { iss: false, exp: '60s' } }).then(function (jwt) { if (!opts.headers) { opts.headers = {}; } opts.headers.Authorization = 'Bearer ' + jwt; });