Skip to content

Commit eae0ac3

Browse files
committed
[app] Allow empty secret key if auth disabled (#234)
1 parent f42f314 commit eae0ac3

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

gramps_webapi/app.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,10 @@ def create_app(db_manager=None):
5959
if not app.config.get("TREE"):
6060
raise ValueError("TREE must be specified")
6161

62-
# if secret key is missing, try to get it from the env or fail
62+
# if secret key is missing, try to get it from the env
6363
app.config["SECRET_KEY"] = app.config["SECRET_KEY"] or os.getenv("SECRET_KEY")
64-
if not app.config.get("SECRET_KEY"):
64+
# still not found? Fail, unless auth is disabled
65+
if not app.config.get("SECRET_KEY") and not app.config.get("DISABLE_AUTH"):
6566
raise ValueError("SECRET_KEY must be specified")
6667

6768
# try setting media basedir from environment

0 commit comments

Comments
 (0)