diff --git a/src/init.js b/src/init.js index f4ff3a4..a0cefae 100644 --- a/src/init.js +++ b/src/init.js @@ -226,6 +226,12 @@ async function initializeMongoDb() { // provided by the IDV provider). The possible values of status are: // 'NEEDS_PAYMENT' | 'IN_PROGRESS' | 'ISSUED' | 'VERIFICATION_FAILED' | 'REFUNDED' status: String, + // frontendDomain allows mods to change their suggestions based on whether the domain + // is old Holonym or Holonym-within-Silk. + frontendDomain: { + type: String, // "app.holonym.id" | "silksecure.net" + required: false, + }, deletedFromIDVProvider: { type: Boolean, required: false, diff --git a/src/services/admin/user-sessions.js b/src/services/admin/user-sessions.js index 3f50dc6..25c835a 100644 --- a/src/services/admin/user-sessions.js +++ b/src/services/admin/user-sessions.js @@ -59,6 +59,7 @@ async function userSessions(req, res) { refundTxHash: s.refundTxHash, check_id: s.check_id, sessionId: s.sessionId, + frontendDomain: s.frontendDomain, sid: s._id.toString(), })); diff --git a/src/services/sessions/endpoints.js b/src/services/sessions/endpoints.js index c567c1d..ecf3b10 100644 --- a/src/services/sessions/endpoints.js +++ b/src/services/sessions/endpoints.js @@ -102,10 +102,18 @@ async function postSession(req, res) { .json({ error: "idvProvider must be one of 'veriff', 'idenfy', 'onfido'" }); } + let domain = null; + if (req.body.domain === "app.holonym.id") { + domain = "app.holonym.id"; + } else if (req.body.domain === "silksecure.net") { + domain = "silksecure.net"; + } + const session = new Session({ sigDigest: sigDigest, idvProvider: idvProvider, status: sessionStatusEnum.NEEDS_PAYMENT, + frontendDomain: domain, }); await session.save();