Octavi00 commented on code in PR #11812:
URL: https://github.com/apache/gravitino/pull/11812#discussion_r3576262927


##########
web-v2/web/src/app/login/page.js:
##########
@@ -28,36 +29,47 @@ import { useEffect, useState, Suspense } from 'react'
 
 import OidcLogin from './components/OidcLogin'
 import DefaultLogin from './components/DefaultLogin'
+import BasicLogin from './components/BasicLogin'
 import { oauthProviderFactory } from '@/lib/auth/providers/factory'
 import { resetMetalakeStore } from '@/lib/store/metalakes'
 import { useAppDispatch } from '@/lib/hooks/useStore'
 
+import { to } from '@/lib/utils'
+import { getAuthConfigs } from '@/lib/store/auth'
+
 const fonts = Roboto({ subsets: ['latin'], weight: ['400'], display: 'swap' })
 
 const { Title } = Typography
 
 const LoginContent = () => {
+  const router = useRouter()
   const searchParams = useSearchParams()
   const inactiveReason = searchParams.get('reason') === 'inactive'
   const maxDurationReason = searchParams.get('reason') === 'max_duration'
+  const [authType, setAuthType] = useState(null)
   const [providerType, setProviderType] = useState(null)
   const dispatch = useAppDispatch()
 
   useEffect(() => {
-    const detectProviderType = async () => {
-      try {
-        const detectedType = await oauthProviderFactory.getProviderType()
-        setProviderType(detectedType)
-      } catch (error) {
-        setProviderType('default') // fallback to default provider
+    const detectLoginType = async () => {
+      const [, resAuthConfigs] = await to(dispatch(getAuthConfigs()))

Review Comment:
   Thanks for the input, I will apply your suggested changes. I hadn't realized 
that authType was loaded by default, so my adjustment was pretty redundant.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to