Module 98207

1,681 characters · in ba0f722d8a5c995f.js
Dependencies
Required by (3)
Lazily required by (0)none
Lazily requires (0)none
Source Raw
function(e,r,o){o.d(r,{A:()=>_});var t=o(636537),E=o(228366),h=o(670492),s=o(652215);let _={enable(e){let{code:r,secret:o}=e;return t.Bo.post({url:s.Rsh.MFA_TOTP_ENABLE,body:{code:r,secret:o},oldFormErrors:!0,rejectWithError:!1}).then(e=>E.h.dispatch({type:"MFA_ENABLE_SUCCESS",token:e.body.token,codes:e.body.backup_codes}))},disable(){t.Bo.post({url:s.Rsh.MFA_TOTP_DISABLE,oldFormErrors:!0,rejectWithError:!1}).then(e=>{let{body:{token:r}}=e;return E.h.dispatch({type:"MFA_DISABLE_SUCCESS",token:r})})},enableSMS:()=>(E.h.dispatch({type:"MFA_SMS_TOGGLE"}),t.Bo.post({url:s.Rsh.MFA_SMS_ENABLE,oldFormErrors:!0,rejectWithError:!1}).then(e=>(E.h.dispatch({type:"MFA_SMS_TOGGLE_COMPLETE"}),e),e=>{throw E.h.dispatch({type:"MFA_SMS_TOGGLE_COMPLETE"}),e})),disableSMS:e=>(E.h.dispatch({type:"MFA_SMS_TOGGLE"}),t.Bo.post({url:s.Rsh.MFA_SMS_DISABLE,body:{password:e},oldFormErrors:!0,rejectWithError:!1}).then(e=>(E.h.dispatch({type:"MFA_SMS_TOGGLE_COMPLETE"}),e),e=>{throw E.h.dispatch({type:"MFA_SMS_TOGGLE_COMPLETE"}),e})),sendMFABackupCodesVerificationKeyEmail:e=>t.Bo.post({url:s.Rsh.MFA_SEND_VERIFICATION_KEY,body:{password:e},oldFormErrors:!0,rejectWithError:!1}).then(e=>E.h.dispatch({type:"MFA_SEND_VERIFICATION_KEY",nonces:{viewNonce:e.body.nonce,regenerateNonce:e.body.regenerate_nonce}}),e=>{throw e}),confirmViewBackupCodes(e,r){let{viewNonce:o,regenerateNonce:_}=h.A.getNonces();return t.Bo.post({url:s.Rsh.MFA_CODES_VERIFICATION,body:{key:e,nonce:r?_:o,regenerate:r},oldFormErrors:!0,rejectWithError:!1}).then(r=>E.h.dispatch({type:"MFA_VIEW_BACKUP_CODES",codes:r.body.backup_codes,key:e}),e=>{throw e})},clearBackupCodes(){E.h.dispatch({type:"MFA_CLEAR_BACKUP_CODES"})}}}