[PR #224] [MERGED] fix: Update "Getting Session on a loader" example #20073

Closed
opened 2026-04-15 19:27:08 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/224
Author: @krishna-santosh
Created: 10/18/2024
Status: Merged
Merged: 10/18/2024
Merged by: @Bekacru

Base: mainHead: patch-1


📝 Commits (1)

  • f8945ac fix: Update "Getting Session on a loader" example

📊 Changes

1 file changed (+3 additions, -2 deletions)

View changed files

📝 docs/content/docs/integrations/svelte-kit.mdx (+3 -2)

📄 Description

In SvelteKit, load function in +page.ts (which runs on the client) doesn't have access to request object. The request object is only available in the load function inside +page.server.ts or +layout.server.ts (which run on the server)

I've also added appropriate PageServerLoad Type instead of generic Request Type.

:)


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/224 **Author:** [@krishna-santosh](https://github.com/krishna-santosh) **Created:** 10/18/2024 **Status:** ✅ Merged **Merged:** 10/18/2024 **Merged by:** [@Bekacru](https://github.com/Bekacru) **Base:** `main` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`f8945ac`](https://github.com/better-auth/better-auth/commit/f8945ac35357604539c928ff72d3e7d925e1ade1) fix: Update "Getting Session on a loader" example ### 📊 Changes **1 file changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/integrations/svelte-kit.mdx` (+3 -2) </details> ### 📄 Description In SvelteKit, load function in `+page.ts` (which runs on the client) doesn't have access to request object. The request object is only available in the load function inside `+page.server.ts` or `+layout.server.ts` (which run on the server) I've also added appropriate `PageServerLoad` Type instead of generic `Request` Type. :) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 19:27:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#20073