import { getSession, useSession } from 'next-auth/react'; import ProfileCard from '../../components/cards/profile-card/ProfileCard'; import { LOGIN_PAGE } from '../../constants/pages'; const ProfilePage = () => { const { data: session } = useSession(); return ; }; export async function getServerSideProps(context) { const session = await getSession({ req: context.req }); if (!session) { return { redirect: { destination: LOGIN_PAGE, permanent: false, }, }; } return { props: { session }, }; } export default ProfilePage;