From 5472833369c9582fb2d3bd180eb8865bd4c15c52 Mon Sep 17 00:00:00 2001 From: Karol Wypchlo Date: Fri, 19 Feb 2021 16:50:45 +0100 Subject: [PATCH] auth secured routes --- packages/dashboard/src/pages/index.js | 3 +++ .../src/services/authServerSideProps.js | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 packages/dashboard/src/services/authServerSideProps.js diff --git a/packages/dashboard/src/pages/index.js b/packages/dashboard/src/pages/index.js index d30a5888..16e838cd 100644 --- a/packages/dashboard/src/pages/index.js +++ b/packages/dashboard/src/pages/index.js @@ -4,12 +4,15 @@ import prettyBytes from "pretty-bytes"; import Link from "next/link"; import useSWR from "swr"; import Layout from "../components/Layout"; +import authServerSideProps from "../services/authServerSideProps"; dayjs.extend(relativeTime); const apiPrefix = process.env.NODE_ENV === "development" ? "/api/stubs" : ""; const fetcher = (url) => fetch(url).then((r) => r.json()); +export const getServerSideProps = authServerSideProps(); + function SkylinkList({ items = [] }) { return (