[FIX] 2FA email - send code again (#2188)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Djorkaeff Alexandre 2020-06-12 16:42:10 -03:00 committed by GitHub
parent 88f69717ea
commit 5dcf2212e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -346,6 +346,7 @@ const RocketChat = {
if (e.data?.error && (e.data.error === 'totp-required' || e.data.error === 'totp-invalid')) { if (e.data?.error && (e.data.error === 'totp-required' || e.data.error === 'totp-invalid')) {
const { details } = e.data; const { details } = e.data;
try { try {
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 }));
} catch { } catch {