[FIX] 2FA and LDAP (#488)
This commit is contained in:
parent
2607c64437
commit
7dfd57b20c
|
@ -168,7 +168,7 @@ const RocketChat = {
|
|||
}
|
||||
this.ddp = ddp;
|
||||
if (login) {
|
||||
SDK.driver.ddp.login({ resume: login.resume });
|
||||
SDK.driver.login({ resume: login.resume });
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -443,39 +443,30 @@ const RocketChat = {
|
|||
},
|
||||
|
||||
async loginWithPassword({ username, password, code }) {
|
||||
let params = {};
|
||||
let params = { username, password };
|
||||
const state = reduxStore.getState();
|
||||
|
||||
if (state.settings.LDAP_Enable) {
|
||||
params = {
|
||||
...params,
|
||||
ldap: true,
|
||||
username,
|
||||
ldapPass: password,
|
||||
ldapOptions: {}
|
||||
};
|
||||
} else if (state.settings.CROWD_Enable) {
|
||||
params = {
|
||||
crowd: true,
|
||||
username,
|
||||
crowdPassword: password
|
||||
...params,
|
||||
crowd: true
|
||||
};
|
||||
} else {
|
||||
params = {
|
||||
username, password
|
||||
};
|
||||
|
||||
if (typeof username === 'string' && username.indexOf('@') !== -1) {
|
||||
params.email = username;
|
||||
delete params.username;
|
||||
}
|
||||
} else if (typeof username === 'string' && username.indexOf('@') !== -1) {
|
||||
params.email = username;
|
||||
delete params.username;
|
||||
}
|
||||
|
||||
if (code) {
|
||||
params = {
|
||||
totp: {
|
||||
login: params,
|
||||
code
|
||||
}
|
||||
...params,
|
||||
code,
|
||||
totp: true
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue