-
@@ -298,22 +295,26 @@ const router = useRouter();
top: 0;
pointer-events: none;
- .erika-zone-2 {
- position: absolute;
- top: 300px;
- display: flex;
- justify-content: right;
- z-index: 2;
- height: 300px;
- width: 100%;
- object-fit: cover;
- .overlay-image {
- position: sticky;
- height: 100%;
- cursor: pointer;
- pointer-events: all;
- }
- }
+}
+
+.erika-zone-2 {
+ position: absolute;
+ top: 300px;
+ display: flex;
+ justify-content: right;
+ z-index: 2;
+ height: 300px;
+ width: 100%;
+ object-fit: cover;
+
+
+}
+
+.overlay-image {
+ position: sticky;
+ height: 100%;
+ cursor: pointer;
+ pointer-events: all;
}
\ No newline at end of file
diff --git a/services/index.ts b/services/index.ts
deleted file mode 100644
index b301cc3..0000000
--- a/services/index.ts
+++ /dev/null
@@ -1,33 +0,0 @@
-import path from "path"
-import type { IUser } from "~/netcode/interfaces"
-
-
-enum HTTPMethods {
- GET = "GET",
- POST = "POST"
-}
-
-
-const Endpoints = {
- LOGIN: { url: "/login", method: HTTPMethods.POST, body: null }
-} as const
-
-type ReturnTypes = {
- LOGIN: IUser
-}
-
-
-type EnpointsNames = keyof typeof Endpoints
-
-
-const config = useRuntimeConfig();
-
-export default async function api
(target: T, body?: typeof Endpoints[T]["body"]): Promise {
- const data = await fetch(path.join(config.public.endpoint, Endpoints[target].url), {
- credentials: "same-origin",
- mode: "same-origin",
- method: Endpoints[target].method,
- body,
- })
- return await data.json() as ReturnTypes[T]
-}
\ No newline at end of file
diff --git a/stores/authStore.ts b/stores/authStore.ts
index 7c28431..382d8ab 100644
--- a/stores/authStore.ts
+++ b/stores/authStore.ts
@@ -1,19 +1,19 @@
-import path from "path";
import { defineStore } from "pinia";
-import api from "~/services";
-
-const config = useRuntimeConfig();
+import { whoami } from "~/netcode";
export const useAuthStore = defineStore("auth", {
- state: () => ({
- self: { id: 0, image: "" }
- }),
- actions: {
- login: async () => {
- await api("LOGIN")
- },
- oauth2_register_discord: () => {
- throw Error("not implemented")
- }
- }
+ state: () => ({
+ selfUser: {} as { userId?: string; image?: string; username?: string },
+ logged: false,
+ }),
+ actions: {
+ async whoami() {
+ const data = await whoami();
+ Object.assign(this.selfUser, data.value);
+ this.logged = true;
+ },
+ oauth2_register_discord: () => {
+ throw Error("not implemented");
+ },
+ },
});