1
0
Fork 0
mirror of https://github.com/seanmorley15/AdventureLog.git synced 2025-08-05 05:05:17 +02:00

feat: implement protected media serving and permission checks for adventure images

This commit is contained in:
Sean Morley 2025-01-18 17:03:03 -05:00
parent f10e171a8e
commit 433599dc20
7 changed files with 130 additions and 55 deletions

View file

@ -1,12 +1,14 @@
import type { Adventure, OpenStreetMapPlace } from '$lib/types';
import { fail } from '@sveltejs/kit';
import { redirect } from '@sveltejs/kit';
import type { PageServerLoad } from './$types';
import { appVersion } from '$lib/config';
const PUBLIC_SERVER_URL = process.env['PUBLIC_SERVER_URL'];
const serverEndpoint = PUBLIC_SERVER_URL || 'http://localhost:8000';
export const load = (async (event) => {
if (!event.locals.user) {
return redirect(302, '/login');
}
const query = event.url.searchParams.get('query');
if (!query) {