Skip to content

Commit

Permalink
Fix basic auth error message when using Kudu
Browse files Browse the repository at this point in the history
  • Loading branch information
yoonaoh committed Jan 3, 2024
1 parent 8d4246b commit 5b17136
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const DeploymentCenterCodeSourceAndBuild: React.FC<DeploymentCenterFieldProps<De
const [selectedBuildChoice, setSelectedBuildChoice] = useState<BuildProvider>(BuildProvider.None);
const [isCalloutVisible, setIsCalloutVisible] = useState(false);
const [showInfoBanner, setShowInfoBanner] = useState(true);
const [basicAuthErrorMessage, setBasicAuthErrorMessage] = useState();

const deploymentCenterContext = useContext(DeploymentCenterContext);
const deploymentCenterPublishingContext = useContext(DeploymentCenterPublishingContext);
Expand Down Expand Up @@ -239,6 +240,11 @@ const DeploymentCenterCodeSourceAndBuild: React.FC<DeploymentCenterFieldProps<De
const showBasicAuthError = useMemo(() => {
const isGitHubActionsOrKuduBuild =
selectedBuild === BuildProvider.GitHubAction || selectedBuild === BuildProvider.AppServiceBuildService;
setBasicAuthErrorMessage(
selectedBuild === BuildProvider.GitHubAction
? t('deploymentCenterScmBasicAuthErrorMessageWithOidc')
: t('deploymentCenterScmBasicAuthErrorMessage')
);
const isBasicAuthSelected = formProps.values.authType === AuthType.PublishProfile;
return (
isBasicAuthSelected && isGitHubActionsOrKuduBuild && !deploymentCenterPublishingContext.basicPublishingCredentialsPolicies?.scm.allow
Expand All @@ -265,7 +271,7 @@ const DeploymentCenterCodeSourceAndBuild: React.FC<DeploymentCenterFieldProps<De
<div className={deploymentCenterInfoBannerDiv}>
<CustomBanner
id="deployment-center-scm-basic-auth-warning"
message={t('deploymentCenterScmBasicAuthErrorMessageWithOidc')}
message={basicAuthErrorMessage ?? ''}
type={MessageBarType.error}
onClick={openConfigurationBlade}
/>
Expand Down

0 comments on commit 5b17136

Please sign in to comment.