mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-20 19:59:11 +08:00
fix: show warning message if enable webapp auth but not config auth methods
This commit is contained in:
parent
fe01f3ac72
commit
f31081f828
@ -30,7 +30,10 @@ export default function AccessControl(props: AccessControlProps) {
|
|||||||
const specificMembers = useAccessControlStore(s => s.specificMembers)
|
const specificMembers = useAccessControlStore(s => s.specificMembers)
|
||||||
const currentMenu = useAccessControlStore(s => s.currentMenu)
|
const currentMenu = useAccessControlStore(s => s.currentMenu)
|
||||||
const setCurrentMenu = useAccessControlStore(s => s.setCurrentMenu)
|
const setCurrentMenu = useAccessControlStore(s => s.setCurrentMenu)
|
||||||
const hideTip = systemFeatures
|
const hideTip = systemFeatures.webapp_auth.enabled
|
||||||
|
&& (systemFeatures.webapp_auth.allow_sso
|
||||||
|
|| systemFeatures.webapp_auth.allow_email_password_login
|
||||||
|
|| systemFeatures.webapp_auth.allow_email_code_login)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setAppId(app.id)
|
setAppId(app.id)
|
||||||
|
@ -21,6 +21,9 @@ export default function SpecificGroupsOrMembers() {
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const systemFeatures = useGlobalPublicStore(s => s.systemFeatures)
|
const systemFeatures = useGlobalPublicStore(s => s.systemFeatures)
|
||||||
const hideTip = systemFeatures.webapp_auth.enabled
|
const hideTip = systemFeatures.webapp_auth.enabled
|
||||||
|
&& (systemFeatures.webapp_auth.allow_sso
|
||||||
|
|| systemFeatures.webapp_auth.allow_email_password_login
|
||||||
|
|| systemFeatures.webapp_auth.allow_email_code_login)
|
||||||
|
|
||||||
const { isPending, data } = useAppWhiteListSubjects(appId, Boolean(appId) && currentMenu === AccessMode.SPECIFIC_GROUPS_MEMBERS)
|
const { isPending, data } = useAppWhiteListSubjects(appId, Boolean(appId) && currentMenu === AccessMode.SPECIFIC_GROUPS_MEMBERS)
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
@ -41,6 +41,8 @@ export type SystemFeatures = {
|
|||||||
sso_config: {
|
sso_config: {
|
||||||
protocol: SSOProtocol
|
protocol: SSOProtocol
|
||||||
}
|
}
|
||||||
|
allow_email_code_login: boolean
|
||||||
|
allow_email_password_login: boolean
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,5 +72,7 @@ export const defaultSystemFeatures: SystemFeatures = {
|
|||||||
sso_config: {
|
sso_config: {
|
||||||
protocol: SSOProtocol.SAML,
|
protocol: SSOProtocol.SAML,
|
||||||
},
|
},
|
||||||
|
allow_email_code_login: false,
|
||||||
|
allow_email_password_login: false,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user