diff options
Diffstat (limited to 'src/zenhttp/httpclientauth.cpp')
| -rw-r--r-- | src/zenhttp/httpclientauth.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/zenhttp/httpclientauth.cpp b/src/zenhttp/httpclientauth.cpp index 4438fc137..8754c57d6 100644 --- a/src/zenhttp/httpclientauth.cpp +++ b/src/zenhttp/httpclientauth.cpp @@ -94,7 +94,8 @@ namespace zen { namespace httpclientauth { static HttpClientAccessToken GetOidcTokenFromExe(const std::filesystem::path& OidcExecutablePath, std::string_view CloudHost, bool Unattended, - bool Quiet) + bool Quiet, + bool Hidden) { Stopwatch Timer; @@ -103,6 +104,10 @@ namespace zen { namespace httpclientauth { { ProcOptions.StdoutFile = std::filesystem::temp_directory_path() / fmt::format(".zen-auth-output-{}", Oid::NewOid()); } + if (Hidden) + { + ProcOptions.Flags |= CreateProcOptions::Flag_NoConsole; + } const std::filesystem::path AuthTokenPath(std::filesystem::temp_directory_path() / fmt::format(".zen-auth-{}", Oid::NewOid())); auto _ = MakeGuard([AuthTokenPath, &ProcOptions]() { @@ -181,14 +186,16 @@ namespace zen { namespace httpclientauth { std::optional<std::function<HttpClientAccessToken()>> CreateFromOidcTokenExecutable(const std::filesystem::path& OidcExecutablePath, std::string_view CloudHost, bool Quiet, - bool Unattended) + bool Unattended, + bool Hidden) { - HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet); + HttpClientAccessToken InitialToken = GetOidcTokenFromExe(OidcExecutablePath, CloudHost, Unattended, Quiet, Hidden); if (InitialToken.IsValid()) { return [OidcExecutablePath = std::filesystem::path(OidcExecutablePath), CloudHost = std::string(CloudHost), Quiet, + Hidden, InitialToken]() mutable { if (InitialToken.IsValid()) { @@ -196,7 +203,7 @@ namespace zen { namespace httpclientauth { InitialToken = {}; return Result; } - return GetOidcTokenFromExe(OidcExecutablePath, CloudHost, /* Unattended */ true, Quiet); + return GetOidcTokenFromExe(OidcExecutablePath, CloudHost, /* Unattended */ true, Quiet, Hidden); }; } return {}; |