⬆️ v3.0.0 (#704)

This commit is contained in:
Luke Vella 2023-06-19 17:17:00 +01:00 committed by GitHub
parent 735056f25f
commit c22b3abc4d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
385 changed files with 19912 additions and 5250 deletions

View file

@ -69,21 +69,3 @@ export const withAuth: GetServerSideProps = async (ctx) => {
return { props: {} };
};
/**
* Require user to be logged in if AUTH_REQUIRED is true
* @returns
*/
export const withAuthIfRequired: GetServerSideProps = async (ctx) => {
if (process.env.AUTH_REQUIRED === "true") {
if (!ctx.req.session.user || ctx.req.session.user.isGuest) {
return {
redirect: {
destination: "/login",
permanent: false,
},
};
}
}
return { props: {} };
};