Refactor authentication handling to pass authentication metadata into App.

eliminates warnings from oauth2 hook by conditionally using its useAuth hook.
This commit is contained in:
2025-04-05 19:37:02 -05:00
parent f654208769
commit e3d30633f1
4 changed files with 42 additions and 32 deletions

View File

@ -52,7 +52,7 @@ authenticationMetaDataPromise.then((authenticationMetaData) =>
function Auth0RouterBody()
{
const {renderAppWrapper} = useAuth0AuthenticationModule({});
return (renderAppWrapper(authenticationMetaData, null));
return (renderAppWrapper(authenticationMetaData));
}
@ -61,10 +61,10 @@ authenticationMetaDataPromise.then((authenticationMetaData) =>
***************************************************************************/
function OAuth2RouterBody()
{
const {renderAppWrapper} = useOAuth2AuthenticationModule({});
const {renderAppWrapper} = useOAuth2AuthenticationModule({inOAuthContext: false});
return (renderAppWrapper(authenticationMetaData, (
<MaterialUIControllerProvider>
<App />
<App authenticationMetaData={authenticationMetaData} />
</MaterialUIControllerProvider>
)));
}
@ -78,7 +78,7 @@ authenticationMetaDataPromise.then((authenticationMetaData) =>
const {renderAppWrapper} = useAnonymousAuthenticationModule({});
return (renderAppWrapper(authenticationMetaData, (
<MaterialUIControllerProvider>
<App />
<App authenticationMetaData={authenticationMetaData} />
</MaterialUIControllerProvider>
)));
}