Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Added option to disable login. Closes #948

Mike Cao8e350a20561b
diff --git a/next.config.js b/next.config.js
index 5ececa1dc..cdeb51d75 100644
--- a/next.config.js
+++ b/next.config.js
@@ -5,6 +5,7 @@ module.exports = {
env: {
VERSION: pkg.version,
FORCE_SSL: !!process.env.FORCE_SSL,
+ DISABLE_LOGIN: !!process.env.DISABLE_LOGIN,
},
basePath: process.env.BASE_PATH,
eslint: {
diff --git a/pages/login.js b/pages/login.js
index cf976eca2..d975e3c77 100644
--- a/pages/login.js
+++ b/pages/login.js
@@ -3,6 +3,10 @@ import Layout from 'components/layout/Layout';
import LoginForm from 'components/forms/LoginForm';
export default function LoginPage() {
+ if (process.env.DISABLE_LOGIN) {
+ return null;
+ }
+
return (
<Layout title="login" header={false} footer={false} center>
<LoginForm />