Skip to content

Commit

Permalink
[FIX] Logout from custom oauth when using password (#2435)
Browse files Browse the repository at this point in the history
* [FIX] Logout from custom oauth when using password

* Remove an useless const

Co-authored-by: Diego Mello <diegolmello@gmail.com>
  • Loading branch information
djorkaeffalexandre and diegolmello authored Aug 28, 2020
1 parent 7c61455 commit 0351276
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions app/lib/rocketchat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -390,9 +390,7 @@ const RocketChat = {
};
}

const loginEmailPassword = true;

return this.loginTOTP(params, loginEmailPassword);
return this.loginTOTP(params, true);
},

async loginOAuthOrSso(params) {
Expand Down

0 comments on commit 0351276

Please sign in to comment.