diff --git a/components.d.ts b/components.d.ts
index 40b7d2a..ef49267 100644
--- a/components.d.ts
+++ b/components.d.ts
@@ -19,6 +19,7 @@ declare module 'vue' {
Button: typeof import('primevue/button')['default']
Checkbox: typeof import('primevue/checkbox')['default']
CheckIcon: typeof import('./src/components/icons/CheckIcon.vue')['default']
+ Credit: typeof import('./src/components/icons/Credit.vue')['default']
DashboardLayout: typeof import('./src/components/DashboardLayout.vue')['default']
Home: typeof import('./src/components/icons/Home.vue')['default']
HomeFilled: typeof import('./src/components/icons/HomeFilled.vue')['default']
@@ -48,6 +49,7 @@ declare global {
const Button: typeof import('primevue/button')['default']
const Checkbox: typeof import('primevue/checkbox')['default']
const CheckIcon: typeof import('./src/components/icons/CheckIcon.vue')['default']
+ const Credit: typeof import('./src/components/icons/Credit.vue')['default']
const DashboardLayout: typeof import('./src/components/DashboardLayout.vue')['default']
const Home: typeof import('./src/components/icons/Home.vue')['default']
const HomeFilled: typeof import('./src/components/icons/HomeFilled.vue')['default']
diff --git a/src/api/rpc/auth.ts b/src/api/rpc/auth.ts
index 900fe0c..918666e 100644
--- a/src/api/rpc/auth.ts
+++ b/src/api/rpc/auth.ts
@@ -224,11 +224,11 @@ async function getCSRFToken() {
const payload = await verify(token, JWT_SECRET) as any;
const stored = csrfTokens.get(payload.sessionId);
- if (!stored) {
- throw new Error('CSRF token not found');
- }
+ // if (!stored) {
+ // throw new Error('CSRF token not found');
+ // }
- return { csrfToken: stored.token };
+ return { csrfToken: stored?.token || null };
}
export const authMethods = {
diff --git a/src/api/rpc/index.ts b/src/api/rpc/index.ts
index af46bff..d70e044 100644
--- a/src/api/rpc/index.ts
+++ b/src/api/rpc/index.ts
@@ -6,7 +6,7 @@ import {
import { tinyassert } from "@hiogawa/utils";
import { MiddlewareHandler, type Context, type Next } from "hono";
import { getContext } from "hono/context-storage";
-import { register } from "module";
+import { csrf } from 'hono/csrf'
import { z } from "zod";
import { authMethods } from "./auth";
import { jwt } from "hono/jwt";
@@ -320,7 +320,9 @@ export const rpcServer = async (c: Context, next: Next) => {
if (c.req.path !== endpoint && !c.req.path.startsWith(endpoint + "/")) {
return await next();
}
- // c.get("redis").has(`auth_token:${}`)
+ const cert = c.req.header()
+ console.log("RPC Request Path:", c.req.raw.cf);
+ // if (!cert) return c.text('Forbidden', 403)
const handler = exposeTinyRpc({
routes,
adapter: httpServerAdapter({ endpoint }),
diff --git a/src/components/DashboardLayout.vue b/src/components/DashboardLayout.vue
index 1a1b422..194bff9 100644
--- a/src/components/DashboardLayout.vue
+++ b/src/components/DashboardLayout.vue
@@ -1,37 +1,36 @@
-
-
-
+
+
+
-
+