Skip to content

Commit

Permalink
chore(example): use vercel KV in prod deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed May 11, 2024
1 parent dd7ec4e commit 17b5f4c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion apps/examples/nextjs/auth.ts
Expand Up @@ -30,11 +30,18 @@ import WorkOS from "next-auth/providers/workos"
import Zoom from "next-auth/providers/zoom"
import { createStorage } from "unstorage"
import fsDriver from "unstorage/drivers/fs"
import vercelKVDriver from "unstorage/drivers/vercel-kv"
import { UnstorageAdapter } from "@auth/unstorage-adapter"
import type { NextAuthConfig } from "next-auth"

const storage = createStorage({
driver: fsDriver({ base: "./tmp-unstorage" }),
driver: process.env.VERCEL
? vercelKVDriver({
// @ts-expect-error
url: process.env.AUTH_KV_REST_API_URL,
token: process.env.AUTH_KV_REST_API_TOKEN,
})
: fsDriver({ base: "./tmp-unstorage" }),
})

const config = {
Expand Down

0 comments on commit 17b5f4c

Please sign in to comment.