Handle case where native auth is not enabled

This commit is contained in:
Nicolas Mowen 2024-07-22 14:17:30 -06:00
parent d0e46b3ce8
commit 7e55af7d87

View File

@ -39,7 +39,11 @@ def get_vapid_pub_key():
@NotificationBp.route("/notifications/register", methods=["POST"])
def register_notifications():
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")