PR Feedback

This commit is contained in:
Dean 2023-06-23 16:40:40 +01:00
parent a61cf5fa45
commit 6f24772f49
2 changed files with 11 additions and 15 deletions

View File

@ -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) {

View File

@ -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,
},
]
}