De-lint ScalarAuthClient

This commit is contained in:
David Baker 2019-07-04 12:59:20 +01:00
parent 3f28f2e4a6
commit 7d40ccfdbe
2 changed files with 9 additions and 10 deletions

View file

@ -66,7 +66,6 @@ src/rageshake/submit-rageshake.js
src/ratelimitedfunc.js src/ratelimitedfunc.js
src/Roles.js src/Roles.js
src/Rooms.js src/Rooms.js
src/ScalarAuthClient.js
src/UiEffects.js src/UiEffects.js
src/Unread.js src/Unread.js
src/utils/DecryptFile.js src/utils/DecryptFile.js

View file

@ -96,24 +96,24 @@ class ScalarAuthClient {
registerForToken() { registerForToken() {
// Get openid bearer token from the HS as the first part of our dance // Get openid bearer token from the HS as the first part of our dance
return MatrixClientPeg.get().getOpenIdToken().then((token_object) => { return MatrixClientPeg.get().getOpenIdToken().then((tokenObject) => {
// Now we can send that to scalar and exchange it for a scalar token // Now we can send that to scalar and exchange it for a scalar token
return this.exchangeForScalarToken(token_object); return this.exchangeForScalarToken(tokenObject);
}).then((token_object) => { }).then((tokenObject) => {
window.localStorage.setItem("mx_scalar_token", token_object); window.localStorage.setItem("mx_scalar_token", tokenObject);
return token_object; return tokenObject;
}); });
} }
exchangeForScalarToken(openid_token_object) { exchangeForScalarToken(openidTokenObject) {
const scalar_rest_url = SdkConfig.get().integrations_rest_url; const scalarRestUrl = SdkConfig.get().integrations_rest_url;
return new Promise(function(resolve, reject) { return new Promise(function(resolve, reject) {
request({ request({
method: 'POST', method: 'POST',
uri: scalar_rest_url+'/register', uri: scalarRestUrl + '/register',
qs: {v: imApiVersion}, qs: {v: imApiVersion},
body: openid_token_object, body: openidTokenObject,
json: true, json: true,
}, (err, response, body) => { }, (err, response, body) => {
if (err) { if (err) {