@orangecheck/me-client 0.50.0 → 0.52.0

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/server.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var authCore = require('@orangecheck/auth-core');
4
+ var identifiers = require('@orangecheck/auth-core/identifiers');
4
5
 
5
6
  var __defProp = Object.defineProperty;
6
7
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -568,12 +569,9 @@ var identity = {
568
569
  verifyActivityAttestation,
569
570
  refreshEnvelopeJwks
570
571
  };
571
-
572
- // src/connect.ts
573
572
  var ORIGIN = "https://ochk.io";
574
573
  var DEFAULT_TIMEOUT_MS = 5e3;
575
574
  var MAX_TIMEOUT_MS = 3e4;
576
- var DID_OC = /^did:oc:[0-9a-f]{32}$/;
577
575
  var BASE_KEYS = ["apiKey", "userId", "timeoutMs"];
578
576
  var PROVISION_KEYS = /* @__PURE__ */ new Set([...BASE_KEYS, "consent", "email", "emailVerified"]);
579
577
  var USER_KEYS = new Set(BASE_KEYS);
@@ -690,7 +688,7 @@ function connectProvision(options) {
690
688
  (answer) => {
691
689
  const b = answer.body;
692
690
  if (answer.status !== 200) return refused(answer, PROVISION_REASONS);
693
- const good = b?.ok === true && typeof b.did_oc === "string" && DID_OC.test(b.did_oc) && typeof b.is_new === "boolean";
691
+ const good = b?.ok === true && identifiers.isDidOc(b.did_oc) && typeof b.is_new === "boolean";
694
692
  return good ? { ok: true, did_oc: b.did_oc, is_new: b.is_new } : { ok: false, reason: "unavailable", status: 200 };
695
693
  }
696
694
  );