borgwarehouse/pages/manage-repo/add.js
2022-12-01 13:25:10 +01:00

30 lines
639 B
JavaScript

import RepoList from '../../Containers/RepoList/RepoList';
import { authOptions } from '../../pages/api/auth/[...nextauth]';
import { unstable_getServerSession } from 'next-auth/next';
export default function Add() {
return <RepoList />;
}
export async function getServerSideProps(context) {
//Var
const session = await unstable_getServerSession(
context.req,
context.res,
authOptions
);
if (!session) {
return {
redirect: {
destination: '/login',
permanent: false,
},
};
}
return {
props: {},
};
}