Support IS v2 auth in haveMsisdnToken
This commit is contained in:
parent
9fa8012315
commit
654a8c2cb8
1 changed files with 9 additions and 3 deletions
|
@ -17,6 +17,7 @@ limitations under the License.
|
||||||
|
|
||||||
import MatrixClientPeg from './MatrixClientPeg';
|
import MatrixClientPeg from './MatrixClientPeg';
|
||||||
import { _t } from './languageHandler';
|
import { _t } from './languageHandler';
|
||||||
|
import IdentityAuthClient from './IdentityAuthClient';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Allows a user to add a third party identifier to their homeserver and,
|
* Allows a user to add a third party identifier to their homeserver and,
|
||||||
|
@ -103,14 +104,19 @@ export default class AddThreepid {
|
||||||
/**
|
/**
|
||||||
* Takes a phone number verification code as entered by the user and validates
|
* Takes a phone number verification code as entered by the user and validates
|
||||||
* it with the ID server, then if successful, adds the phone number.
|
* it with the ID server, then if successful, adds the phone number.
|
||||||
* @param {string} token phone number verification code as entered by the user
|
* @param {string} msisdnToken phone number verification code as entered by the user
|
||||||
* @return {Promise} Resolves if the phone number was added. Rejects with an object
|
* @return {Promise} Resolves if the phone number was added. Rejects with an object
|
||||||
* with a "message" property which contains a human-readable message detailing why
|
* with a "message" property which contains a human-readable message detailing why
|
||||||
* the request failed.
|
* the request failed.
|
||||||
*/
|
*/
|
||||||
async haveMsisdnToken(token) {
|
async haveMsisdnToken(msisdnToken) {
|
||||||
|
const authClient = new IdentityAuthClient();
|
||||||
|
const isAccessToken = await authClient.getAccessToken();
|
||||||
const result = await MatrixClientPeg.get().submitMsisdnToken(
|
const result = await MatrixClientPeg.get().submitMsisdnToken(
|
||||||
this.sessionId, this.clientSecret, token,
|
this.sessionId,
|
||||||
|
this.clientSecret,
|
||||||
|
msisdnToken,
|
||||||
|
isAccessToken,
|
||||||
);
|
);
|
||||||
if (result.errcode) {
|
if (result.errcode) {
|
||||||
throw result;
|
throw result;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue