|
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
import React, { lazy, Suspense, useContext, useMemo } from 'react';
|
|
import React, { lazy, Suspense, useContext, useMemo } from 'react';
|
|
|
-import { Route, Routes, useLocation } from 'react-router-dom';
|
|
|
|
|
|
|
+import { Route, Routes, useLocation, useParams } from 'react-router-dom';
|
|
|
import Loading from './components/common/ui/Loading';
|
|
import Loading from './components/common/ui/Loading';
|
|
|
import User from './pages/User';
|
|
import User from './pages/User';
|
|
|
import { AuthRedirect, PrivateRoute, AdminRoute } from './helpers';
|
|
import { AuthRedirect, PrivateRoute, AdminRoute } from './helpers';
|
|
@@ -56,6 +56,11 @@ const About = lazy(() => import('./pages/About'));
|
|
|
const UserAgreement = lazy(() => import('./pages/UserAgreement'));
|
|
const UserAgreement = lazy(() => import('./pages/UserAgreement'));
|
|
|
const PrivacyPolicy = lazy(() => import('./pages/PrivacyPolicy'));
|
|
const PrivacyPolicy = lazy(() => import('./pages/PrivacyPolicy'));
|
|
|
|
|
|
|
|
|
|
+function DynamicOAuth2Callback() {
|
|
|
|
|
+ const { provider } = useParams();
|
|
|
|
|
+ return <OAuth2Callback type={provider} />;
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
function App() {
|
|
function App() {
|
|
|
const location = useLocation();
|
|
const location = useLocation();
|
|
|
const [statusState] = useContext(StatusContext);
|
|
const [statusState] = useContext(StatusContext);
|
|
@@ -234,6 +239,14 @@ function App() {
|
|
|
</Suspense>
|
|
</Suspense>
|
|
|
}
|
|
}
|
|
|
/>
|
|
/>
|
|
|
|
|
+ <Route
|
|
|
|
|
+ path='/oauth/:provider'
|
|
|
|
|
+ element={
|
|
|
|
|
+ <Suspense fallback={<Loading></Loading>} key={location.pathname}>
|
|
|
|
|
+ <DynamicOAuth2Callback />
|
|
|
|
|
+ </Suspense>
|
|
|
|
|
+ }
|
|
|
|
|
+ />
|
|
|
<Route
|
|
<Route
|
|
|
path='/console/setting'
|
|
path='/console/setting'
|
|
|
element={
|
|
element={
|