mirror of
https://github.com/Ravinou/borgwarehouse
synced 2024-05-27 02:52:17 +02:00
44 lines
957 B
JavaScript
44 lines
957 B
JavaScript
//Lib
|
|
import SetupWizard from '../../Containers/SetupWizard/SetupWizard';
|
|
import { useRouter } from 'next/router';
|
|
import Head from 'next/head';
|
|
import { authOptions } from '../../pages/api/auth/[...nextauth]';
|
|
import { getServerSession } from 'next-auth/next';
|
|
|
|
export default function SetupWizardStep() {
|
|
////Var
|
|
const router = useRouter();
|
|
const step = router.query.slug;
|
|
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>Setup Wizard - BorgWarehouse</title>
|
|
</Head>
|
|
<SetupWizard step={step} />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export async function getServerSideProps(context) {
|
|
//Var
|
|
const session = await getServerSession(
|
|
context.req,
|
|
context.res,
|
|
authOptions
|
|
);
|
|
|
|
if (!session) {
|
|
return {
|
|
redirect: {
|
|
destination: '/login',
|
|
permanent: false,
|
|
},
|
|
};
|
|
}
|
|
|
|
return {
|
|
props: {},
|
|
};
|
|
}
|