23 lines
1006 B
TypeScript
23 lines
1006 B
TypeScript
// Metro module 16666 (f16667).
|
|
import AuthenticationStore from "../../stores/AuthenticationStore";
|
|
import AutomaticLifecycleManager from "../../lib/AutomaticLifecycleManager";
|
|
import SignalHelpers_native from "./SignalHelpers.native";
|
|
class WebAuthnSignalManager extends AutomaticLifecycleManager {
|
|
actions = {
|
|
AUTHENTICATOR_DELETE: this.handleAuthenticatorDelete,
|
|
MFA_WEBAUTHN_CREDENTIALS_LOADED: this.handleWebAuthnCredentialsLoaded,
|
|
CURRENT_USER_UPDATE: this.handleCurrentUserUpdate
|
|
};
|
|
async handleAuthenticatorDelete({ credential }) {
|
|
await SignalHelpers_native.signalUnknownCredential(credential);
|
|
}
|
|
async handleWebAuthnCredentialsLoaded({ credentials }) {
|
|
await SignalHelpers_native.signalAllAcceptedCredentials(credentials, AuthenticationStore.getId());
|
|
}
|
|
async handleCurrentUserUpdate({ user }) {
|
|
await SignalHelpers_native.signalCurrentUserDetails(user);
|
|
}
|
|
}
|
|
const webAuthnSignalManager = new WebAuthnSignalManager();
|
|
export default webAuthnSignalManager;
|