Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Send MSISDN validation token to submit_url during registration #3476

Merged
merged 1 commit into from
Sep 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions src/components/views/auth/InteractiveAuthEntryComponents.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,7 @@ export const MsisdnAuthEntry = createReactClass({
},

componentWillMount: function() {
this._submitUrl = null;
this._sid = null;
this._msisdn = null;
this._tokenBox = null;
Expand All @@ -442,6 +443,7 @@ export const MsisdnAuthEntry = createReactClass({
this.props.clientSecret,
1, // TODO: Multiple send attempts?
).then((result) => {
this._submitUrl = result.submit_url;
this._sid = result.sid;
this._msisdn = result.msisdn;
});
Expand All @@ -462,9 +464,16 @@ export const MsisdnAuthEntry = createReactClass({
});

try {
const result = await this.props.matrixClient.submitMsisdnToken(
this._sid, this.props.clientSecret, this.state.token,
);
let result;
if (this._submitUrl) {
result = await this.props.matrixClient.submitMsisdnTokenOtherUrl(
this._submitUrl, this._sid, this.props.clientSecret, this.state.token,
);
} else {
result = await this.props.matrixClient.submitMsisdnToken(
this._sid, this.props.clientSecret, this.state.token,
);
}
if (result.success) {
const creds = {
sid: this._sid,
Expand Down