Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SvelteKit Auth documentation incomplete #6167

Closed
DoodlesEpic opened this issue Dec 24, 2022 · 0 comments · Fixed by #6184
Closed

SvelteKit Auth documentation incomplete #6167

DoodlesEpic opened this issue Dec 24, 2022 · 0 comments · Fixed by #6184
Labels
hacktoberfest Good issue to take for first time contributors hacktoberfest-docs Relates to documentation

Comments

@DoodlesEpic
Copy link
Contributor

What is the improvement or update you wish to see?

The SvelteKit integration page is missing the following code sample for +layout.server.ts:

import type { LayoutServerLoad } from './$types';

export const load: LayoutServerLoad = async (event) => {
	return {
		session: await event.locals.getSession()
	};
};

I imagine most people will want the session to be stored in the layout for all pages to access but the default docs don't touch on adding this. It's really just as simple as adding this to the docs.

Is there any context that might help us understand?

Got this (admittedly very simple) code to set the "session" inside page.data from the example linked in the documentation:
https://github.com/nextauthjs/sveltekit-auth-example

Does the docs page already exist? Please link to it.

https://authjs.dev/reference/sveltekit/modules/main

@DoodlesEpic DoodlesEpic added hacktoberfest-docs Relates to documentation triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Dec 24, 2022
@balazsorban44 balazsorban44 added hacktoberfest Good issue to take for first time contributors and removed triage Unseen or unconfirmed by a maintainer yet. Provide extra information in the meantime. labels Dec 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest Good issue to take for first time contributors hacktoberfest-docs Relates to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants