From 7e55af7d87dabd817c1efa37e42736b286f6e8bd Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 22 Jul 2024 14:17:30 -0600 Subject: [PATCH] Handle case where native auth is not enabled --- frigate/api/notification.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frigate/api/notification.py b/frigate/api/notification.py index d35ab5588..2fe61882f 100644 --- a/frigate/api/notification.py +++ b/frigate/api/notification.py @@ -39,7 +39,11 @@ def get_vapid_pub_key(): @NotificationBp.route("/notifications/register", methods=["POST"]) def register_notifications(): - username = request.headers.get("remote-user", type=str) or "admin" + if current_app.frigate_config.auth.enabled: + username = request.headers.get("remote-user", type=str) or "admin" + else: + username = "admin" + json: dict[str, any] = request.get_json(silent=True) or {} sub = json.get("sub")