diff --git a/packages/dashboard/src/pages/downloads.js b/packages/dashboard/src/pages/downloads.js index 92f162ce..a3b4cae1 100644 --- a/packages/dashboard/src/pages/downloads.js +++ b/packages/dashboard/src/pages/downloads.js @@ -4,6 +4,7 @@ import { useState } from "react"; import useSWR from "swr"; import Layout from "../components/Layout"; import Table from "../components/Table"; +import authServerSideProps from "../services/authServerSideProps"; const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const fetcher = (url) => fetch(url).then((r) => r.json()); @@ -15,6 +16,8 @@ const headers = [ ]; const actions = []; +export const getServerSideProps = authServerSideProps(); + export default function Downloads() { const [offset, setOffset] = useState(0); const { data, error } = useSWR(`${apiPrefix}/user/downloads?pageSize=10&offset=${offset}`, fetcher); diff --git a/packages/dashboard/src/pages/uploads.js b/packages/dashboard/src/pages/uploads.js index 2bd7193f..c85cb857 100644 --- a/packages/dashboard/src/pages/uploads.js +++ b/packages/dashboard/src/pages/uploads.js @@ -4,6 +4,7 @@ import { useState } from "react"; import useSWR from "swr"; import Layout from "../components/Layout"; import Table from "../components/Table"; +import authServerSideProps from "../services/authServerSideProps"; const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const fetcher = (url) => fetch(url).then((r) => r.json()); @@ -15,6 +16,8 @@ const headers = [ ]; const actions = []; +export const getServerSideProps = authServerSideProps(); + export default function Uploads() { const [offset, setOffset] = useState(0); const { data, error } = useSWR(`${apiPrefix}/user/uploads?pageSize=10&offset=${offset}`, fetcher);