mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
Access Token 저장 방식 변경
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
import { accessTokenStore } from "$lib/stores";
|
||||
|
||||
export const requestLogin = async (email: string, password: string) => {
|
||||
const res = await fetch("/api/auth/login", {
|
||||
method: "POST",
|
||||
@@ -8,13 +6,5 @@ export const requestLogin = async (email: string, password: string) => {
|
||||
},
|
||||
body: JSON.stringify({ email, password }),
|
||||
});
|
||||
if (!res.ok) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const data = await res.json();
|
||||
const token = data.accessToken as string;
|
||||
|
||||
accessTokenStore.set(token);
|
||||
return true;
|
||||
return res.ok;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user