decord/source/actions/MFAActionCreators.tsx

103 lines
4.1 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 13775
// Function ID: 13776
// Dependencies: [12799, 676, 530, 709, 2]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 13775
import getVerificationKey from "getVerificationKey";
2026-07-23 10:11:24 +00:00
import { Endpoints } from "ME";
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const result = require("sendRequest").fileFinishedImporting("actions/MFAActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export default {
enable(arg0) {
let code;
let secret;
({ code, secret } = arg0);
2026-07-29 08:29:29 +00:00
const HTTP = require(530) /* sendRequest */.HTTP;
let obj = { url: Endpoints.MFA_TOTP_ENABLE, body: { code, secret }, oldFormErrors: true, rejectWithError: null };
obj[3] = require(530) /* sendRequest */.rejectWithMigratedError();
const obj2 = require(530) /* 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-07-29 08:29:29 +00:00
const HTTP = require(530) /* sendRequest */.HTTP;
const obj = { url: Endpoints.MFA_TOTP_DISABLE, oldFormErrors: true, rejectWithError: null };
obj[2] = require(530) /* sendRequest */.rejectWithMigratedError();
const obj2 = require(530) /* sendRequest */;
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-07-29 08:29:29 +00:00
let obj = importDefault(709);
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "MFA_SMS_TOGGLE" });
2026-07-29 08:29:29 +00:00
const HTTP = require(530) /* sendRequest */.HTTP;
obj = { url: Endpoints.MFA_SMS_ENABLE, oldFormErrors: true, rejectWithError: null };
obj[2] = require(530) /* sendRequest */.rejectWithMigratedError();
const obj3 = require(530) /* 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-07-29 08:29:29 +00:00
let obj = importDefault(709);
2026-07-20 16:05:17 +00:00
obj.dispatch({ type: "MFA_SMS_TOGGLE" });
2026-07-29 08:29:29 +00:00
const HTTP = require(530) /* sendRequest */.HTTP;
obj = { url: Endpoints.MFA_SMS_DISABLE, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { password };
obj[3] = require(530) /* sendRequest */.rejectWithMigratedError();
const obj4 = require(530) /* 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-07-29 08:29:29 +00:00
const HTTP = require(530) /* sendRequest */.HTTP;
obj = { url: Endpoints.MFA_SEND_VERIFICATION_KEY, body: obj, oldFormErrors: true, rejectWithError: null };
obj = { password };
obj[3] = require(530) /* sendRequest */.rejectWithMigratedError();
const obj3 = require(530) /* 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-07-23 10:11:24 +00:00
let obj = outer1_1(outer1_2[3]);
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-07-29 08:29:29 +00:00
importDefault(709).dispatch({ type: "MFA_CLEAR_BACKUP_CODES" });
2026-07-20 16:05:17 +00:00
}
};