From 2aba18faaf05931bcf04917e4e30c446cbb661d9 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Wed, 13 Mar 2019 12:16:44 +0200 Subject: [PATCH] Add versioning to integration manager API /register and /account calls Current used version will be 1.1. Signed-off-by: Jason Robinson --- src/ScalarAuthClient.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/ScalarAuthClient.js b/src/ScalarAuthClient.js index 0639e7ceae..24979aff65 100644 --- a/src/ScalarAuthClient.js +++ b/src/ScalarAuthClient.js @@ -21,6 +21,9 @@ const request = require('browser-request'); const SdkConfig = require('./SdkConfig'); const MatrixClientPeg = require('./MatrixClientPeg'); +// The version of the integration manager API we're intending to work with +const imApiVersion = "1.1"; + class ScalarAuthClient { constructor() { this.scalarToken = null; @@ -66,7 +69,7 @@ class ScalarAuthClient { request({ method: "GET", uri: url, - qs: {scalar_token: token}, + qs: {scalar_token: token, v: imApiVersion}, json: true, }, (err, response, body) => { if (err) { @@ -100,6 +103,7 @@ class ScalarAuthClient { request({ method: 'POST', uri: scalar_rest_url+'/register', + qs: {v: imApiVersion}, body: openid_token_object, json: true, }, (err, response, body) => {