delay / sveltekit-auth-starter

This is a Sveltekit auth starter project. It utilizes Lucia for authentication, Skeleton for ui elements, Prisma for database connectivity and type safety, Lucide for icons, inlang for translation, Zod and Superforms to handle forms and validation and Sveltekit.
https://sveltekit-auth-starter.vercel.app
MIT License
215 stars 31 forks source link

fix(auth): Move auth for protected routes into hook #6

Closed RobinMaas95 closed 1 year ago

RobinMaas95 commented 1 year ago

Suggested fix for #5 I moved the auth logic from layout.svelte.ts into hooks.server.ts and delete layout.svelte.ts because it has no purpose anymore. I also added the code bits to recreate the issue.

Feel free to refactor and undo changes for the scope of the repo (e.g. the fetch call to an external api could be removed or the layout.svelte.ts could be keept just for showing whats possible)

vercel[bot] commented 1 year ago

Someone is attempting to deploy a commit to a Personal Account owned by @delay on Vercel.

@delay first needs to authorize it.