refactor: _app, 404 and index

This commit is contained in:
Ravinou 2025-02-15 20:46:26 +01:00
commit d7bd79b5b4
No known key found for this signature in database
GPG key ID: EEEE670C40F6A4D7
3 changed files with 5 additions and 3 deletions

View file

@ -4,11 +4,12 @@ import Head from 'next/head';
import { ToastContainer } from 'react-toastify';
import 'react-toastify/dist/ReactToastify.css';
import { SessionProvider } from 'next-auth/react';
import { AppProps } from 'next/app';
//Components
import Layout from '../Components/UI/Layout/Layout';
export default function MyApp({ Component, pageProps }) {
export default function MyApp({ Component, pageProps }: AppProps) {
return (
<SessionProvider session={pageProps.session}>
<Layout>

View file

@ -1,11 +1,12 @@
//Lib
import { authOptions } from '../pages/api/auth/[...nextauth]';
import { authOptions } from './api/auth/[...nextauth]';
import { getServerSession } from 'next-auth/next';
import { useSession } from 'next-auth/react';
import Head from 'next/head';
//Lib
import RepoList from '../Containers/RepoList/RepoList';
import { GetServerSidePropsContext } from 'next';
export default function Index() {
const { status } = useSession();
@ -30,7 +31,7 @@ export default function Index() {
);
}
export async function getServerSideProps(context) {
export async function getServerSideProps(context: GetServerSidePropsContext) {
//Var
const session = await getServerSession(context.req, context.res, authOptions);