1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2025-11-13 08:02:38 +03:00

Revert "Support registration & login with phone number (#742)"

This reverts commit 0269562383.

This breaks against the current synapse release. We need to think more
carefully about backwards compatibility.
This commit is contained in:
Richard van der Hoff
2017-03-09 18:32:44 +00:00
parent 7fb9ce2b78
commit 2786fb0f46
12 changed files with 29 additions and 2031 deletions

View File

@@ -105,38 +105,21 @@ export default class Login {
});
}
loginViaPassword(username, phoneCountry, phoneNumber, pass) {
const self = this;
const isEmail = username.indexOf("@") > 0;
let identifier;
if (phoneCountry && phoneNumber) {
identifier = {
type: 'm.id.phone',
country: phoneCountry,
number: phoneNumber,
};
} else if (isEmail) {
identifier = {
type: 'm.id.thirdparty',
medium: 'email',
address: username,
};
} else {
identifier = {
type: 'm.id.user',
user: username,
};
}
const loginParams = {
loginViaPassword(username, pass) {
var self = this;
var isEmail = username.indexOf("@") > 0;
var loginParams = {
password: pass,
identifier: identifier,
initial_device_display_name: this._defaultDeviceDisplayName,
};
if (isEmail) {
loginParams.medium = 'email';
loginParams.address = username;
} else {
loginParams.user = username;
}
const client = this._createTemporaryClient();
var client = this._createTemporaryClient();
return client.login('m.login.password', loginParams).then(function(data) {
return q({
homeserverUrl: self._hsUrl,