decord/source/actions/MFAActionCreators.tsx

100 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 14199
// Function ID: 14200
// Dependencies: [13214, 676, 530, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 14199
2026-08-24 06:08:38 +00:00
import sendRequest from "sendRequest" /* 530 */;
import dispatcherDefault from "dispatcher" /* 709 */;
2026-08-25 06:04:03 +00:00
import closure_3 from "getVerificationKey" /* 13214 */;
2026-08-24 06:08:38 +00:00
import { Endpoints } from "ME" /* 676 */;
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
const result = require("set").fileFinishedImporting("actions/MFAActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
enable(arg0) {
({ code, secret } = arg0);
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
let obj = { url: Endpoints.MFA_TOTP_ENABLE, body: { code, secret }, oldFormErrors: true, rejectWithError: sendRequest.rejectWithMigratedError() };
const obj2 = sendRequest;
2026-07-20 16:05:17 +00:00
return HTTP.post(obj).then((body) => {
2026-07-29 08:29:29 +00:00
let obj = callback(table[3]);
2026-07-20 16:05:17 +00:00
obj = { type: "MFA_ENABLE_SUCCESS", token: body.body.token, codes: body.body.backup_codes };
return obj.dispatch(obj);
});
},
disable() {
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
const obj = { url: Endpoints.MFA_TOTP_DISABLE, oldFormErrors: true, rejectWithError: sendRequest.rejectWithMigratedError() };
const obj2 = sendRequest;
2026-07-29 08:29:29 +00:00
HTTP.post(obj).then((token) => callback(table[3]).dispatch({ type: "MFA_DISABLE_SUCCESS", token: token.body.token }));
2026-07-20 16:05:17 +00:00
},
enableSMS() {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "MFA_SMS_TOGGLE" });
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
obj = { url: Endpoints.MFA_SMS_ENABLE, oldFormErrors: true, rejectWithError: sendRequest.rejectWithMigratedError() };
const obj3 = sendRequest;
2026-07-20 16:05:17 +00:00
return HTTP.post(obj).then((arg0) => {
2026-07-29 08:29:29 +00:00
callback(709).dispatch({ type: "MFA_SMS_TOGGLE_COMPLETE" });
2026-07-20 16:05:17 +00:00
return arg0;
}, (arg0) => {
2026-07-29 08:29:29 +00:00
callback(709).dispatch({ type: "MFA_SMS_TOGGLE_COMPLETE" });
2026-07-20 16:05:17 +00:00
throw arg0;
});
},
disableSMS(password) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "MFA_SMS_TOGGLE" });
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.MFA_SMS_DISABLE, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { password };
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
const obj4 = sendRequest;
2026-07-20 16:05:17 +00:00
return HTTP.post(obj).then((arg0) => {
2026-07-29 08:29:29 +00:00
callback(709).dispatch({ type: "MFA_SMS_TOGGLE_COMPLETE" });
2026-07-20 16:05:17 +00:00
return arg0;
}, (arg0) => {
2026-07-29 08:29:29 +00:00
callback(709).dispatch({ type: "MFA_SMS_TOGGLE_COMPLETE" });
2026-07-20 16:05:17 +00:00
throw arg0;
});
},
sendMFABackupCodesVerificationKeyEmail(password) {
2026-08-24 06:08:38 +00:00
const HTTP = sendRequest.HTTP;
2026-07-29 08:29:29 +00:00
obj = { url: Endpoints.MFA_SEND_VERIFICATION_KEY, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { password };
2026-08-24 06:08:38 +00:00
obj[3] = sendRequest.rejectWithMigratedError();
const obj3 = sendRequest;
2026-07-20 16:05:17 +00:00
return HTTP.post(obj).then((body) => {
2026-07-29 08:29:29 +00:00
let nonces = callback(table[3]);
2026-07-20 16:05:17 +00:00
nonces = { viewNonce: body.body.nonce, regenerateNonce: body.body.regenerate_nonce };
return nonces.dispatch({ type: "MFA_SEND_VERIFICATION_KEY", nonces });
}, (arg0) => {
throw arg0;
});
},
confirmViewBackupCodes(verificationKey, regenerate) {
2026-07-23 10:11:24 +00:00
const _require = verificationKey;
nonces = nonces.getNonces();
2026-07-20 16:05:17 +00:00
let regenerateNonce = nonces.viewNonce;
if (regenerate) {
regenerateNonce = nonces.regenerateNonce;
}
2026-07-29 08:29:29 +00:00
const HTTP = _require(530).HTTP;
obj = { url: Endpoints.MFA_CODES_VERIFICATION, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { key: verificationKey, nonce: regenerateNonce, regenerate };
obj[3] = _require(530).rejectWithMigratedError();
const obj3 = _require(530);
2026-07-20 16:05:17 +00:00
return HTTP.post(obj).then((body) => {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[3]);
2026-07-23 10:11:24 +00:00
obj = { type: "MFA_VIEW_BACKUP_CODES", codes: body.body.backup_codes, key: closure_0 };
2026-07-20 16:05:17 +00:00
return obj.dispatch(obj);
}, (arg0) => {
throw arg0;
});
},
clearBackupCodes() {
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch({ type: "MFA_CLEAR_BACKUP_CODES" });
2026-07-20 16:05:17 +00:00
}
};