diff --git a/platform/firecamp-platform/src/containers/identity.tsx b/platform/firecamp-platform/src/containers/identity.tsx deleted file mode 100644 index 43b7da12..00000000 --- a/platform/firecamp-platform/src/containers/identity.tsx +++ /dev/null @@ -1,74 +0,0 @@ -import { useEffect, useState } from 'react'; -import { createRoot } from 'react-dom/client'; -import * as Sentry from '@sentry/browser'; -import { Integrations } from '@sentry/tracing'; -import CloudApiGlobal, { Rest } from '@firecamp/cloud-apis'; -import { ECloudApiHeaders } from '../types'; -import _auth from '../services/auth'; -import { EProvider } from '../services/auth/types'; - -const IdentityPage = () => { - const [error, setError] = useState(''); - - useEffect(() => { - const urlParams = new URLSearchParams(location.search); - console.log(urlParams); - - const code = urlParams.get('code'); - const _error = urlParams.get('error'); - const errorDescription = urlParams.get('error_description'); - - if (errorDescription) setError(errorDescription); - if (code) { - CloudApiGlobal.setHost(process.env.FIRECAMP_API_HOST); - // set app version into cloud-api headers - CloudApiGlobal.setGlobalHeaders({ - [ECloudApiHeaders.AppVersion]: process.env.APP_VERSION || '', - }); - - _auth - .signIn(EProvider.GITHUB, { username: '', password: '' }, code) - .then(async () => { - localStorage.setItem( - 'authSuccessMessage', - "You're signed in successfully." - ); - //@ts-ignore - window.location = '/'; //redirect to the main app - // console.log(data, 12345); - }) - .catch((e) => { - setError(e.response?.data?.message || e.message); - }); - } - }, []); - - return ( - <> - {error} -
- {error ? Go to Firecamp : 'Authenticating...'} - - ); -}; - -if (process.env.NODE_ENV == 'production') { - Sentry.init({ - dsn: process.env.SENTRY_DSN, - - // Alternatively, use `process.env.npm_package_version` for a dynamic release version - // if your build tool supports it. - release: `Firecamp@${process.env.APP_VERSION}`, - - //@ts-ignore - integrations: [new Integrations.BrowserTracing()], - - // Set tracesSampleRate to 1.0 to capture 100% - // of transactions for performance monitoring. - // We recommend adjusting this value in production - tracesSampleRate: 1.0, - }); -} - -const root = createRoot(document.getElementById('root')); -root.render(); \ No newline at end of file diff --git a/webpack.common.js b/webpack.common.js index 53de7aa3..acce02bc 100644 --- a/webpack.common.js +++ b/webpack.common.js @@ -23,13 +23,6 @@ const plugins = [ favicon: 'templates/favicon.png', hash: true, }), - new HtmlWebpackPlugin({ - inject: true, - chunks: ['identity'], - filename: 'identity.html', - template: 'templates/identity.html', - favicon: 'templates/favicon.png', - }), new NodePolyfillPlugin(), new webpack.ProgressPlugin({ entries: true, @@ -165,10 +158,6 @@ module.exports = { __dirname, './platform/firecamp-platform/src/containers/index.tsx' ), - identity: path.join( - __dirname, - './platform/firecamp-platform/src/containers/identity.tsx' - ), }, optimization: { runtimeChunk: 'single',