mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 15:08:46 +00:00
공개 키 등록 구현
This commit is contained in:
@@ -1,8 +1,7 @@
|
||||
import { callAPI } from "$lib/hooks";
|
||||
import { accessTokenStore } from "$lib/stores";
|
||||
|
||||
export const requestLogin = async (email: string, password: string) => {
|
||||
const res = await callAPI("/api/auth/login", {
|
||||
const res = await fetch("/api/auth/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import { Button, TextButton } from "$lib/components/buttons";
|
||||
import { BottomDiv } from "$lib/components/divs";
|
||||
import BeforeContinueModal from "./BeforeContinueModal.svelte";
|
||||
import { requestPubKeyRegistration } from "./service";
|
||||
|
||||
import IconKey from "~icons/material-symbols/key";
|
||||
|
||||
@@ -15,9 +16,15 @@
|
||||
console.log(data.privKeyBase64);
|
||||
};
|
||||
|
||||
const continueWithoutExport = () => {
|
||||
const continueWithoutExport = async () => {
|
||||
isBeforeContinueModalOpen = false;
|
||||
|
||||
const ok = await requestPubKeyRegistration(data.pubKeyBase64);
|
||||
if (!ok) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO
|
||||
};
|
||||
</script>
|
||||
|
||||
12
src/routes/(fullscreen)/key/export/service.ts
Normal file
12
src/routes/(fullscreen)/key/export/service.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { callAPI } from "$lib/hooks";
|
||||
|
||||
export const requestPubKeyRegistration = async (pubKeyBase64: string) => {
|
||||
const res = await callAPI("/api/key/register", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
},
|
||||
body: JSON.stringify({ pubKey: pubKeyBase64 }),
|
||||
});
|
||||
return res.ok;
|
||||
};
|
||||
Reference in New Issue
Block a user