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


##########
web-v2/web/src/app/login/page.js:
##########
@@ -42,22 +44,45 @@ const LoginContent = () => {
   const maxDurationReason = searchParams.get('reason') === 'max_duration'
   const [providerType, setProviderType] = useState(null)
   const dispatch = useAppDispatch()
+  const authType = useAppSelector(state => state.auth.authType)
 
   useEffect(() => {
+    dispatch(resetMetalakeStore())
+
+    if (authType !== 'oauth') {
+      return
+    }
+
     const detectProviderType = async () => {
       try {
         const detectedType = await oauthProviderFactory.getProviderType()
         setProviderType(detectedType)
       } catch (error) {
-        setProviderType('default') // fallback to default provider
+        setProviderType('default')
       }
     }
 
-    dispatch(resetMetalakeStore())
     detectProviderType()
-  }, [])
+  }, [authType, dispatch])
 
-  const useOidcLogin = providerType === 'oidc'
+  const renderLogin = () => {
+    switch (authType) {
+      case 'basic':
+        return <BasicLogin />
+
+      case 'simple':
+        return <SimpleLogin />
+
+      case 'oauth':
+        if (providerType === null) return null
+        if (providerType === 'oidc') return <OidcLogin />
+
+        return <DefaultLogin />
+
+      default:
+        return null

Review Comment:
   I like this idea, but I will instead use a spin from antd just for the sake 
of a nicer ui



-- 
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