암호 키 생성 페이지 레이아웃 구현

This commit is contained in:
static
2024-12-26 21:21:20 +09:00
parent da4b753c41
commit 552681115a
8 changed files with 249 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
import { callAPI } from "$lib/hooks";
import { accessToken } from "$lib/stores/auth";
export const requestLogin = async (email: string, password: string) => {
const res = await callAPI("/api/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ email, password }),
});
if (!res.ok) {
return false;
}
const data = await res.json();
const token = data.accessToken as string;
accessToken.set(token);
return true;
};