[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:
parent
7c61455ca3
commit
0351276e30
|
@ -359,7 +359,7 @@ const RocketChat = {
|
||||||
try {
|
try {
|
||||||
reduxStore.dispatch(setUser({ username: params.user || params.username }));
|
reduxStore.dispatch(setUser({ username: params.user || params.username }));
|
||||||
const code = await twoFactor({ method: details?.method || 'totp', invalid: e.data.error === 'totp-invalid' });
|
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 {
|
} catch {
|
||||||
// twoFactor was canceled
|
// twoFactor was canceled
|
||||||
return reject();
|
return reject();
|
||||||
|
@ -390,9 +390,7 @@ const RocketChat = {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const loginEmailPassword = true;
|
return this.loginTOTP(params, true);
|
||||||
|
|
||||||
return this.loginTOTP(params, loginEmailPassword);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
async loginOAuthOrSso(params) {
|
async loginOAuthOrSso(params) {
|
||||||
|
|
Loading…
Reference in New Issue