Skip to content

Commit

Permalink
Fix SQLite Cloudflare D1 Documentation (#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
corliansa authored Dec 21, 2023
1 parent 71ef1e9 commit c0277d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/pages/database/sqlite.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ const adapter = new BunSQLiteAdapter(db, {

### Cloudflare D1

`CloudflareD1Adapter` takes a `D1Database` instance and a list of table names.
`D1Adapter` takes a `D1Database` instance and a list of table names.

Since the D1 binding is included with the request, create an `initializeLucia()` function to create a new `Lucia` instance on every request.

```ts
import { Lucia } from "lucia";
import { CloudflareD1Adapter } from "@lucia-auth/adapter-sqlite";
import { D1Adapter } from "@lucia-auth/adapter-sqlite";

export function initializeLucia(D1: D1Database) {
const adapter = new CloudflareD1Adapter(D1, {
const adapter = new D1Adapter(D1, {
user: "user",
session: "session"
});
Expand Down

0 comments on commit c0277d4

Please sign in to comment.