[FIX] Logout from custom oauth when using password (#2435)

* [FIX] Logout from custom oauth when using password

* Remove an useless const

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-08-28 12:54:15 -03:00 committed by GitHub
parent 7c61455ca3
commit 0351276e30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 4 deletions

View File

@ -359,7 +359,7 @@ const RocketChat = {
try {
reduxStore.dispatch(setUser({ username: params.user || params.username }));
const code = await twoFactor({ method: details?.method || 'totp', invalid: e.data.error === 'totp-invalid' });
return resolve(this.loginTOTP({ ...params, code: code?.twoFactorCode }));
return resolve(this.loginTOTP({ ...params, code: code?.twoFactorCode }, loginEmailPassword));
} catch {
// twoFactor was canceled
return reject();
@ -390,9 +390,7 @@ const RocketChat = {
};
}
const loginEmailPassword = true;
return this.loginTOTP(params, loginEmailPassword);
return this.loginTOTP(params, true);
},
async loginOAuthOrSso(params) {