PR Feedback
This commit is contained in:
parent
a61cf5fa45
commit
6f24772f49
|
@ -12,7 +12,6 @@
|
||||||
export let samePage
|
export let samePage
|
||||||
|
|
||||||
$: show = $organisation.oidc
|
$: show = $organisation.oidc
|
||||||
$: oidcLogoCheck = $oidc.logo
|
|
||||||
|
|
||||||
let preDefinedIcons = {
|
let preDefinedIcons = {
|
||||||
Oidc: OidcLogo,
|
Oidc: OidcLogo,
|
||||||
|
@ -30,14 +29,13 @@
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
$: src = !oidcLogoCheck
|
$: oidcLogoImageURL = preDefinedIcons[$oidc.logo] ?? $oidc.logo
|
||||||
? OidcLogo
|
$: logoSrc = oidcLogoImageURL ?? OidcLogo
|
||||||
: preDefinedIcons[$oidc.logo] || oidcLogoCheck
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
{#if show}
|
{#if show}
|
||||||
<FancyButton
|
<FancyButton
|
||||||
icon={src}
|
icon={logoSrc}
|
||||||
on:click={() => {
|
on:click={() => {
|
||||||
const url = `/api/global/auth/${$auth.tenantId}/oidc/configs/${$oidc.uuid}`
|
const url = `/api/global/auth/${$auth.tenantId}/oidc/configs/${$oidc.uuid}`
|
||||||
if (samePage) {
|
if (samePage) {
|
||||||
|
|
|
@ -327,23 +327,21 @@ export async function find(ctx: UserCtx) {
|
||||||
export async function publicOidc(ctx: Ctx<void, GetPublicOIDCConfigResponse>) {
|
export async function publicOidc(ctx: Ctx<void, GetPublicOIDCConfigResponse>) {
|
||||||
try {
|
try {
|
||||||
// Find the config with the most granular scope based on context
|
// Find the config with the most granular scope based on context
|
||||||
const config = await configs.getOIDCConfig()
|
const oidcConfig = await configs.getOIDCConfig()
|
||||||
const oidcLogoConfig = await configs.getOIDCLogosDoc()
|
const oidcCustomLogos = await configs.getOIDCLogosDoc()
|
||||||
|
|
||||||
if (oidcLogoConfig) {
|
if (oidcCustomLogos) {
|
||||||
enrichOIDCLogos(oidcLogoConfig)
|
enrichOIDCLogos(oidcCustomLogos)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!config) {
|
if (!oidcConfig) {
|
||||||
ctx.body = []
|
ctx.body = []
|
||||||
} else {
|
} else {
|
||||||
ctx.body = [
|
ctx.body = [
|
||||||
{
|
{
|
||||||
logo: oidcLogoConfig
|
logo: oidcCustomLogos?.config[oidcConfig.logo] ?? oidcConfig.logo,
|
||||||
? oidcLogoConfig.config[config.logo]
|
name: oidcConfig.name,
|
||||||
: config.logo,
|
uuid: oidcConfig.uuid,
|
||||||
name: config.name,
|
|
||||||
uuid: config.uuid,
|
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue