From bea6cf29c227abb520f33cccea94a4dcc6247819 Mon Sep 17 00:00:00 2001 From: MkSavin Date: Tue, 11 Mar 2025 01:36:43 +0300 Subject: [PATCH] fix(auth): Added trimming to jwt secret token read from .jwt_secret (#16467) Added cleaning of leading and trailing spaces and special characters from a line when reading a secret token from a `.jwt_secret` file --- frigate/api/auth.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frigate/api/auth.py b/frigate/api/auth.py index 91ca5e729..c0ed94d5c 100644 --- a/frigate/api/auth.py +++ b/frigate/api/auth.py @@ -136,7 +136,7 @@ def get_jwt_secret() -> str: logger.debug("Using jwt secret from .jwt_secret file in config directory.") with open(jwt_secret_file) as f: try: - jwt_secret = f.readline() + jwt_secret = f.readline().strip() except Exception: logger.warning( "Unable to read jwt token from .jwt_secret file in config directory. A new jwt token will be created at each startup."