From a840cb0800e6ce6c507889e1e693e4d9dcb5c87a Mon Sep 17 00:00:00 2001 From: Michael Genson <71845777+michael-genson@users.noreply.github.com> Date: Thu, 25 Jan 2024 19:10:21 +0000 Subject: [PATCH] patch missing client for testing --- mealie/routes/auth/auth.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mealie/routes/auth/auth.py b/mealie/routes/auth/auth.py index 080b68f80f93..8aa6cd6664c8 100644 --- a/mealie/routes/auth/auth.py +++ b/mealie/routes/auth/auth.py @@ -67,7 +67,8 @@ def get_token( if "," in ip: # if there are multiple IPs, the first one is canonically the true client ip = str(ip.split(",")[0]) else: - ip = request.client.host + # request.client should never be null, except sometimes during testing + ip = request.client.host if request.client else "unknown" try: user = authenticate_user(session, email, password) # type: ignore