mirror of
https://github.com/Ravinou/borgwarehouse
synced 2026-03-14 14:25:46 +01:00
refactor: ⚡ _app, 404 and index
This commit is contained in:
parent
0c4d5a898b
commit
d7bd79b5b4
3 changed files with 5 additions and 3 deletions
|
|
@ -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>
|
||||
|
|
@ -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);
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue