mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 07:25:48 +01:00
🚑 Merge pull request #301 from ajnart/dev
🚑 Hotfix Docker image with new NextJS version
This commit is contained in:
@@ -3,13 +3,13 @@ import type { NextRequest } from 'next/server';
|
||||
|
||||
// eslint-disable-next-line consistent-return
|
||||
export function middleware(request: NextRequest) {
|
||||
const cookie = request.cookies.get('password');
|
||||
const isPasswordCorrect = cookie === process.env.PASSWORD;
|
||||
if (
|
||||
!isPasswordCorrect &&
|
||||
request.nextUrl.pathname !== '/login' &&
|
||||
request.nextUrl.pathname !== '/api/configs/trylogin'
|
||||
) {
|
||||
return NextResponse.rewrite(new URL('/login', request.url));
|
||||
}
|
||||
// const cookie = request.cookies.get('password');
|
||||
// const isPasswordCorrect = cookie === process.env.PASSWORD;
|
||||
// if (
|
||||
// !isPasswordCorrect &&
|
||||
// request.nextUrl.pathname !== '/login' &&
|
||||
// request.nextUrl.pathname !== '/api/configs/trylogin'
|
||||
// ) {
|
||||
// return NextResponse.redirect('/login');
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user