mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Removed DISABLE_LOGIN from middleware.
This commit is contained in:
parent
0f37c17cb5
commit
5a5a278d9e
4 changed files with 5 additions and 11 deletions
|
|
@ -15,13 +15,6 @@ function customScriptName(req) {
|
|||
}
|
||||
}
|
||||
|
||||
function disableLogin(req) {
|
||||
console.log(process.env, process.env.DISABLE_LOGIN);
|
||||
if (process.env.DISABLE_LOGIN && req.nextUrl.pathname.endsWith('/login')) {
|
||||
return new Response('Login is disabled', { status: 403 });
|
||||
}
|
||||
}
|
||||
|
||||
function forceSSL(req, res) {
|
||||
if (process.env.FORCE_SSL && req.nextUrl.protocol === 'http:') {
|
||||
res.headers.set('Strict-Transport-Security', 'max-age=31536000; includeSubDomains');
|
||||
|
|
@ -31,7 +24,7 @@ function forceSSL(req, res) {
|
|||
}
|
||||
|
||||
export function middleware(req) {
|
||||
const fns = [customScriptName, disableLogin];
|
||||
const fns = [customScriptName];
|
||||
|
||||
for (const fn of fns) {
|
||||
const res = fn(req);
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import Layout from 'components/layout/Layout';
|
|||
import LoginForm from 'components/forms/LoginForm';
|
||||
|
||||
export default function LoginPage() {
|
||||
if (process.env.DISABLE_LOGIN) {
|
||||
if (process.env.loginDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue