feat(#29): Add example product tool requiring purchase to access

This commit is contained in:
Josh Creek
2024-09-22 12:06:39 +01:00
parent a4764c547e
commit fce4c0e0a5
11 changed files with 101 additions and 3 deletions
+11
View File
@@ -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;
};