hide login page if no proxy needed

This commit is contained in:
isstuev
2024-03-26 15:05:16 +04:00
parent 322e8bc4bd
commit f9606031e8
2 changed files with 13 additions and 1 deletions
+12
View File
@@ -1,6 +1,7 @@
import type { GetServerSideProps } from 'next';
import config from 'configs/app';
import isNeedProxy from 'lib/api/isNeedProxy';
const rollupFeature = config.features.rollup;
export type Props = {
@@ -201,3 +202,14 @@ export const gasTracker: GetServerSideProps<Props> = async(context) => {
return base(context);
};
export const login: GetServerSideProps<Props> = async(context) => {
if (!isNeedProxy()) {
return {
notFound: true,
};
}
return base(context);
};
+1 -1
View File
@@ -15,4 +15,4 @@ const Page: NextPage = () => {
export default Page;
export { base as getServerSideProps } from 'nextjs/getServerSideProps';
export { login as getServerSideProps } from 'nextjs/getServerSideProps';