mirror of
https://github.com/logto-io/logto.git
synced 2025-01-06 20:40:08 -05:00
fix(console): external link should use to the correct URL in protected app details (#5317)
This commit is contained in:
parent
f2e978d2d9
commit
c7237e1aff
1 changed files with 21 additions and 22 deletions
|
@ -53,10 +53,16 @@ function ProtectedAppSettings({ data }: Props) {
|
|||
name: 'protectedAppMetadata.pageRules',
|
||||
});
|
||||
|
||||
const host = data.protectedAppMetadata?.host;
|
||||
if (!data.protectedAppMetadata) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const { host } = data.protectedAppMetadata;
|
||||
// We only support one custom domain for protected apps at the moment.
|
||||
const customDomain = customDomains[0];
|
||||
const externalLink = `https://${
|
||||
customDomain?.status === DomainStatus.Active ? customDomain.domain : host
|
||||
}`;
|
||||
|
||||
return (
|
||||
<>
|
||||
|
@ -68,7 +74,6 @@ function ProtectedAppSettings({ data }: Props) {
|
|||
targetBlank: 'noopener',
|
||||
}}
|
||||
>
|
||||
{!!host && (
|
||||
<div className={styles.launcher}>
|
||||
<span>{t('protected_app.success_message')}</span>
|
||||
<Button
|
||||
|
@ -77,16 +82,10 @@ function ProtectedAppSettings({ data }: Props) {
|
|||
title="application_details.try_it"
|
||||
trailingIcon={<ExternalLinkIcon />}
|
||||
onClick={() => {
|
||||
window.open(
|
||||
`https://${
|
||||
customDomain?.status === DomainStatus.Active ? customDomain.domain : host
|
||||
}`,
|
||||
'_blank'
|
||||
);
|
||||
window.open(externalLink, '_blank');
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
<FormField isRequired title="application_details.application_name">
|
||||
<TextInput
|
||||
{...register('name', { required: true })}
|
||||
|
@ -127,11 +126,11 @@ function ProtectedAppSettings({ data }: Props) {
|
|||
{t('application_details.app_domain_protected_description_1')}
|
||||
</div>
|
||||
<div className={styles.hostInUse}>
|
||||
<span className={styles.host}>{data.protectedAppMetadata?.host}</span>
|
||||
<span className={styles.host}>{host}</span>
|
||||
<DomainStatusTag status={DomainStatus.Active} />
|
||||
<Spacer />
|
||||
<CopyToClipboard value={host} variant="icon" />
|
||||
<OpenExternalLink link={host} />
|
||||
<OpenExternalLink link={externalLink} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
|
Loading…
Reference in a new issue