This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

+129
View File
@@ -0,0 +1,129 @@
// Metro module 5645 (f5646).
import { Endpoints } from "../../Constants";
import { HTTP } from "../../_bundle/sendRequest";
import Dispatcher from "../../Dispatcher";
import TrackedHTTPUtils from "../../utils/TrackedHTTPUtils";
import { NetworkActionNames } from "../../_bundle/Module663";
export async function fetchWebAuthnConditionalChallenge() {
let c29540_0 = (await HTTP.post({
url: Endpoints.WEBAUTHN_CONDITIONAL_UI_CHALLENGE,
headers: {
authorization: ""
},
rejectWithError: true
})).body;
return {
challenge: c29540_0.challenge,
ticket: c29540_0.ticket
};
}
export async function fetchWebAuthnPasswordlessChallenge() {
let c29541_0 = (await HTTP.post({
url: Endpoints.WEBAUTHN_PASSWORDLESS_CHALLENGE,
rejectWithError: true
})).body;
return {
challenge: c29541_0.challenge,
ticket: c29541_0.ticket
};
}
export function fetchWebAuthnCredentials() {
HTTP.get({
url: Endpoints.MFA_WEBAUTHN_CREDENTIALS,
rejectWithError: true
}).then((result) => {
if (result.body != null) {
Dispatcher.dispatch({
type: "MFA_WEBAUTHN_CREDENTIALS_LOADED",
credentials: result.body.map((item) => ({
...item,
last_used: item.last_used != null ? new Date(item.last_used) : null
}))
});
}
});
}
export async function deleteWebAuthnCredential(c25523_0) {
const credential2 = c25523_0;
return await HTTP.del({
url: Endpoints.MFA_WEBAUTHN_CREDENTIAL(credential2.id),
rejectWithError: true
}).then(() => {
Dispatcher.dispatch({
type: "AUTHENTICATOR_DELETE",
credential: credential2
});
});
}
export async function editWebAuthnCredential(c25524_0, name) {
let c25524_3;
let c29543_1, c29543_2, c29543_3;
c25524_3 = void 0;
c29543_1 = void 0;
c29543_2 = void 0;
c29543_3 = void 0;
let c29543_0 = await HTTP.patch({
url: Endpoints.MFA_WEBAUTHN_CREDENTIAL(c25524_0),
body: {
name
},
rejectWithError: false
});
if (c29543_0.body != null) {
c29543_1 = c29543_0.body;
c29543_2 = c29543_1.last_used == null ? null : new Date(c29543_1.last_used);
c29543_3 = {
...c29543_1,
last_used: c29543_2
};
Dispatcher.dispatch({
type: "AUTHENTICATOR_UPDATE",
credential: c29543_3
});
}
}
export async function startRegisterWebAuthnCredential() {
let c29544_0 = (await HTTP.post({
url: Endpoints.MFA_WEBAUTHN_CREDENTIALS,
body: {},
rejectWithError: false
})).body;
return {
ticket: c29544_0.ticket,
challenge: c29544_0.challenge
};
}
export async function finishRegisterWebAuthnCredential(name2, ticket, credential) {
let c25526_4;
c25526_4 = void 0;
let c29545_0 = await TrackedHTTPUtils.post({
url: Endpoints.MFA_WEBAUTHN_CREDENTIALS,
body: {
name: name2,
ticket,
credential
},
trackedActionData: {
event: NetworkActionNames.WEBAUTHN_REGISTER
},
rejectWithError: true
});
Dispatcher.dispatch({
type: "AUTHENTICATOR_CREATE",
credential: c29545_0.body
});
Dispatcher.dispatch({
type: "MFA_ENABLE_SUCCESS",
codes: c29545_0.body.backup_codes
});
}
export function triggerWebAuthnRegister() {
Dispatcher.dispatch({
type: "WEBAUTHN_TRIGGER_REGISTER"
});
}
export function clearWebAuthnRegisterTrigger() {
Dispatcher.dispatch({
type: "WEBAUTHN_CLEAR_REGISTER_TRIGGER"
});
}