1
0
Fork 0
mirror of synced 2024-07-04 22:11:23 +12:00

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

View file

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