mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
[CORL-621] Auth Fixes (#2569)
* fix: resolve error with redirects - fixes #2529 * fix: apply validations to username for oidc * fix: converted components to function components * fix: snapshots
This commit is contained in:
committed by
Kim Gardner
parent
64f102e6d4
commit
921461008e
@@ -53,13 +53,13 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
}) => {
|
||||
return (
|
||||
<ConfigBoxWithToggleField
|
||||
data-testid={`configure-auth-oidc-container`}
|
||||
data-testid="configure-auth-oidc-container"
|
||||
title={
|
||||
<Localized id="configure-auth-oidc-loginWith">
|
||||
<span>Login with OIDC</span>
|
||||
</Localized>
|
||||
}
|
||||
name={`auth.integrations.oidc.enabled`}
|
||||
name="auth.integrations.oidc.enabled"
|
||||
disabled={disabled}
|
||||
>
|
||||
{disabledInside => (
|
||||
@@ -84,7 +84,7 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
</InputDescription>
|
||||
</Localized>
|
||||
<Field
|
||||
name={`auth.integrations.oidc.name`}
|
||||
name="auth.integrations.oidc.name"
|
||||
validate={composeValidatorsWhen(isEnabled, required)}
|
||||
parse={identity}
|
||||
>
|
||||
@@ -107,12 +107,12 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
</FormField>
|
||||
<ClientIDField
|
||||
validate={composeValidatorsWhen(isEnabled, required)}
|
||||
name={`auth.integrations.oidc.clientID`}
|
||||
name="auth.integrations.oidc.clientID"
|
||||
disabled={disabledInside}
|
||||
/>
|
||||
<ClientSecretField
|
||||
validate={composeValidatorsWhen(isEnabled, required)}
|
||||
name={`auth.integrations.oidc.clientSecret`}
|
||||
name="auth.integrations.oidc.clientSecret"
|
||||
disabled={disabledInside}
|
||||
/>
|
||||
<FormField>
|
||||
@@ -127,7 +127,7 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
</InputDescription>
|
||||
</Localized>
|
||||
<Field
|
||||
name={`auth.integrations.oidc.issuer`}
|
||||
name="auth.integrations.oidc.issuer"
|
||||
validate={composeValidatorsWhen(isEnabled, required, validateURL)}
|
||||
parse={identity}
|
||||
>
|
||||
@@ -165,7 +165,7 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
<InputLabel>authorizationURL</InputLabel>
|
||||
</Localized>
|
||||
<Field
|
||||
name={`auth.integrations.oidc.authorizationURL`}
|
||||
name="auth.integrations.oidc.authorizationURL"
|
||||
validate={composeValidatorsWhen(isEnabled, required, validateURL)}
|
||||
parse={identity}
|
||||
>
|
||||
@@ -191,7 +191,7 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
<InputLabel>tokenURL</InputLabel>
|
||||
</Localized>
|
||||
<Field
|
||||
name={`auth.integrations.oidc.tokenURL`}
|
||||
name="auth.integrations.oidc.tokenURL"
|
||||
validate={composeValidatorsWhen(isEnabled, required, validateURL)}
|
||||
parse={identity}
|
||||
>
|
||||
@@ -217,7 +217,7 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
<InputLabel>jwksURI</InputLabel>
|
||||
</Localized>
|
||||
<Field
|
||||
name={`auth.integrations.oidc.jwksURI`}
|
||||
name="auth.integrations.oidc.jwksURI"
|
||||
validate={composeValidatorsWhen(isEnabled, required, validateURL)}
|
||||
parse={identity}
|
||||
>
|
||||
@@ -244,11 +244,11 @@ const OIDCConfig: FunctionComponent<Props> = ({
|
||||
<span>Use OIDC login on</span>
|
||||
</Localized>
|
||||
}
|
||||
name={`auth.integrations.oidc.targetFilter`}
|
||||
name="auth.integrations.oidc.targetFilter"
|
||||
disabled={disabledInside}
|
||||
/>
|
||||
<RegistrationField
|
||||
name={`auth.integrations.oidc.allowRegistration`}
|
||||
name="auth.integrations.oidc.allowRegistration"
|
||||
disabled={disabledInside}
|
||||
/>
|
||||
</HorizontalGutter>
|
||||
|
||||
@@ -42,6 +42,9 @@ class OIDCConfigContainer extends React.Component<Props, State> {
|
||||
issuer: form.getState().values.auth.integrations.oidc.issuer,
|
||||
});
|
||||
if (config) {
|
||||
if (config.issuer) {
|
||||
form.change("auth.integrations.oidc.issuer", config.issuer);
|
||||
}
|
||||
form.change(
|
||||
"auth.integrations.oidc.authorizationURL",
|
||||
config.authorizationURL
|
||||
|
||||
Reference in New Issue
Block a user