암호 키 생성 페이지에서 검증키와 서명키를 함께 생성하도록 변경

This commit is contained in:
static
2024-12-31 04:18:34 +09:00
parent a64e85848c
commit 0ef252913a
10 changed files with 225 additions and 82 deletions

View File

@@ -1,21 +1,19 @@
<script lang="ts">
import { onMount } from "svelte";
import { goto } from "$app/navigation";
import { getKeyPairFromIndexedDB } from "$lib/indexedDB";
import { keyPairStore } from "$lib/stores";
import "../app.css";
import { prepareKeyPairStores } from "./services";
let { children } = $props();
onMount(async () => {
const { pubKey, privKey } = await getKeyPairFromIndexedDB();
if (pubKey && privKey) {
keyPairStore.set({ publicKey: pubKey, privateKey: privKey });
} else if (!["/auth", "/key/generate"].some((path) => location.pathname.startsWith(path))) {
await goto(
"/key/generate?redirect=" + encodeURIComponent(location.pathname + location.search),
);
}
onMount(() => {
prepareKeyPairStores().then(async (ok) => {
if (!ok && !["/auth", "/key"].some((path) => location.pathname.startsWith(path))) {
await goto(
"/key/generate?redirect=" + encodeURIComponent(location.pathname + location.search),
);
}
});
});
</script>