From e0f0a9d87389a0f35d0a7c8132db631c0aca5a9c Mon Sep 17 00:00:00 2001 From: Zhuoyun Wei Date: Sun, 9 Jul 2023 18:51:08 -0700 Subject: [PATCH] fix: turn off auth if not defined --- ash.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ash.py b/ash.py index 289be7e..769358e 100644 --- a/ash.py +++ b/ash.py @@ -59,9 +59,11 @@ class DefaultConfig: @auth.verify_password def verify_password(username, password): - db = app.config.get('T_SEARCH_BASIC_AUTH', {}) - if username == db.get('username') and password == db.get('password'): - return username + if db := app.config.get('T_SEARCH_BASIC_AUTH', {}): + if username == db.get('username') and password == db.get('password'): + return True + else: + return True return False