Commit 7a9736a0 authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #1748 from blockscout/no-login-page

hide login page if no proxy needed
parents cc9cb368 df7a3bfa
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