From 0351276e300544c1f945470a03e1cd0be08ed19e Mon Sep 17 00:00:00 2001 From: Djorkaeff Alexandre Date: Fri, 28 Aug 2020 12:54:15 -0300 Subject: [PATCH] [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 --- app/lib/rocketchat.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/app/lib/rocketchat.js b/app/lib/rocketchat.js index 64a5c2ca8..e2130cbf6 100644 --- a/app/lib/rocketchat.js +++ b/app/lib/rocketchat.js @@ -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) {