Skip to content

Commit 3b1b1b9

Browse files
chore(docs): svelte 5 compatibility updates (#12634)
* Update drizzle.mdx Fixup previous reference to next-auth * Update get-session.mdx Update code for svelte 5
1 parent 3281854 commit 3b1b1b9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/pages/getting-started/adapters/drizzle.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ import {
5555
} from "drizzle-orm/pg-core"
5656
import postgres from "postgres"
5757
import { drizzle } from "drizzle-orm/postgres-js"
58-
import type { AdapterAccountType } from "next-auth/adapters"
58+
import type { AdapterAccountType } from "@auth/core/adapters";
5959

6060
const connectionString = "postgres://postgres:postgres@localhost:5432/drizzle"
6161
const pool = postgres(connectionString, { max: 1 })

docs/pages/getting-started/session-management/get-session.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ With SvelteKit, you have to return the `session` object from the load function i
153153
```ts filename="src/routes/+page.server.ts" {11}
154154
import type { PageServerLoad } from "./$types"
155155

156-
export const load: PageServerLoad = async (events) => {
157-
const session = await events.locals.auth()
156+
export const load: PageServerLoad = async ({ params, locals }) => {
157+
const session = await locals.auth()
158158

159159
if (!session?.user?.userId) {
160160
redirect(303, `/login`)
@@ -170,12 +170,12 @@ Then you can access the `session` on the `$page.data` object in your page.
170170

171171
```svelte filename="src/routes/+page.svelte" {7}
172172
<script lang="ts">
173-
import { page } from "$app/stores"
173+
const { data } = $props();
174174
</script>
175175
176176
<nav>
177177
<img
178-
src={$page.data.session?.user?.image ?? "https://i.pravatar.cc/300"}
178+
src={data.session?.user?.image ?? "https://i.pravatar.cc/300"}
179179
alt="User Avatar"
180180
/>
181181
</nav>

0 commit comments

Comments
 (0)