From 8198000980182aecb9be1ea8018c2d3b36e56eb2 Mon Sep 17 00:00:00 2001 From: Nathan Miller Date: Mon, 22 Apr 2024 10:21:32 -0700 Subject: [PATCH] use default un/pw if none supplied in environment --- OdbDesignLib/App/BasicRequestAuthentication.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/OdbDesignLib/App/BasicRequestAuthentication.cpp b/OdbDesignLib/App/BasicRequestAuthentication.cpp index 3e2d4abd..aa1ff4cc 100644 --- a/OdbDesignLib/App/BasicRequestAuthentication.cpp +++ b/OdbDesignLib/App/BasicRequestAuthentication.cpp @@ -41,10 +41,18 @@ namespace Odb::Lib::App { // 500 - Internal Server Error auto validUsername = std::getenv(USERNAME_ENV_NAME); - if (validUsername == nullptr) return crow::response(500, "Failed retrieving credentials"); + if (validUsername == nullptr) //return crow::response(500, "Failed retrieving credentials"); + { + // default username if none supplied in environment + validUsername = "odb"; + } auto validPassword = std::getenv(PASSWORD_ENV_NAME); - if (validPassword == nullptr) return crow::response(500, "Failed retrieving credentials"); + if (validPassword == nullptr) //return crow::response(500, "Failed retrieving credentials"); + { + // default password if none supplied in environment + validPassword = "plusplus"; + } // 403 - Forbidden if (username != validUsername ||