mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-13 19:13:48 +00:00
feat(#29): Add example product tool requiring purchase to access
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
/** @type {import('./$types').PageLoad} */
|
||||
import { redirect } from '@sveltejs/kit';
|
||||
|
||||
export const load = async ({ params, locals: { safeGetSession } }) => {
|
||||
const { session } = await safeGetSession();
|
||||
if (!session) {
|
||||
throw redirect(303, '/login'); // Redirect unauthenticated users to login
|
||||
}
|
||||
|
||||
return params;
|
||||
};
|
||||
Reference in New Issue
Block a user