mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Moved DISABLE_LOGIN check to getServerSideProps.
This commit is contained in:
parent
ab1e49e703
commit
68d35c0fc4
2 changed files with 8 additions and 5 deletions
|
|
@ -2,8 +2,8 @@ import React from 'react';
|
|||
import Layout from 'components/layout/Layout';
|
||||
import LoginForm from 'components/forms/LoginForm';
|
||||
|
||||
export default function LoginPage() {
|
||||
if (process.env.loginDisabled) {
|
||||
export default function LoginPage({ loginDisabled }) {
|
||||
if (loginDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -13,3 +13,9 @@ export default function LoginPage() {
|
|||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export async function getServerSideProps() {
|
||||
return {
|
||||
props: { loginDisabled: !!process.env.DISABLE_LOGIN },
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue