Fix OIDC logo conditional display

This commit is contained in:
Peter Clement 2021-07-09 15:50:46 +01:00
parent 90e6db2be1
commit de075a7549
3 changed files with 6 additions and 6 deletions

View File

@ -24,9 +24,9 @@
<ActionButton on:click={() => window.open("/api/admin/auth/oidc", "_blank")}> <ActionButton on:click={() => window.open("/api/admin/auth/oidc", "_blank")}>
<div class="inner"> <div class="inner">
<img <img
src={preDefinedIcons[oidcIcon] src={!oidcIcon ? OidcLogo : preDefinedIcons[oidcIcon]
? preDefinedIcons[oidcIcon] ? preDefinedIcons[oidcIcon]
: `/global/oidc_logos/${oidcIcon}` || OidcLogo} : `/global/oidc_logos/${oidcIcon}`}
alt="oidc icon" alt="oidc icon"
/> />
<p>{`Sign in with ${oidcName || "OIDC"}`}</p> <p>{`Sign in with ${oidcName || "OIDC"}`}</p>

View File

@ -46,12 +46,12 @@
} }
const OIDCConfigFields = { const OIDCConfigFields = {
Oidc: ["configUrl", "clientId", "clientSecret"], Oidc: ["configUrl", "clientID", "clientSecret"],
} }
const OIDCConfigLabels = { const OIDCConfigLabels = {
Oidc: { Oidc: {
configUrl: "Config URL", configUrl: "Config URL",
clientId: "Client ID", clientID: "Client ID",
clientSecret: "Client Secret", clientSecret: "Client Secret",
}, },
} }

View File

@ -47,8 +47,8 @@ function oidcValidation() {
clientID: Joi.string().required(), clientID: Joi.string().required(),
clientSecret: Joi.string().required(), clientSecret: Joi.string().required(),
configUrl: Joi.string().required(), configUrl: Joi.string().required(),
iconName: Joi.string().required(), iconName: Joi.string().optional(),
name: Joi.string().required(), name: Joi.string().optional(),
}).unknown(true) }).unknown(true)
} }