mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 13:14:58 +08:00
Support email login
This commit is contained in:
parent
259d9dc3a2
commit
9d8d4e4896
@ -71,10 +71,17 @@ module.exports = {
|
||||
|
||||
var formVals = this.getFormVals();
|
||||
|
||||
MatrixClientPeg.get().login('m.login.password', {
|
||||
'user': formVals.username,
|
||||
'password': formVals.password
|
||||
}).done(function(data) {
|
||||
var loginParams = {
|
||||
password: formVals.password
|
||||
};
|
||||
if (formVals.username.indexOf('@') > 0) {
|
||||
loginParams.medium = 'email';
|
||||
loginParams.address = formVals.username;
|
||||
} else {
|
||||
loginParams.user = formVals.username;
|
||||
}
|
||||
|
||||
MatrixClientPeg.get().login('m.login.password', loginParams).done(function(data) {
|
||||
MatrixClientPeg.replaceUsingAccessToken(
|
||||
self.state.hs_url, self.state.is_url,
|
||||
data.user_id, data.access_token
|
||||
|
Loading…
Reference in New Issue
Block a user