fix: improper route gating (#596)

This commit is contained in:
Xylight authored and GitHub committed 2025-06-25 19:01:00 +00:00
1 parent a8b65750ca
commit 9f4790326f
6 files changed
+25 -20

No files matched your search

+3 -4
View File
@@ -7,18 +7,17 @@ import {
generalizePrivateMessageReport,
} from '$lib/lemmy/report.js'
import { ReactiveState } from '$lib/promise.svelte'
import { error } from '@sveltejs/kit'
type ReportListType = 'unread' | 'all'
export async function load({ url, fetch }) {
if (!profile.data.jwt) error(401)
const page = Number(url.searchParams.get('page')) || 1
const type: ReportListType =
(url.searchParams.get('type') as ReportListType) || 'unread'
const jwt = profile.data?.jwt
if (!jwt) return { type: type, page: page }
// can they please
// make a sane, consistent, and simple API for once
// 3 separate requests? really?