Compare commits

..

1 Commits

Author SHA1 Message Date
copilot-swe-agent[bot]
a316661024 Initial plan 2025-11-18 06:41:38 +00:00
3 changed files with 22 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
use std::time::Instant;
use std::{sync::OnceLock, time::Instant};
use axum::{Router, extract::Path, http::HeaderMap, routing::post};
use derive_variants::{EnumVariants, ExtractVariant};
@@ -108,15 +108,20 @@ async fn handler(
res.map(|res| res.0)
}
fn login_options_response() -> GetLoginOptionsResponse {
let config = core_config();
GetLoginOptionsResponse {
local: config.local_auth,
github: github_oauth_client().is_some(),
google: google_oauth_client().is_some(),
oidc: oidc_client().load().is_some(),
registration_disabled: config.disable_user_registration,
}
fn login_options_reponse() -> &'static GetLoginOptionsResponse {
static GET_LOGIN_OPTIONS_RESPONSE: OnceLock<
GetLoginOptionsResponse,
> = OnceLock::new();
GET_LOGIN_OPTIONS_RESPONSE.get_or_init(|| {
let config = core_config();
GetLoginOptionsResponse {
local: config.local_auth,
github: github_oauth_client().is_some(),
google: google_oauth_client().is_some(),
oidc: oidc_client().load().is_some(),
registration_disabled: config.disable_user_registration,
}
})
}
impl Resolve<AuthArgs> for GetLoginOptions {
@@ -125,7 +130,7 @@ impl Resolve<AuthArgs> for GetLoginOptions {
self,
_: &AuthArgs,
) -> serror::Result<GetLoginOptionsResponse> {
Ok(login_options_response())
Ok(*login_options_reponse())
}
}

View File

@@ -266,7 +266,12 @@ export const BuildConfig = ({
{image_registries?.map((registry, index) => (
<ImageRegistryConfig
key={index}
key={
(registry.domain ?? "") +
(registry.organization ?? "") +
(registry.account ?? "") +
index
}
registry={registry}
imageName={imageName}
setRegistry={(registry) =>

View File

@@ -123,7 +123,6 @@ export const useLoginOptions = () => {
return useQuery({
queryKey: ["GetLoginOptions"],
queryFn: () => komodo_client().auth("GetLoginOptions", {}),
refetchInterval: 30_000,
});
};