Fix: web app auth maybe failed (#21166)
This commit is contained in:
parent
918bb9a2f7
commit
420a34a546
2 changed files with 6 additions and 6 deletions
|
|
@ -314,10 +314,10 @@ const AppPublisher = ({
|
||||||
{!isAppAccessSet && <p className='system-xs-regular mt-1 text-text-warning'>{t('app.publishApp.notSetDesc')}</p>}
|
{!isAppAccessSet && <p className='system-xs-regular mt-1 text-text-warning'>{t('app.publishApp.notSetDesc')}</p>}
|
||||||
</div>}
|
</div>}
|
||||||
<div className='flex flex-col gap-y-1 border-t-[0.5px] border-t-divider-regular p-4 pt-3'>
|
<div className='flex flex-col gap-y-1 border-t-[0.5px] border-t-divider-regular p-4 pt-3'>
|
||||||
<Tooltip triggerClassName='flex' disabled={!systemFeatures.webapp_auth.enabled || userCanAccessApp?.result} popupContent={t('app.noAccessPermission')} asChild={false}>
|
<Tooltip triggerClassName='flex' disabled={!systemFeatures.webapp_auth.enabled || appDetail?.access_mode === AccessMode.EXTERNAL_MEMBERS || userCanAccessApp?.result} popupContent={t('app.noAccessPermission')} asChild={false}>
|
||||||
<SuggestedAction
|
<SuggestedAction
|
||||||
className='flex-1'
|
className='flex-1'
|
||||||
disabled={!publishedAt || (systemFeatures.webapp_auth.enabled && !userCanAccessApp?.result)}
|
disabled={!publishedAt || (systemFeatures.webapp_auth.enabled && appDetail?.access_mode !== AccessMode.EXTERNAL_MEMBERS && !userCanAccessApp?.result)}
|
||||||
link={appURL}
|
link={appURL}
|
||||||
icon={<RiPlayCircleLine className='h-4 w-4' />}
|
icon={<RiPlayCircleLine className='h-4 w-4' />}
|
||||||
>
|
>
|
||||||
|
|
@ -326,10 +326,10 @@ const AppPublisher = ({
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
{appDetail?.mode === 'workflow' || appDetail?.mode === 'completion'
|
{appDetail?.mode === 'workflow' || appDetail?.mode === 'completion'
|
||||||
? (
|
? (
|
||||||
<Tooltip triggerClassName='flex' disabled={!systemFeatures.webapp_auth.enabled || userCanAccessApp?.result} popupContent={t('app.noAccessPermission')} asChild={false}>
|
<Tooltip triggerClassName='flex' disabled={!systemFeatures.webapp_auth.enabled || appDetail.access_mode === AccessMode.EXTERNAL_MEMBERS || userCanAccessApp?.result} popupContent={t('app.noAccessPermission')} asChild={false}>
|
||||||
<SuggestedAction
|
<SuggestedAction
|
||||||
className='flex-1'
|
className='flex-1'
|
||||||
disabled={!publishedAt || (systemFeatures.webapp_auth.enabled && !userCanAccessApp?.result)}
|
disabled={!publishedAt || (systemFeatures.webapp_auth.enabled && appDetail.access_mode !== AccessMode.EXTERNAL_MEMBERS && !userCanAccessApp?.result)}
|
||||||
link={`${appURL}${appURL.includes('?') ? '&' : '?'}mode=batch`}
|
link={`${appURL}${appURL.includes('?') ? '&' : '?'}mode=batch`}
|
||||||
icon={<RiPlayList2Line className='h-4 w-4' />}
|
icon={<RiPlayList2Line className='h-4 w-4' />}
|
||||||
>
|
>
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ const SSOAuth: FC<SSOAuthProps> = ({
|
||||||
}
|
}
|
||||||
else if (protocol === SSOProtocol.OIDC) {
|
else if (protocol === SSOProtocol.OIDC) {
|
||||||
getUserOIDCSSOUrl(invite_token).then((res) => {
|
getUserOIDCSSOUrl(invite_token).then((res) => {
|
||||||
document.cookie = `user-oidc-state=${res.state}`
|
document.cookie = `user-oidc-state=${res.state};Path=/`
|
||||||
router.push(res.url)
|
router.push(res.url)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
|
|
@ -42,7 +42,7 @@ const SSOAuth: FC<SSOAuthProps> = ({
|
||||||
}
|
}
|
||||||
else if (protocol === SSOProtocol.OAuth2) {
|
else if (protocol === SSOProtocol.OAuth2) {
|
||||||
getUserOAuth2SSOUrl(invite_token).then((res) => {
|
getUserOAuth2SSOUrl(invite_token).then((res) => {
|
||||||
document.cookie = `user-oauth2-state=${res.state}`
|
document.cookie = `user-oauth2-state=${res.state};Path=/`
|
||||||
router.push(res.url)
|
router.push(res.url)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue