프론트엔드에서의 암호 키 관련된 변수 이름 리팩토링

This commit is contained in:
static
2024-12-31 06:20:23 +09:00
parent be70ef1507
commit 214568f2ee
13 changed files with 137 additions and 145 deletions

View File

@@ -5,7 +5,7 @@
import { TitleDiv, BottomDiv } from "$lib/components/divs";
import { TextInput } from "$lib/components/inputs";
import { refreshToken } from "$lib/hooks/callAPI";
import { keyPairsStore } from "$lib/stores";
import { clientKeyStore } from "$lib/stores";
import { requestLogin, requestTokenUpgrade } from "./service";
let { data } = $props();
@@ -19,14 +19,11 @@
try {
if (!(await requestLogin(email, password))) throw new Error("Failed to login");
if (
$keyPairsStore &&
!(await requestTokenUpgrade($keyPairsStore.encKeyPair, $keyPairsStore.sigKeyPair))
)
if ($clientKeyStore && !(await requestTokenUpgrade($clientKeyStore)))
throw new Error("Failed to upgrade token");
await goto(
$keyPairsStore
$clientKeyStore
? data.redirectPath
: "/key/generate?redirect=" + encodeURIComponent(data.redirectPath),
);