Improved the overall stability and speed of the app
This commit is contained in:
@@ -5,6 +5,7 @@ import {sessionOptions} from "@/lib/session";
|
||||
import {shouldRedirectHome} from "@/utils/navigation.disabled";
|
||||
import ExamPage from "./(exam)/ExamPage";
|
||||
import Head from "next/head";
|
||||
import {User} from "@/interfaces/user";
|
||||
|
||||
export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
const user = req.session.user;
|
||||
@@ -14,7 +15,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
redirect: {
|
||||
destination: "/login",
|
||||
permanent: false,
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -23,7 +24,7 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
redirect: {
|
||||
destination: "/",
|
||||
permanent: false,
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -32,7 +33,11 @@ export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
};
|
||||
}, sessionOptions);
|
||||
|
||||
export default function Page() {
|
||||
interface Props {
|
||||
user: User;
|
||||
}
|
||||
|
||||
export default function Page({user}: Props) {
|
||||
return (
|
||||
<>
|
||||
<Head>
|
||||
@@ -44,7 +49,7 @@ export default function Page() {
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<link rel="icon" href="/favicon.ico" />
|
||||
</Head>
|
||||
<ExamPage page="exams" />
|
||||
<ExamPage page="exams" user={user} />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user