WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
File tree Expand file tree Collapse file tree 4 files changed +18
-2
lines changed
src/routes/(authenticated)/management Expand file tree Collapse file tree 4 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 438438 "newsletters" : " Newsletter" ,
439439 "next" : " Weiter" ,
440440 "no" : " Nein" ,
441+ "noAccess" : " Hier hast du keinen Zugriff" ,
441442 "noAnswer" : " Keine Antwort" ,
442443 "noAnswerYet" : " Noch nicht beantwortet" ,
443444 "noCommittees" : " Keine Gremien" ,
Original file line number Diff line number Diff line change 438438 "newsletters" : " Newsletter" ,
439439 "next" : " Next" ,
440440 "no" : " No" ,
441+ "noAccess" : " You don't have access to this page." ,
441442 "noAnswer" : " No Answer" ,
442443 "noAnswerYet" : " Not yet answered" ,
443444 "noCommittees" : " No Committees" ,
Original file line number Diff line number Diff line change 11import { graphql } from '$houdini' ;
22import { allConferenceQuery } from '$lib/queries/allConferences' ;
3- import type { PageLoad } from './$types' ;
3+ import { error } from '@sveltejs/kit' ;
4+ import type { LayoutLoad } from './$types' ;
5+ import { m } from '$lib/paraglide/messages' ;
46
57const conferencesWhereImMoreThanMember = graphql ( `
68 query ConferencesWhereImMoreThanMember($myUserId: String!) {
@@ -28,7 +30,7 @@ const conferencesWhereImMoreThanMember = graphql(`
2830 }
2931` ) ;
3032
31- export const load : PageLoad = async ( event ) => {
33+ export const load : LayoutLoad = async ( event ) => {
3234 const { user } = await event . parent ( ) ;
3335
3436 // we want the conferences to appear either if we are a privileged user on that conference or
@@ -53,6 +55,11 @@ export const load: PageLoad = async (event) => {
5355 blocking : true
5456 } ) ;
5557 const queriedConfernces = data ?. findManyConferences ;
58+
59+ if ( queriedConfernces . length === 0 ) {
60+ error ( 403 , m . noAccess ( ) ) ;
61+ }
62+
5663 return {
5764 conferences : queriedConfernces ?. map ( ( c ) => ( {
5865 id : c . id ,
Original file line number Diff line number Diff line change 1+ import { error } from '@sveltejs/kit' ;
12import type { LayoutLoad } from './$types' ;
3+ import { m } from '$lib/paraglide/messages' ;
24
35export const load : LayoutLoad = async ( event ) => {
6+ const parentData = await event . parent ( ) ;
7+
8+ if ( ! parentData . conferences . map ( ( c ) => c . id ) . includes ( event . params . conferenceId ) )
9+ error ( 403 , m . noAccess ( ) ) ;
10+
411 return {
512 conferenceId : event . params . conferenceId
613 } ;
You can’t perform that action at this time.
0 commit comments