From e4d8ee09416babc8b2251069effa365042477765 Mon Sep 17 00:00:00 2001 From: Jared Vititoe Date: Fri, 7 Feb 2025 22:17:27 -0500 Subject: [PATCH] Bearer token --- app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index a135f16..de53964 100644 --- a/app.py +++ b/app.py @@ -51,7 +51,10 @@ class UnifiAPI: self.site_id = config['unifi']['site_id'] self.session = requests.Session() self.session.verify = False - self.login() + self.headers = { + 'Authorization': f'Bearer {self.api_key}', + 'Accept': 'application/json' + } def login(self): """Login to UDM Pro using the API key"""