Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/pages/getting-started/adapters/drizzle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import {
} from "drizzle-orm/pg-core"
import postgres from "postgres"
import { drizzle } from "drizzle-orm/postgres-js"
import type { AdapterAccountType } from "next-auth/adapters"
import type { AdapterAccountType } from "@auth/core/adapters";

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should never have to install / interact with @auth/core as a consumer of these libraries.

Could you not get the AdapterAccountType type from @auth/sveltekit/adapters? If not, then that's a bug that should be fixed - let me know 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it's not there. Here's the error message: Cannot find module '@auth/sveltekit/adapters' or its corresponding type declarations.ts(2307)

From my package.json:

    "@auth/sveltekit": "^1.7.4",

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I filed this as a bug: #12649

const connectionString = "postgres://postgres:postgres@localhost:5432/drizzle"
const pool = postgres(connectionString, { max: 1 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ With SvelteKit, you have to return the `session` object from the load function i
```ts filename="src/routes/+page.server.ts" {11}
import type { PageServerLoad } from "./$types"

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

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

```svelte filename="src/routes/+page.svelte" {7}
<script lang="ts">
import { page } from "$app/stores"
const { data } = $props();
</script>

<nav>
<img
src={$page.data.session?.user?.image ?? "https://i.pravatar.cc/300"}
src={data.session?.user?.image ?? "https://i.pravatar.cc/300"}
alt="User Avatar"
/>
</nav>
Expand Down