This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
import { useAuth0 } from '../../../auth/auth0'; | |
import { urls } from '../../../routers/urls'; | |
const Login: React.FC = () => { | |
const { loginWithRedirect, loading } = useAuth0(); | |
useEffect(() => { | |
if (!loading) { | |
loginWithRedirect({ appState: urls.orderManagement }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Request interceptor for API calls | |
axios.interceptors.request.use( | |
async config => { | |
const token = await getTokenSilently(); | |
config.headers.authorization = `Bearer ${token}`; | |
return config; | |
}, | |
error => { | |
Promise.reject(error); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect, useContext, createContext } from 'react'; | |
import createAuth0Client, { | |
getIdTokenClaimsOptions, | |
GetTokenSilentlyOptions, | |
GetTokenWithPopupOptions, | |
IdToken, | |
LogoutOptions, | |
PopupLoginOptions, | |
RedirectLoginOptions, | |
} from '@auth0/auth0-spa-js'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect } from 'react'; | |
import { Resource, resourceActions } from '@oplog/resource-redux'; | |
import { useSelector, useDispatch } from 'react-redux'; | |
import { ResourceType } from '../../models'; | |
import { StoreState } from '../../models/state'; | |
import { AddressTypeOutputDTO } from '../../services/swagger'; | |
import { useTranslation } from 'react-i18next'; | |
import { useParams } from 'react-router-dom'; | |
export const HelloWorld: React.FC = () => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Dispatch, useEffect } from 'react'; | |
import { Resource, resourceActions, resourceSelectors } from '@oplog/resource-redux'; | |
import { connect } from 'react-redux'; | |
import { ResourceType } from '../../models'; | |
import { StoreState } from '../../models/state'; | |
import { AddressTypeOutputDTO } from '../../services/swagger'; | |
import { InjectedIntl, injectIntl } from 'react-intl'; | |
import { RouteComponentProps, withRouter } from 'react-router-dom'; | |
interface IHelloWorld { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This is a temporary fix for open issue https://github.com/facebook/create-react-app/issues/9880 | |
const replace = require('replace-in-file'); | |
const fixFormatWebpackMessages = async () => { | |
try { | |
const results = await replace({ | |
files: 'node_modules/react-dev-utils/formatWebpackMessages.js', | |
from: `let lines = message.split('\\n');`, | |
to: `let lines = []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const resolve = require('resolve'); | |
const PnpWebpackPlugin = require('pnp-webpack-plugin'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); | |
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin'); | |
const TerserPlugin = require('terser-webpack-plugin'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const webpack = require('webpack'); | |
const resolve = require('resolve'); | |
const HtmlWebpackPlugin = require('html-webpack-plugin'); | |
const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin'); | |
const InlineChunkHtmlPlugin = require('react-dev-utils/InlineChunkHtmlPlugin'); | |
const TerserPlugin = require('terser-webpack-plugin'); | |
const MiniCssExtractPlugin = require('mini-css-extract-plugin'); | |
const { WebpackManifestPlugin } = require('webpack-manifest-plugin'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware'); | |
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware'); | |
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware'); | |
const paths = require('./paths'); | |
const fs = require('fs'); | |
const host = process.env.HOST || '0.0.0.0'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const errorOverlayMiddleware = require('react-dev-utils/errorOverlayMiddleware'); | |
const evalSourceMapMiddleware = require('react-dev-utils/evalSourceMapMiddleware'); | |
const noopServiceWorkerMiddleware = require('react-dev-utils/noopServiceWorkerMiddleware'); | |
const ignoredFiles = require('react-dev-utils/ignoredFiles'); | |
const paths = require('./paths'); | |
const fs = require('fs'); | |
const protocol = process.env.HTTPS === 'true' ? 'https' : 'http'; |