mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 07:07:17 +01:00
Fix disable checks.
This commit is contained in:
parent
98835bbc78
commit
246e4e5f4f
4 changed files with 10 additions and 10 deletions
|
|
@ -24,7 +24,7 @@ export default function App({ Component, pageProps }) {
|
|||
const { basePath } = useRouter();
|
||||
const { dir } = useLocale();
|
||||
|
||||
if (!process.env.uiDisabled) {
|
||||
if (process.env.uiDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,10 @@
|
|||
import React from 'react';
|
||||
import { useRouter } from 'next/router';
|
||||
import Layout from 'components/layout/Layout';
|
||||
import Dashboard from 'components/pages/Dashboard';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
import { useRouter } from 'next/router';
|
||||
import useUser from 'hooks/useUser';
|
||||
import useConfig from 'hooks/useConfig';
|
||||
|
||||
export default function DashboardPage() {
|
||||
const {
|
||||
|
|
@ -13,8 +14,9 @@ export default function DashboardPage() {
|
|||
} = useRouter();
|
||||
const { loading } = useRequireLogin();
|
||||
const user = useUser();
|
||||
const { adminDisabled } = useConfig();
|
||||
|
||||
if (!user || !isReady || loading) {
|
||||
if (adminDisabled || !user || !isReady || loading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ export default function LoginPage({ pageDisabled }) {
|
|||
export async function getServerSideProps() {
|
||||
return {
|
||||
props: {
|
||||
pageDisabled: !!(process.env.DISABLE_LOGIN || process.env.DISABLE_ADMIN),
|
||||
pageDisabled: !!process.env.DISABLE_LOGIN,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue