Skip to content

Commit

Permalink
added 403 for overview page
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerwoud committed May 23, 2024
1 parent 37606d4 commit 05ac1e0
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions frontend/src/loaders/submission-overview-loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,16 @@ export default async function loadSubmissionOverview({
}: {
params: Params<string>;
}) {

const projectId = params.projectId;
const projectResponse = await authenticatedFetch(
`${APIURL}/projects/${projectId}`
);

if(projectResponse.status != 200) {
throw new Response("Not authenticated", {status: 403});
}

const projectData = (await projectResponse.json())["data"];

const overviewResponse = await authenticatedFetch(
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/error/ErrorBoundary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,14 @@ const ErrorBoundaryPage = () => {
message={t("serverErrorMessage")}
/>
);
} else {
return (
<ErrorPage

Check failure on line 69 in frontend/src/pages/error/ErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

Expected indentation of 8 spaces but found 10
statusCode={error.statusText}

Check failure on line 70 in frontend/src/pages/error/ErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

Expected indentation of 10 spaces but found 14
statusTitle={t("serverError")}

Check failure on line 71 in frontend/src/pages/error/ErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

Expected indentation of 10 spaces but found 14
message={t("serverErrorMessage")}

Check failure on line 72 in frontend/src/pages/error/ErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

Expected indentation of 10 spaces but found 14
/>

Check failure on line 73 in frontend/src/pages/error/ErrorBoundary.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

Expected indentation of 8 spaces but found 10
);
}
}
};
1 change: 1 addition & 0 deletions frontend/src/pages/project/projectView/ProjectView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export default function ProjectView() {

}, [projectId, updateProject]);


Check failure on line 159 in frontend/src/pages/project/projectView/ProjectView.tsx

View workflow job for this annotation

GitHub Actions / Frontend-tests

More than 1 blank line not allowed
if (!projectId) return null;

return (
Expand Down

0 comments on commit 05ac1e0

Please sign in to comment.