Browse Source

Add key generation confirmation

pull/277/head
Tilen Komel 2 years ago
parent
commit
4bde402a53
  1. 6
      src/components/PageComponents/Config/Security.tsx

6
src/components/PageComponents/Config/Security.tsx

@ -7,7 +7,6 @@ import type { SecurityValidation } from "@app/validation/config/security.js";
import { useDevice } from "@core/stores/deviceStore.js";
import { Protobuf } from "@meshtastic/js";
import { fromByteArray, toByteArray } from "base64-js";
import cryptoRandomString from "crypto-random-string";
import { Eye, EyeOff } from "lucide-react";
import { useState } from "react";
@ -70,6 +69,11 @@ export const Security = (): JSX.Element => {
};
const privateKeyClickEvent = () => {
const generate = confirm(
"Are you sure you want to generate a new key pair?",
);
if (!generate) return;
const privateKey = getX25519PrivateKey();
const publicKey = getX25519PublicKey(privateKey);

Loading…
Cancel
Save