From d0d1673cccac3d75edf42a8ae617cfecfac864c6 Mon Sep 17 00:00:00 2001 From: Yifei Zhang Date: Sun, 26 Mar 2023 07:06:06 +0000 Subject: [PATCH] fixup: disable access control when CODE is empty --- app/components/settings.tsx | 30 +++++++++++++++++------------- middleware.ts | 2 +- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/app/components/settings.tsx b/app/components/settings.tsx index ec22a1ab..a0a477af 100644 --- a/app/components/settings.tsx +++ b/app/components/settings.tsx @@ -239,19 +239,23 @@ export function Settings(props: { closeSettings: () => void }) { - - { - accessStore.updateCode(e.currentTarget.value); - }} - > - + {enabledAccessControl ? ( + + { + accessStore.updateCode(e.currentTarget.value); + }} + > + + ) : ( + <> + )} 0 && !ACCESS_CODES.has(hashedCode)) { return NextResponse.json( { needAccessCode: true,