NextJSNetflix/pages/profiles.tsx

27 lines
519 B
TypeScript
Raw Normal View History

2023-06-04 12:33:10 +00:00
import { NextPageContext } from "next"
import { getSession } from "next-auth/react"
export async function getServerSideProps(context: NextPageContext){
const session = await getSession(context);
if(!session){
return{
redirect: {
destination: '/auth',
permanent: false
}
}
}
return {
props: {}
}
}
function Profiles() {
return (
<div className="text-white text-4xl">Profili</div>
)
}
export default Profiles