Skip to content

Commit

Permalink
fix: add unstorage FS driver to make "db" persisent across HMR
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed May 11, 2024
1 parent 2f1fb70 commit bd1c6c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions apps/dev/sveltekit/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ node_modules
.output
vite.config.js.timestamp-*
vite.config.ts.timestamp-*
tmp-unstorage
5 changes: 4 additions & 1 deletion apps/dev/sveltekit/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import Google from "@auth/sveltekit/providers/google"
import Passkey from "@auth/sveltekit/providers/passkey"
import { createStorage } from "unstorage"
import { UnstorageAdapter } from "@auth/unstorage-adapter"
import fsDriver from "unstorage/drivers/fs"
import { dev } from "$app/environment"

const storage = createStorage()
const storage = createStorage({
driver: fsDriver({ base: "./tmp-unstorage" }),
})

export const { handle, signIn, signOut } = SvelteKitAuth({
debug: dev ? true : false,
Expand Down

0 comments on commit bd1c6c4

Please sign in to comment.