Skip to content

Commit

Permalink
chore: update page.tsx (langgenius#4897)
Browse files Browse the repository at this point in the history
  • Loading branch information
eltociear authored Jun 4, 2024
1 parent fb68438 commit c6f9ea4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions web/app/(shareLayout)/webapp-signin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ const WebSSOForm: FC = () => {
const { t } = useTranslation()

const [isLoading, setIsLoading] = useState(false)
const [protocal, setProtocal] = useState('')
const [protocol, setProtocol] = useState('')

useEffect(() => {
const fetchFeaturesAndSetToken = async () => {
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
Expand Down Expand Up @@ -76,21 +76,21 @@ const WebSSOForm: FC = () => {
return
}

if (protocal === 'saml') {
if (protocol === 'saml') {
fetchWebSAMLSSOUrl(appCode, redirectUrl).then((res) => {
router.push(res.url)
}).finally(() => {
setIsLoading(false)
})
}
else if (protocal === 'oidc') {
else if (protocol === 'oidc') {
fetchWebOIDCSSOUrl(appCode, redirectUrl).then((res) => {
router.push(res.url)
}).finally(() => {
setIsLoading(false)
})
}
else if (protocal === 'oauth2') {
else if (protocol === 'oauth2') {
fetchWebOAuth2SSOUrl(appCode, redirectUrl).then((res) => {
router.push(res.url)
}).finally(() => {
Expand All @@ -100,7 +100,7 @@ const WebSSOForm: FC = () => {
else {
Toast.notify({
type: 'error',
message: 'sso protocal is not supported.',
message: 'sso protocol is not supported.',
})
setIsLoading(false)
}
Expand Down

0 comments on commit c6f9ea4

Please sign in to comment.