mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 04:25:59 +08:00
chore: update page.tsx (#4897)
This commit is contained in:
parent
fb6843815c
commit
c6f9ea4434
@ -21,12 +21,12 @@ const WebSSOForm: FC = () => {
|
|||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
const [isLoading, setIsLoading] = useState(false)
|
const [isLoading, setIsLoading] = useState(false)
|
||||||
const [protocal, setProtocal] = useState('')
|
const [protocol, setProtocol] = useState('')
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const fetchFeaturesAndSetToken = async () => {
|
const fetchFeaturesAndSetToken = async () => {
|
||||||
await fetchSystemFeatures().then((res) => {
|
await fetchSystemFeatures().then((res) => {
|
||||||
setProtocal(res.sso_enforced_for_web_protocol)
|
setProtocol(res.sso_enforced_for_web_protocol)
|
||||||
})
|
})
|
||||||
|
|
||||||
// Callback from SSO, process token and redirect
|
// Callback from SSO, process token and redirect
|
||||||
@ -76,21 +76,21 @@ const WebSSOForm: FC = () => {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if (protocal === 'saml') {
|
if (protocol === 'saml') {
|
||||||
fetchWebSAMLSSOUrl(appCode, redirectUrl).then((res) => {
|
fetchWebSAMLSSOUrl(appCode, redirectUrl).then((res) => {
|
||||||
router.push(res.url)
|
router.push(res.url)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else if (protocal === 'oidc') {
|
else if (protocol === 'oidc') {
|
||||||
fetchWebOIDCSSOUrl(appCode, redirectUrl).then((res) => {
|
fetchWebOIDCSSOUrl(appCode, redirectUrl).then((res) => {
|
||||||
router.push(res.url)
|
router.push(res.url)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
else if (protocal === 'oauth2') {
|
else if (protocol === 'oauth2') {
|
||||||
fetchWebOAuth2SSOUrl(appCode, redirectUrl).then((res) => {
|
fetchWebOAuth2SSOUrl(appCode, redirectUrl).then((res) => {
|
||||||
router.push(res.url)
|
router.push(res.url)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
@ -100,7 +100,7 @@ const WebSSOForm: FC = () => {
|
|||||||
else {
|
else {
|
||||||
Toast.notify({
|
Toast.notify({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
message: 'sso protocal is not supported.',
|
message: 'sso protocol is not supported.',
|
||||||
})
|
})
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user