Add versioning to integration manager API /register and /account calls
Current used version will be 1.1. Signed-off-by: Jason Robinson <jasonr@matrix.org>
This commit is contained in:
parent
bc0806581c
commit
2aba18faaf
1 changed files with 5 additions and 1 deletions
|
@ -21,6 +21,9 @@ const request = require('browser-request');
|
||||||
const SdkConfig = require('./SdkConfig');
|
const SdkConfig = require('./SdkConfig');
|
||||||
const MatrixClientPeg = require('./MatrixClientPeg');
|
const MatrixClientPeg = require('./MatrixClientPeg');
|
||||||
|
|
||||||
|
// The version of the integration manager API we're intending to work with
|
||||||
|
const imApiVersion = "1.1";
|
||||||
|
|
||||||
class ScalarAuthClient {
|
class ScalarAuthClient {
|
||||||
constructor() {
|
constructor() {
|
||||||
this.scalarToken = null;
|
this.scalarToken = null;
|
||||||
|
@ -66,7 +69,7 @@ class ScalarAuthClient {
|
||||||
request({
|
request({
|
||||||
method: "GET",
|
method: "GET",
|
||||||
uri: url,
|
uri: url,
|
||||||
qs: {scalar_token: token},
|
qs: {scalar_token: token, v: imApiVersion},
|
||||||
json: true,
|
json: true,
|
||||||
}, (err, response, body) => {
|
}, (err, response, body) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -100,6 +103,7 @@ class ScalarAuthClient {
|
||||||
request({
|
request({
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
uri: scalar_rest_url+'/register',
|
uri: scalar_rest_url+'/register',
|
||||||
|
qs: {v: imApiVersion},
|
||||||
body: openid_token_object,
|
body: openid_token_object,
|
||||||
json: true,
|
json: true,
|
||||||
}, (err, response, body) => {
|
}, (err, response, body) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue