Commit 8b087e48 authored by tom's avatar tom

404 for account pages if envs are not provided

parent 49c2f9df
import appConfig from 'configs/app/config';
import { getServerSideProps as base } from '../getServerSideProps';
export const getServerSideProps: typeof base = async(...args) => {
if (!appConfig.isAccountSupported) {
return {
notFound: true,
};
}
return base(...args);
};
export const getServerSidePropsForVerifiedAddresses: typeof base = async(...args) => {
if (!appConfig.isAccountSupported || !appConfig.adminServiceApi.endpoint || !appConfig.contractInfoApi.endpoint) {
return {
notFound: true,
};
}
return base(...args);
};
...@@ -17,4 +17,4 @@ const ApiKeysPage: NextPage = () => { ...@@ -17,4 +17,4 @@ const ApiKeysPage: NextPage = () => {
export default ApiKeysPage; export default ApiKeysPage;
export { getServerSideProps } from 'lib/next/getServerSideProps'; export { getServerSideProps } from 'lib/next/account/getServerSideProps';
...@@ -17,4 +17,4 @@ const CustomAbiPage: NextPage = () => { ...@@ -17,4 +17,4 @@ const CustomAbiPage: NextPage = () => {
export default CustomAbiPage; export default CustomAbiPage;
export { getServerSideProps } from 'lib/next/getServerSideProps'; export { getServerSideProps } from 'lib/next/account/getServerSideProps';
...@@ -17,4 +17,4 @@ const PublicTagsPage: NextPage = () => { ...@@ -17,4 +17,4 @@ const PublicTagsPage: NextPage = () => {
export default PublicTagsPage; export default PublicTagsPage;
export { getServerSideProps } from 'lib/next/getServerSideProps'; export { getServerSideProps } from 'lib/next/account/getServerSideProps';
...@@ -17,4 +17,4 @@ const AddressTagsPage: NextPage = () => { ...@@ -17,4 +17,4 @@ const AddressTagsPage: NextPage = () => {
export default AddressTagsPage; export default AddressTagsPage;
export { getServerSideProps } from 'lib/next/getServerSideProps'; export { getServerSideProps } from 'lib/next/account/getServerSideProps';
...@@ -17,4 +17,4 @@ const VerifiedAddressesPage: NextPage = () => { ...@@ -17,4 +17,4 @@ const VerifiedAddressesPage: NextPage = () => {
export default VerifiedAddressesPage; export default VerifiedAddressesPage;
export { getServerSideProps } from 'lib/next/getServerSideProps'; export { getServerSidePropsForVerifiedAddresses as getServerSideProps } from 'lib/next/account/getServerSideProps';
...@@ -19,4 +19,4 @@ const WatchListPage: NextPage = () => { ...@@ -19,4 +19,4 @@ const WatchListPage: NextPage = () => {
export default WatchListPage; export default WatchListPage;
export { getServerSideProps } from 'lib/next/getServerSideProps'; export { getServerSideProps } from 'lib/next/account/getServerSideProps';
...@@ -15,4 +15,4 @@ const MyProfilePage: NextPage = () => { ...@@ -15,4 +15,4 @@ const MyProfilePage: NextPage = () => {
export default MyProfilePage; export default MyProfilePage;
export { getServerSideProps } from 'lib/next/getServerSideProps'; export { getServerSideProps } from 'lib/next/account/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