From 6fafd208a8636d81fbc4098b5b7209346896956a Mon Sep 17 00:00:00 2001 From: David Baker Date: Wed, 10 Jul 2019 14:25:30 +0100 Subject: [PATCH] add sample terms response --- src/Terms.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/Terms.js b/src/Terms.js index 1214dadeb7..420b622529 100644 --- a/src/Terms.js +++ b/src/Terms.js @@ -64,6 +64,25 @@ export async function startTermsFlow(services, interactionCallback) { (s) => MatrixClientPeg.get().getTerms(s.serviceType, s.baseUrl, s.accessToken), ); + /* + * a /terms response looks like: + * { + * "policies": { + * "terms_of_service": { + * "version": "2.0", + * "en": { + * "name": "Terms of Service", + * "url": "https://example.org/somewhere/terms-2.0-en.html" + * }, + * "fr": { + * "name": "Conditions d'utilisation", + * "url": "https://example.org/somewhere/terms-2.0-fr.html" + * } + * } + * } + * } + */ + const terms = await Promise.all(termsPromises); const policiesAndServicePairs = terms.map((t, i) => { return { 'service': services[i], 'policies': t.policies }; });