Skip to content

Commit

Permalink
remove kv
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed Jan 2, 2025
1 parent 9f803d0 commit 8ba39db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 29 deletions.
1 change: 0 additions & 1 deletion apps/api/src/bindings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { Env } from "hono";
type Environment = Env & {
Bindings: {
DB: D1Database;
KV: KVNamespace;
ENV_TYPE: "dev" | "prod" | "stage";
RESEND_API_KEY: string;
BETTER_AUTH_SECRET: string;
Expand Down
18 changes: 9 additions & 9 deletions apps/api/src/lib/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ export const setupAuth = (c: Context) => {
}),
secret: c.env.BETTER_AUTH_SECRET,
trustedOrigins: c.env.BETTER_AUTH_TRUSTED_ORIGINS.split(","),
secondaryStorage: {
get: async (key) => {
return c.env.KV.get(`auth:${key}`);
},
set: (key, value, ttl) => {
return c.env.KV.put(`auth:${key}`, value, { ttl });
},
delete: (key) => c.env.KV.delete(`auth:${key}`),
},
// secondaryStorage: {
// get: async (key) => {
// return c.env.KV.get(`auth:${key}`);
// },
// set: (key, value, ttl) => {
// return c.env.KV.put(`auth:${key}`, value, { ttl });
// },
// delete: (key) => c.env.KV.delete(`auth:${key}`),
// },
plugins: [
bearer(),
organization(),
Expand Down
19 changes: 0 additions & 19 deletions apps/api/wrangler.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,6 @@
"migrations_dir": "drizzle"
}
],
"kv_namespaces": [
{
"binding": "KV",
"id": "development",
"preview_id": "development"
}
],
"env": {
"production": {
"name": "languine-api",
Expand All @@ -33,12 +26,6 @@
"database_id": "5f6dc91e-405e-423a-af2f-eca985fb86ec",
"migrations_dir": "drizzle"
}
],
"kv_namespaces": [
{
"binding": "KV",
"id": ""
}
]
},
"staging": {
Expand All @@ -54,12 +41,6 @@
"database_id": "",
"migrations_dir": "drizzle"
}
],
"kv_namespaces": [
{
"binding": "KV",
"id": ""
}
]
}
}
Expand Down

0 comments on commit 8ba39db

Please sign in to comment.