Skip to content

Commit

Permalink
fix: turn off auth if not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
wzyboy committed Jul 10, 2023
1 parent cfecf3a commit e0f0a9d
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ash.py
Expand Up @@ -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


Expand Down

0 comments on commit e0f0a9d

Please sign in to comment.