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:
parent
f10e171a8e
commit
433599dc20
7 changed files with 130 additions and 55 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue