diff --git a/pages/account/index.js b/pages/account/index.tsx similarity index 60% rename from pages/account/index.js rename to pages/account/index.tsx index d9bba6c..a194981 100644 --- a/pages/account/index.js +++ b/pages/account/index.tsx @@ -2,18 +2,20 @@ import Head from 'next/head'; import 'react-toastify/dist/ReactToastify.css'; import { useSession } from 'next-auth/react'; -import { authOptions } from '../../pages/api/auth/[...nextauth]'; +import { authOptions } from '../api/auth/[...nextauth]'; import { getServerSession } from 'next-auth/next'; +import { GetServerSidePropsContext } from 'next'; +import { SessionStatus } from '~/types/api/next-auth.types'; //Components -import UserSettings from '../../Containers/UserSettings/UserSettings'; +import UserSettings from '~/Containers/UserSettings/UserSettings'; export default function Account() { ////Var const { status, data } = useSession(); //Function - if (status == 'unauthenticated' || status == 'loading') { + if (status == 'unauthenticated' || status == 'loading' || !data) { return

Loading...

; } return ( @@ -22,12 +24,12 @@ export default function Account() { Account - BorgWarehouse - + ); } -export async function getServerSideProps(context) { +export async function getServerSideProps(context: GetServerSidePropsContext) { //Var const session = await getServerSession(context.req, context.res, authOptions); diff --git a/pages/monitoring/index.js b/pages/monitoring/index.tsx similarity index 79% rename from pages/monitoring/index.js rename to pages/monitoring/index.tsx index 3832b87..9c120c5 100644 --- a/pages/monitoring/index.js +++ b/pages/monitoring/index.tsx @@ -1,9 +1,10 @@ import Head from 'next/head'; -import { authOptions } from '../../pages/api/auth/[...nextauth]'; +import { authOptions } from '../api/auth/[...nextauth]'; import { getServerSession } from 'next-auth/next'; +import { GetServerSidePropsContext } from 'next'; //Components -import StorageUsedChartBar from '../../Containers/Monitoring/StorageUsedChartBar/StorageUsedChartBar'; +import StorageUsedChartBar from '~/Containers/Monitoring/StorageUsedChartBar/StorageUsedChartBar'; export default function Monitoring() { return ( @@ -45,7 +46,7 @@ export default function Monitoring() { ); } -export async function getServerSideProps(context) { +export async function getServerSideProps(context: GetServerSidePropsContext) { //Var const session = await getServerSession(context.req, context.res, authOptions);