import nookies from 'nookies';
import { firebaseAdmin } from "../firebaseAdmin";
import { TChildren } from "../types/app/app.types";
interface Props {
children: TChildren;
}
export default function ProtectedRoute(props: Props): JSX.Element {
return <>
{props.children}
</>
}
export const getServerSideProps = async (ctx: GetServerSidePropsContext) => {
const cookies = nookies.get(ctx);
const data = await firebaseAdmin.auth().verifyIdToken(cookies.token);
console.log(data);
return {
props: { message: `Your email is .` },
};
};
await firebaseAdmin.auth().verifyIdToken throws error module not found: can't resolve fs, How to fix this error?
I know that we have different types of runtime environments like edge, browser nodeJs, but based of the docs and examples getServerSide Props runs on nodeJs environment which means that I shouldn't get this kind of error...