File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- REACT_APP_API_BASE_URL = APP_API_BASE_URL
1+ REACT_APP_API_BASE_URL = https://ca-cps-d4ecoervb6ab-api.salmonbay-e4fea35b.eastus2.azurecontainerapps.io/
22
33REACT_APP_WEB_CLIENT_ID = APP_WEB_CLIENT_ID
44REACT_APP_WEB_AUTHORITY = APP_WEB_AUTHORITY
@@ -10,4 +10,6 @@ REACT_APP_POST_REDIRECT_URL = "/"
1010REACT_APP_WEB_SCOPE = APP_WEB_SCOPE
1111
1212REACT_APP_API_SCOPE = APP_API_SCOPE
13- REACT_APP_CONSOLE_LOG_ENABLED = APP_CONSOLE_LOG_ENABLED
13+ REACT_APP_CONSOLE_LOG_ENABLED = APP_CONSOLE_LOG_ENABLED
14+
15+ REACT_APP_AUTH_ENABLED = false
Original file line number Diff line number Diff line change @@ -10,12 +10,17 @@ import useAuth from './useAuth';
1010const AuthWrapper : React . FC < { children : React . ReactNode } > = ( { children } ) => {
1111
1212 const { isAuthenticated, login, inProgress, token } = useAuth ( ) ;
13+ const authEnabled = process . env . REACT_APP_AUTH_ENABLED !== 'false' ; // Defaults to true if not set
1314
1415 useEffect ( ( ) => {
15- if ( ! isAuthenticated && inProgress === InteractionStatus . None ) {
16+ if ( authEnabled && ! isAuthenticated && inProgress === InteractionStatus . None ) {
1617 login ( ) ;
1718 }
18- } , [ isAuthenticated , inProgress ] ) ;
19+ } , [ authEnabled , isAuthenticated , inProgress ] ) ;
20+
21+ if ( ! authEnabled ) {
22+ return < > { children } </ > ;
23+ }
1924
2025 return < > { ( isAuthenticated && token ) && children } </ >
2126} ;
You can’t perform that action at this time.
0 commit comments