Commit df7a3bfa authored by isstuev's avatar isstuev

hide login page if no proxy needed

parent 9cdbf6d6
import type { GetServerSideProps } from 'next'; import type { GetServerSideProps } from 'next';
import config from 'configs/app'; import config from 'configs/app';
import isNeedProxy from 'lib/api/isNeedProxy';
const rollupFeature = config.features.rollup; const rollupFeature = config.features.rollup;
export type Props = { export type Props = {
...@@ -201,3 +202,14 @@ export const gasTracker: GetServerSideProps<Props> = async(context) => { ...@@ -201,3 +202,14 @@ export const gasTracker: GetServerSideProps<Props> = async(context) => {
return base(context); return base(context);
}; };
export const login: GetServerSideProps<Props> = async(context) => {
if (!isNeedProxy()) {
return {
notFound: true,
};
}
return base(context);
};
...@@ -15,4 +15,4 @@ const Page: NextPage = () => { ...@@ -15,4 +15,4 @@ const Page: NextPage = () => {
export default Page; export default Page;
export { base as getServerSideProps } from 'nextjs/getServerSideProps'; export { login as getServerSideProps } from 'nextjs/getServerSideProps';
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment