@@ -10,6 +10,7 @@ import { Header } from '@/ui/elements/Header';
1010import { LoadingCardContainer } from '@/ui/elements/LoadingCard' ;
1111import { Modal } from '@/ui/elements/Modal' ;
1212import { Alert , Textarea } from '@/ui/primitives' ;
13+ import { Route , Switch } from '@/ui/router' ;
1314
1415import { InlineAction } from './InlineAction' ;
1516import {
@@ -94,41 +95,35 @@ function _OAuthConsent() {
9495
9596 if ( errorMessage ) {
9697 return (
97- < Flow . Root flow = 'oauthConsent' >
98- < Card . Root >
99- < Card . Content >
100- < Card . Alert > { errorMessage } </ Card . Alert >
101- </ Card . Content >
102- < Card . Footer />
103- </ Card . Root >
104- </ Flow . Root >
98+ < Card . Root >
99+ < Card . Content >
100+ < Card . Alert > { errorMessage } </ Card . Alert >
101+ </ Card . Content >
102+ < Card . Footer />
103+ </ Card . Root >
105104 ) ;
106105 }
107106
108107 if ( isLoading ) {
109108 return (
110- < Flow . Root flow = 'oauthConsent' >
111- < Card . Root >
112- < Card . Content >
113- < LoadingCardContainer />
114- </ Card . Content >
115- < Card . Footer />
116- </ Card . Root >
117- </ Flow . Root >
118- ) ;
119- }
120- }
121-
122- if ( ctx . enableOrgSelection && ( ! isMembershipsLoaded || userMemberships . isLoading ) ) {
123- return (
124- < Flow . Root flow = 'oauthConsent' >
125109 < Card . Root >
126110 < Card . Content >
127111 < LoadingCardContainer />
128112 </ Card . Content >
129113 < Card . Footer />
130114 </ Card . Root >
131- </ Flow . Root >
115+ ) ;
116+ }
117+ }
118+
119+ if ( ctx . enableOrgSelection && ( ! isMembershipsLoaded || userMemberships . isLoading ) ) {
120+ return (
121+ < Card . Root >
122+ < Card . Content >
123+ < LoadingCardContainer />
124+ </ Card . Content >
125+ < Card . Footer />
126+ </ Card . Root >
132127 ) ;
133128 }
134129
@@ -155,7 +150,7 @@ function _OAuthConsent() {
155150 const hasOfflineAccess = scopes . some ( item => item . scope === OFFLINE_ACCESS_SCOPE ) ;
156151
157152 return (
158- < Flow . Root flow = 'oauthConsent' >
153+ < >
159154 < form
160155 method = 'POST'
161156 action = { actionUrl }
@@ -328,7 +323,7 @@ function _OAuthConsent() {
328323 redirectUri = { redirectUrl }
329324 oauthApplicationName = { oauthApplicationName }
330325 />
331- </ Flow . Root >
326+ </ >
332327 ) ;
333328}
334329
@@ -373,4 +368,20 @@ function RedirectUriModal({ onOpen, onClose, isOpen, redirectUri, oauthApplicati
373368 ) ;
374369}
375370
376- export const OAuthConsent = withCoreUserGuard ( withCardStateProvider ( _OAuthConsent ) ) ;
371+ const AuthenticatedRoutes = withCoreUserGuard ( withCardStateProvider ( _OAuthConsent ) ) ;
372+
373+ const OAuthConsentInternal = ( ) => {
374+ return (
375+ < Flow . Root flow = 'oauthConsent' >
376+ < Flow . Part >
377+ < Switch >
378+ < Route >
379+ < AuthenticatedRoutes />
380+ </ Route >
381+ </ Switch >
382+ </ Flow . Part >
383+ </ Flow . Root >
384+ ) ;
385+ } ;
386+
387+ export const OAuthConsent = OAuthConsentInternal ;
0 commit comments