forked from github-starred/komodo
Compare commits
6 Commits
copilot/se
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ae0c8bf98a | ||
|
|
a7592f4561 | ||
|
|
a199c8fe27 | ||
| f7296c73b1 | |||
|
|
0eaf8b5f01 | ||
|
|
6919582f69 |
@@ -1,4 +1,4 @@
|
|||||||
use std::{sync::OnceLock, time::Instant};
|
use std::time::Instant;
|
||||||
|
|
||||||
use axum::{Router, extract::Path, http::HeaderMap, routing::post};
|
use axum::{Router, extract::Path, http::HeaderMap, routing::post};
|
||||||
use derive_variants::{EnumVariants, ExtractVariant};
|
use derive_variants::{EnumVariants, ExtractVariant};
|
||||||
@@ -108,11 +108,7 @@ async fn handler(
|
|||||||
res.map(|res| res.0)
|
res.map(|res| res.0)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn login_options_reponse() -> &'static GetLoginOptionsResponse {
|
fn login_options_response() -> GetLoginOptionsResponse {
|
||||||
static GET_LOGIN_OPTIONS_RESPONSE: OnceLock<
|
|
||||||
GetLoginOptionsResponse,
|
|
||||||
> = OnceLock::new();
|
|
||||||
GET_LOGIN_OPTIONS_RESPONSE.get_or_init(|| {
|
|
||||||
let config = core_config();
|
let config = core_config();
|
||||||
GetLoginOptionsResponse {
|
GetLoginOptionsResponse {
|
||||||
local: config.local_auth,
|
local: config.local_auth,
|
||||||
@@ -121,7 +117,6 @@ fn login_options_reponse() -> &'static GetLoginOptionsResponse {
|
|||||||
oidc: oidc_client().load().is_some(),
|
oidc: oidc_client().load().is_some(),
|
||||||
registration_disabled: config.disable_user_registration,
|
registration_disabled: config.disable_user_registration,
|
||||||
}
|
}
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Resolve<AuthArgs> for GetLoginOptions {
|
impl Resolve<AuthArgs> for GetLoginOptions {
|
||||||
@@ -130,7 +125,7 @@ impl Resolve<AuthArgs> for GetLoginOptions {
|
|||||||
self,
|
self,
|
||||||
_: &AuthArgs,
|
_: &AuthArgs,
|
||||||
) -> serror::Result<GetLoginOptionsResponse> {
|
) -> serror::Result<GetLoginOptionsResponse> {
|
||||||
Ok(*login_options_reponse())
|
Ok(login_options_response())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -266,12 +266,7 @@ export const BuildConfig = ({
|
|||||||
|
|
||||||
{image_registries?.map((registry, index) => (
|
{image_registries?.map((registry, index) => (
|
||||||
<ImageRegistryConfig
|
<ImageRegistryConfig
|
||||||
key={
|
key={index}
|
||||||
(registry.domain ?? "") +
|
|
||||||
(registry.organization ?? "") +
|
|
||||||
(registry.account ?? "") +
|
|
||||||
index
|
|
||||||
}
|
|
||||||
registry={registry}
|
registry={registry}
|
||||||
imageName={imageName}
|
imageName={imageName}
|
||||||
setRegistry={(registry) =>
|
setRegistry={(registry) =>
|
||||||
|
|||||||
@@ -123,6 +123,7 @@ export const useLoginOptions = () => {
|
|||||||
return useQuery({
|
return useQuery({
|
||||||
queryKey: ["GetLoginOptions"],
|
queryKey: ["GetLoginOptions"],
|
||||||
queryFn: () => komodo_client().auth("GetLoginOptions", {}),
|
queryFn: () => komodo_client().auth("GetLoginOptions", {}),
|
||||||
|
refetchInterval: 30_000,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user