From 42eda69fbe96ddb4adc0d50bf4fd885094a24ec6 Mon Sep 17 00:00:00 2001 From: Alican Erdurmaz Date: Mon, 22 Jan 2024 14:33:34 +0300 Subject: [PATCH] Revert "chore: test CI should fail" This reverts commit 27b6d577ceb36d25207c0f129f0194b80b7c1bfe. --- .../antd-example/pages/blog-posts/index.tsx | 80 +++++++++---------- 1 file changed, 40 insertions(+), 40 deletions(-) diff --git a/refine-nextjs/plugins/antd-example/pages/blog-posts/index.tsx b/refine-nextjs/plugins/antd-example/pages/blog-posts/index.tsx index 92839535..ad73bba2 100644 --- a/refine-nextjs/plugins/antd-example/pages/blog-posts/index.tsx +++ b/refine-nextjs/plugins/antd-example/pages/blog-posts/index.tsx @@ -127,49 +127,49 @@ export default function BlogPostList() { ); }; -// export const getServerSideProps: GetServerSideProps<{}> = async (context) => { -// <%_ if (_app.isNextAuthCheck) { _%> -// const session = await getServerSession( -// context.req, -// context.res, -// authOptions, -// ); -// <%_ } _%> +export const getServerSideProps: GetServerSideProps<{}> = async (context) => { + <%_ if (_app.isNextAuthCheck) { _%> + const session = await getServerSession( + context.req, + context.res, + authOptions, + ); + <%_ } _%> -// <%_ if (_app.isAuthProviderCheck) { _%> -// const { authenticated, redirectTo } = await authProvider.check(context); -// <%_ } _%> + <%_ if (_app.isAuthProviderCheck) { _%> + const { authenticated, redirectTo } = await authProvider.check(context); + <%_ } _%> -// <%_ if (_app.isNextAuthCheck) { _%> -// if (!session) { -// return { -// props: { -// }, -// redirect: { -// destination: `/login?to=${encodeURIComponent("/blog-posts")}`, -// permanent: false, -// }, -// }; -// } -// <%_ } _%> + <%_ if (_app.isNextAuthCheck) { _%> + if (!session) { + return { + props: { + }, + redirect: { + destination: `/login?to=${encodeURIComponent("/blog-posts")}`, + permanent: false, + }, + }; + } + <%_ } _%> -// <%_ if (_app.isAuthProviderCheck) { _%> -// if (!authenticated) { -// return { -// props: { + <%_ if (_app.isAuthProviderCheck) { _%> + if (!authenticated) { + return { + props: { -// }, -// redirect: { -// destination: `${redirectTo}?to=${encodeURIComponent("/blog-posts")}`, -// permanent: false, -// }, -// }; -// } -// <%_ } _%> + }, + redirect: { + destination: `${redirectTo}?to=${encodeURIComponent("/blog-posts")}`, + permanent: false, + }, + }; + } + <%_ } _%> -// return { -// props: { + return { + props: { -// }, -// }; -// }; \ No newline at end of file + }, + }; +}; \ No newline at end of file