From 0f18c82eaf62c1f782d26c8dbfb3cf619611aa31 Mon Sep 17 00:00:00 2001 From: lenisko <10072920+lenisko@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:16:14 +0100 Subject: [PATCH] feat: add support for empty secret --- server/api/src/utils/auth.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/api/src/utils/auth.rs b/server/api/src/utils/auth.rs index b6dbc582..8acc89f3 100644 --- a/server/api/src/utils/auth.rs +++ b/server/api/src/utils/auth.rs @@ -25,6 +25,9 @@ pub async fn public_validator( if logged_in(&req) { return Ok(req); } + if env::var("KOJI_SECRET").unwrap_or("".to_string()).is_empty() { + return Ok(req); + } if let Some(credentials) = credentials { if credentials.token() == env::var("KOJI_SECRET").unwrap_or("".to_string()) { return Ok(req);