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