\n {list.map((item, index) => (\n
= index + 1,\n })}\n />\n ))}\n
{tip}
\n
\n );\n }\n}\n","import { parseDomain, ParseResultType } from 'parse-domain';\n\nexport function getCookieDomain(hostname = window.location.hostname) {\n const parseResult = parseDomain(hostname);\n let cookieDomain;\n if (parseResult.type === ParseResultType.Listed) {\n const { domain, topLevelDomains } = parseResult;\n cookieDomain = `.${[domain, ...topLevelDomains].join('.')}`;\n }\n return cookieDomain;\n}\nconst cookieDomain = getCookieDomain();\nexport { cookieDomain };\n","export default __webpack_public_path__ + \"static/media/flow360_logo.33383d3d.svg\";","export const LOGIN_SALT = '5ac0e45f46654d70bda109477f10c299';\n","import { isFromTidy3d } from '../utils/util';\n\nexport interface EnvConfig {\n s3: S3Config;\n webapiV2: {\n URL: string;\n };\n cognito: CognitoConfig;\n tidy3dCognito: CognitoConfig;\n}\nexport interface S3Config {\n REGION: string;\n CASE_BUCKET: string;\n MESH_BUCKET: string;\n STUDIO_BUCKET: string;\n}\nexport interface CognitoConfig {\n REGION: string;\n USER_POOL_ID: string;\n APP_CLIENT_ID: string;\n IDENTITY_POOL_ID: string;\n}\nconst dev: EnvConfig = {\n s3: {\n REGION: 'us-east-1',\n CASE_BUCKET: 'flow360cases-v1',\n MESH_BUCKET: 'flow360meshes-v1',\n STUDIO_BUCKET: 'flow360-studio-v1',\n },\n webapiV2: {\n URL: 'https://portal-api.dev-simulation.cloud',\n //URL: \"http://localhost:5000\",\n },\n cognito: {\n REGION: 'us-east-1',\n USER_POOL_ID: 'us-east-1_t41TfpFiq',\n APP_CLIENT_ID: '58h5c2luqdrads6cpjtbjmabjr',\n IDENTITY_POOL_ID: 'us-east-1:7d23a768-ca1c-446b-b91b-31d3e1fe968a',\n },\n tidy3dCognito: {\n REGION: 'us-east-1',\n USER_POOL_ID: 'us-east-1_kjeChiCm8',\n APP_CLIENT_ID: '1imult4e80s1lfocqjpfv69rm2',\n IDENTITY_POOL_ID: 'us-east-1:6cdace1e-db96-4a52-b513-ceb212913de9',\n },\n};\n\nconst prod: EnvConfig = {\n s3: {\n REGION: 'us-gov-west-1',\n CASE_BUCKET: 'flow360cases',\n MESH_BUCKET: 'flow360meshes',\n STUDIO_BUCKET: 'flow360studio',\n },\n webapiV2: {\n URL: 'https://portal-api.simulation.cloud',\n },\n cognito: {\n REGION: 'us-east-1',\n USER_POOL_ID: 'us-east-1_Csq1uNAO3',\n APP_CLIENT_ID: 'scepvluho5eeehv297pvdunk5',\n IDENTITY_POOL_ID: 'us-east-1:68a3cf31-60fc-4def-8db2-4c3d48070756',\n },\n tidy3dCognito: {\n REGION: 'us-east-1',\n USER_POOL_ID: 'us-east-1_kfHmLjlPl',\n APP_CLIENT_ID: '45krrjc3bm1snlddbo79jfpk1d',\n IDENTITY_POOL_ID: 'us-east-1:dc691611-c253-4448-9b96-2bc507940155',\n },\n};\nconst uat: EnvConfig = {\n s3: {\n REGION: 'us-west-2',\n CASE_BUCKET: 'flow360cases-uat2',\n MESH_BUCKET: 'flow360meshes-uat2',\n STUDIO_BUCKET: 'flow360-studio-uat2',\n },\n webapiV2: {\n URL: 'https://portal-api.uat-simulation.cloud',\n //URL: \"http://localhost:5000\",\n },\n cognito: {\n REGION: 'us-west-2',\n USER_POOL_ID: 'us-west-2_Cb8xkdgub',\n APP_CLIENT_ID: '457ch71sk8k3cq5ki0o6k7ljhe',\n IDENTITY_POOL_ID: '',\n },\n tidy3dCognito: {\n REGION: 'us-west-2',\n USER_POOL_ID: 'us-west-2_1zBiqSz9j',\n APP_CLIENT_ID: '6rt02ramf9ajkh93redglq4b4h',\n IDENTITY_POOL_ID: '',\n },\n};\nconst pentest: EnvConfig = {\n ...uat,\n webapiV2: {\n URL: 'https://pentest-portal-api.uat-simulation.cloud',\n //URL: \"http://localhost:5000\",\n },\n};\nexport function getConfig(): EnvConfig {\n const BUILD_ENV = process.env.REACT_APP_BUILD_ENV;\n if (BUILD_ENV === 'prod') {\n return prod;\n } else if (BUILD_ENV === 'uat') {\n return uat;\n } else if (BUILD_ENV === 'pentest') {\n return pentest;\n }\n return dev;\n}\n\nexport default getConfig();\n\nexport function getCognitoConfig(): CognitoConfig {\n const config = getConfig();\n if (isFromTidy3d()) {\n return config.tidy3dCognito;\n }\n return config.cognito;\n}\n","import {\n CognitoUserPool,\n // CognitoUserAttribute,\n CognitoUser,\n} from 'amazon-cognito-identity-js';\nimport { sha512 } from 'js-sha512';\n\nimport { getCognitoConfig } from '../constants/envConfig';\nimport { LOGIN_SALT } from '../constants';\n\nconst cognitoConfig = getCognitoConfig();\nconst poolData = {\n UserPoolId: cognitoConfig.USER_POOL_ID,\n ClientId: cognitoConfig.APP_CLIENT_ID,\n};\nconst userPool = new CognitoUserPool(poolData);\n\n// export function resetPassword(email, { onSuccess, onError, ...rest }) {\n// createUser(email).forgotPassword({\n// onSuccess,\n// onFailure: onError,\n// ...rest,\n// });\n// }\n\n// export function confirmPassword(\n// { email, password, code },\n// { onSuccess, onError, ...rest }\n// ) {\n// createUser(email).confirmPassword(code, hashPassword(password), {\n// onSuccess,\n// onFailure: onError,\n// ...rest,\n// });\n// }\n\n// export function verifyEmail(email, code, callback) {\n// // @callback params\n// // (err,result)=>{}\n// createUser(email).confirmRegistration(code, true, callback);\n// }\n\nexport function createUser(email: string) {\n return new CognitoUser({\n Username: toUsername(email),\n Pool: userPool,\n });\n}\n\nexport function toUsername(email: string) {\n return email.toLowerCase().replace('@', '-at-');\n}\n\nexport function hashPassword(password: string) {\n return sha512(password + LOGIN_SALT);\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"reset_password_page\":\"index_reset_password_page__mza6C\",\"success_msg\":\"index_success_msg__3Td9p\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"sign_up_page\":\"index_sign_up_page__1i2qk\",\"success_msg\":\"index_success_msg__2Vb4k\"};","export interface ProviderConfigMap {\n anduril: ProviderConfig;\n}\nexport interface ProviderConfig {\n redirectUrl: string;\n loginUrl: string;\n}\nconst dev: ProviderConfigMap = {\n anduril: {\n redirectUrl: 'https://anduril-flow360.dev-simulation.cloud',\n loginUrl: `https://sso.dev-simulation.cloud/oauth2/authorize?client_id=3juubqouhhf354ai4b79tcal2j&response_type=code&scope=email+openid+profile&redirect_uri=https://anduril-my.dev-simulation.cloud/callback/flow360/anduril`,\n },\n};\nconst uat: ProviderConfigMap = {\n anduril: {\n redirectUrl: 'https://anduril-flow360.uat-simulation.cloud',\n loginUrl: `https://sso.uat-simulation.cloud/oauth2/authorize?client_id=24oodmcut9qcrbiij0i274cnrf&response_type=code&scope=email+openid+profile&redirect_uri=https://anduril-my.uat-simulation.cloud/callback/flow360/anduril`,\n },\n};\nconst pentest: ProviderConfigMap = { ...uat };\nconst prod: ProviderConfigMap = {\n anduril: {\n redirectUrl: 'https://anduril-flow360.simulation.cloud',\n loginUrl: `https://sso.simulation.cloud/oauth2/authorize?client_id=41ut0khprdcacuc5cfedl4s3hh&response_type=code&scope=email+openid+profile&redirect_uri=https://anduril-my.simulation.cloud/callback/flow360/anduril`,\n },\n};\n\nexport function getProviderConfigMap(): ProviderConfigMap {\n const BUILD_ENV = process.env.REACT_APP_BUILD_ENV;\n if (BUILD_ENV === 'prod') {\n return prod;\n } else if (BUILD_ENV === 'uat') {\n return uat;\n } else if (BUILD_ENV === 'pentest') {\n return pentest;\n }\n return dev;\n}\nexport function getProviderConfig(provider: string): ProviderConfig | null {\n const providerConfigMap = getProviderConfigMap();\n return providerConfigMap[provider as keyof typeof providerConfigMap] ?? null;\n}\n","import { cookieDomain } from '../utils/domain';\n\nexport interface PortalConfig {\n cookieDomain?: string;\n host: string;\n loginUrl: string;\n homeUrl: string;\n}\nconst dev: PortalConfig = {\n cookieDomain: cookieDomain,\n host: 'dev-my.simulation.cloud',\n loginUrl: `${window.location.origin}/login`,\n homeUrl: 'https://develop.d2dhrbzbpo6ev1.amplifyapp.com',\n};\nconst uat: PortalConfig = {\n ...dev,\n host: 'my.uat-simulation.cloud',\n // loginUrl: 'https://uat-my.simulation.cloud/login',\n homeUrl: 'https://www.simulation.cloud',\n};\nconst pentest: PortalConfig = {\n ...uat,\n host: 'pentest-my.uat-simulation.cloud',\n // loginUrl: 'https://uat-my.simulation.cloud/login',\n homeUrl: 'https://www.simulation.cloud',\n};\nconst prod: PortalConfig = {\n ...dev,\n host: 'my.simulation.cloud',\n // loginUrl: 'https://my.simulation.cloud/login',\n homeUrl: 'https://www.simulation.cloud',\n};\n\nexport function getPortalConfig(): PortalConfig {\n const BUILD_ENV = process.env.REACT_APP_BUILD_ENV;\n if (BUILD_ENV === 'prod') {\n return prod;\n } else if (BUILD_ENV === 'uat') {\n return uat;\n } else if (BUILD_ENV === 'pentest') {\n return pentest;\n }\n return dev;\n}\n\nexport default getPortalConfig();\n","import React, { Component } from 'react';\nimport { Row, Col, Select } from 'antd';\nimport countryList from './country-region.json';\n\nconst { Option } = Select;\n\nexport interface CountrySelectProps {\n value?: [Country | null, Region | null];\n needRegion: boolean;\n onChange?: (value: [Country | null, Region | null]) => void;\n}\nexport interface CountrySelectState {\n selectedCountry: Country | null;\n selectedRegion: Region | null;\n regionList: Region[];\n}\nexport interface Region {\n code: string;\n name: string;\n}\nexport interface Country extends Region {\n regionList?: Region[];\n}\nexport default class CountrySelect extends Component<\n CountrySelectProps,\n CountrySelectState\n> {\n constructor(props: CountrySelectProps) {\n super(props);\n const { value } = props;\n const [selectedCountry = null, selectedRegion = null] = value || [];\n const regionList =\n countryList.find(country => country.code === selectedCountry?.code)\n ?.regionList || [];\n this.state = {\n selectedCountry,\n selectedRegion,\n regionList,\n };\n }\n isRegionSelectVisible = () => {\n const { needRegion } = this.props;\n if (!needRegion) {\n return false;\n }\n const { selectedCountry, regionList } = this.state;\n if (!selectedCountry || regionList?.length) {\n // if (regionList?.length) {\n return true;\n } else {\n return false;\n }\n };\n onCountryChange = (value: string, { data }: { data: Country }) => {\n const { onChange } = this.props;\n //exclude regionList from data\n const { regionList, ...selectedCountry } = data;\n this.setState(\n {\n selectedCountry: selectedCountry,\n selectedRegion: null,\n regionList: regionList || [],\n },\n () => {\n onChange?.([selectedCountry, null]);\n }\n );\n };\n onRegionChange = (value: string, { data }: { data: Region }) => {\n const { onChange } = this.props;\n const { selectedCountry } = this.state;\n this.setState(\n {\n selectedCountry,\n selectedRegion: data,\n },\n () => {\n onChange?.([selectedCountry, data]);\n }\n );\n };\n render() {\n const { selectedCountry, selectedRegion, regionList } = this.state;\n const isRegionVisible = this.isRegionSelectVisible();\n return (\n
\n \n \n {countryList.map(country => (\n \n {country.name}\n \n ))}\n \n \n {isRegionVisible && (\n \n \n {regionList?.map(region => (\n \n {region.name}\n \n ))}\n \n \n )}\n
\n );\n }\n}\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"login_page\":\"index_login_page__1sYMo\",\"hidden\":\"index_hidden__1J7LR\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"success_msg\":\"index_success_msg__gc3EQ\"};","// extracted by mini-css-extract-plugin\nmodule.exports = {\"micro_soft_page\":\"index_micro_soft_page__1dyME\",\"success_msg\":\"index_success_msg__rkP0t\"};","import axios, { AxiosResponse } from 'axios';\nimport { isFromTidy3d } from './util';\nexport interface ResponseData {\n code: number | string;\n [key: string]: any;\n}\nlet fetcher = axios.create({\n withCredentials: false,\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'content-type': 'application/json',\n Application: isFromTidy3d() ? 'TIDY3D' : '',\n },\n});\n\n// Request interceptors\nfetcher.interceptors.request.use(\n config => {\n const { headers = {}, params = {} } = config;\n const _ = Date.now();\n config.headers = {\n ...headers,\n };\n //add timestamp\n config.params = {\n _,\n ...params,\n };\n return config;\n },\n error => {\n return Promise.reject(error);\n }\n);\n\n// Response interceptors\nfunction checkStatus(response: AxiosResponse
) {\n if (response.status >= 200 && response.status < 300) {\n response.data.code =\n parseInt(`${response.data.code}`, 10) || response.status;\n return response.data;\n }\n}\nfetcher.interceptors.response.use(\n function (response) {\n return checkStatus(response);\n },\n function (e) {\n return Promise.reject(e);\n }\n);\n\nfetcher.interceptors.response.use(\n function (response) {\n return response;\n },\n function (error) {\n const code = parseInt(error.response?.data?.code || error.response.status);\n const message = error.response?.data?.error || error.message;\n return Promise.reject({\n ...error,\n code,\n message,\n });\n }\n);\n\n// export const post = fetcher.post;\n// export const put = fetcher.put;\n// export const get = axios.get;\n// export const del = (url, params) => {\n// return fetcher.delete(url, { params });\n// };\nexport default fetcher;\n","import { generator, RequestApiConfigMap } from '../utils/apiGenerator';\nimport config from '../constants/envConfig';\nconst { webapiV2 } = config;\nconst APIS: RequestApiConfigMap = {\n login: {\n method: 'get',\n url: `${webapiV2.URL}/auth`,\n },\n oauth2: {\n method: 'get',\n url: `${webapiV2.URL}/oauth2/token`,\n },\n sendRegisterEmail: {\n method: 'post',\n url: `${webapiV2.URL}/auth/register`,\n },\n sendWaitingEmail: {\n method: 'post',\n url: `${webapiV2.URL}/anonymous/waitinglist`,\n },\n verifyEmail: {\n method: 'put',\n url: `${webapiV2.URL}/auth/verify`,\n },\n resendEmail: {\n method: 'put',\n url: `${webapiV2.URL}/auth/resend`,\n },\n forgotPassword: {\n method: 'post',\n url: `${webapiV2.URL}/auth/forgot-password`,\n },\n saveKyc: {\n method: 'put',\n url: `${webapiV2.URL}/auth/kyc`,\n },\n mfaAuth: {\n method: 'post',\n url: `${webapiV2.URL}/auth/challenge`,\n },\n mfaReset: {\n method: 'post',\n url: `${webapiV2.URL}/auth/mfa/reset`,\n },\n mfaResetConfirm: {\n method: 'post',\n url: `${webapiV2.URL}/auth/mfa/resetConfirm`,\n },\n confirmPassword: {\n method: 'post',\n url: `${webapiV2.URL}/auth/confirm-forget-password`,\n },\n checkIp: {\n method: 'get',\n url: `${webapiV2.URL}/auth/check`,\n timeout: 3000,\n },\n getMicrosoftLoginMetadata: {\n method: 'get',\n url: `${webapiV2.URL}/auth/pre/metadata`,\n timeout: 3000,\n },\n};\nexport default generator(APIS);\n","import { AxiosRequestConfig } from 'axios';\nimport request from './request';\n\nexport interface RequestApiConfig {\n method: 'get' | 'post' | 'put' | 'delete';\n url: string;\n isUpload?: boolean;\n timeout?: number;\n}\nexport interface RequestApiConfigMap {\n [key: string]: RequestApiConfig;\n}\nconst upload = (\n apiConfig: RequestApiConfig,\n data: any,\n config: AxiosRequestConfig\n) => {\n const { url, method } = apiConfig;\n if (data instanceof FormData) {\n }\n return request({\n url,\n method,\n data,\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n ...config,\n });\n};\n\nexport const generator = (APIS: RequestApiConfigMap) => {\n const api: { [key: string]: Function } = {};\n Object.entries(APIS).forEach(([apiKey = '', apiConfig]) => {\n const { method = 'get', url = '', isUpload = false } = apiConfig || {};\n if (!apiKey || !apiConfig || !url) {\n return;\n }\n switch (method.toUpperCase()) {\n case 'POST':\n api[apiKey] = (data: any, config = {}) =>\n isUpload\n ? upload(apiConfig, data, config)\n : request.post(url, data, config);\n break;\n case 'DELETE':\n api[apiKey] = (params: any, config = {}) =>\n request.delete(url, { params, ...config });\n break;\n case 'PUT':\n api[apiKey] = (data: any, config = {}) =>\n request.put(url, data, config);\n break;\n case 'GET':\n default:\n api[apiKey] = (params: any, config = {}) =>\n request.get(url, { params, ...config });\n }\n });\n return api;\n};\n","export default __webpack_public_path__ + \"static/media/logo2.1567433e.png\";","import React, { Component } from 'react';\nimport { Button } from 'antd';\nimport AuthLayout from '@/components/AuthLayout';\nimport flow360Logo from '../../../assets/flow360_logo.svg';\nimport { jumpToAnduril } from '../../../utils/util';\nimport styles from './index.module.less';\n\nexport default class AndurilLoginPage extends Component {\n render() {\n return (\n \n
\n \n
\n
Welcome to Flow360!
\n
\n Flow360 Solver is a Scalable CFD Solver for Better Product Design\n
\n
\n {\n jumpToAnduril();\n }}\n type={'primary'}\n className={styles.sign_in_btn}\n >\n Sign In\n \n
\n
\n \n
\n );\n }\n}\n","export default __webpack_public_path__ + \"static/media/google_icon.e6226f71.svg\";","export default __webpack_public_path__ + \"static/media/microsoft_icon.28d8f59e.svg\";","import React, { Component } from 'react';\nimport { Link, RouteComponentProps, withRouter } from 'react-router-dom';\nimport {\n Form,\n Input,\n Button,\n Divider,\n FormInstance,\n Radio,\n RadioChangeEvent,\n} from 'antd';\nimport { AppleFilled } from '@ant-design/icons';\n\nimport styles from './index.module.less';\nimport { getCurrentAppConfig } from '@/constants/appConfig';\nimport googleIcon from '../../../../assets/google_icon.svg';\nimport microsoftIcon from '../../../../assets/microsoft_icon.svg';\nimport {\n encodeUrlJson,\n getUrlQueryParams,\n isFromFlow360,\n isFromTidy3d,\n isFromInternal,\n} from '../../../../utils/util';\n\nconst { Item } = Form;\nconst { Password } = Input;\nconst appTypeOptions = [\n { label: 'Flow360', value: 'FLOW360' },\n { label: 'Tidy3d', value: 'TIDY3D' },\n];\n\nexport interface LoginPanelProps extends RouteComponentProps {\n onLogin: (data: any) => void;\n loading: boolean;\n}\nexport interface LoginPanelState {\n referralCode: string;\n ref: string;\n appType: string;\n}\nclass LoginPanel extends Component {\n constructor(props: LoginPanelProps) {\n super(props);\n const params = getUrlQueryParams();\n let appType = 'FLOW360'; // Default to FLOW360\n\n if (isFromFlow360()) {\n appType = 'FLOW360';\n } else if (isFromTidy3d()) {\n appType = 'TIDY3D';\n }\n this.state = {\n referralCode: (params.referralCode as string) || '',\n ref: params.ref as string,\n appType: appType,\n };\n }\n form: FormInstance | null = null;\n onChange = (e: RadioChangeEvent) => {\n this.setState({ appType: e.target.value });\n };\n login = () => {\n this.form?.validateFields().then(formData => {\n const { email } = formData;\n const { onLogin } = this.props;\n onLogin({\n ...formData,\n appType: this.state.appType.toUpperCase(),\n email: email.toLowerCase(),\n });\n });\n };\n render() {\n const { referralCode, ref, appType } = this.state;\n const { loading, location } = this.props;\n const currentAppConfig = getCurrentAppConfig();\n const layout = {\n labelCol: {\n span: 0,\n },\n wrapperCol: {\n span: 24,\n },\n };\n return (\n \n );\n }\n}\nexport default withRouter(LoginPanel);\n","import React, { PureComponent } from 'react';\nimport { isFromApp } from '../utils/util';\nimport portalConfig from '../constants/portalConfig';\n\n// auth HOC, handle auth logic globally\nexport default function auth(WrappedComponent: Function) {\n return class extends PureComponent {\n isLegal = () => {\n const isSimulationCloud = isFromApp('');\n if (!isSimulationCloud) {\n this.goHome();\n return false;\n }\n return isSimulationCloud;\n };\n goHome = () => {\n window.location.href = portalConfig.homeUrl;\n };\n render() {\n if (!this.isLegal()) {\n return null;\n }\n return ;\n }\n };\n}\n","import React, { Component } from 'react';\nimport { notification } from 'antd';\nimport { sha512 } from 'js-sha512';\nimport LogRocket from 'logrocket';\n\nimport AuthLayout from '@/components/AuthLayout';\nimport { LOGIN_SALT } from '@/constants';\nimport {\n getUrlQueryParams,\n setToken,\n setUser,\n setLoginFlag,\n addTokenToUrl,\n} from '@/utils/util';\nimport api from '@/services';\nimport { RouteComponentProps } from 'react-router-dom';\nimport LoginPanel from './components/LoginPanel';\nimport auth from '../auth';\n\nimport styles from './index.module.less';\nimport ResendModal from '../../components/ResendModal';\n// import { getDefaultAppHost } from '../../utils/util';\n\nexport interface LoginPageProps extends RouteComponentProps {}\nexport interface LoginPageState {\n loading: boolean;\n ref: string;\n resendEmail: string;\n resendModalVisible: boolean;\n}\nclass LoginPage extends Component {\n constructor(props: LoginPageProps) {\n super(props);\n const params = getUrlQueryParams();\n this.state = {\n loading: false,\n ref: decodeURIComponent((params.ref as string) || ''),\n resendEmail: '',\n resendModalVisible: false,\n };\n }\n\n componentDidMount() {\n // bypass login if accessToken exists\n // if (Cookies.get('accessToken')) {\n // this.redirect();\n // }\n }\n\n redirect = (token: string) => {\n const { ref } = this.state;\n if (ref) {\n window.location.href = addTokenToUrl(ref, token);\n } else {\n notification.warning({\n message: 'No ref found',\n description: 'Login success, but no [ref] param found in url address',\n });\n // window.location.href = getDefaultAppHost();\n }\n };\n loading = (loading = false) => {\n this.setState({\n loading: loading,\n });\n };\n onLogin = async (formData: any) => {\n const { email, password, appType } = formData;\n\n try {\n this.loading(true);\n LogRocket.identify(email, {\n name: email,\n email,\n });\n LogRocket.track('login start', { email });\n const { data } = await api.login(\n {},\n {\n auth: {\n username: email,\n password: sha512(password + LOGIN_SALT),\n },\n headers: {\n Application: appType,\n },\n }\n );\n LogRocket.track('login success', { email });\n const { authResult } = data;\n if (authResult?.challengeName === 'SOFTWARE_TOKEN_MFA') {\n const { history, location } = this.props;\n history.push({\n ...location,\n pathname: '/challenge',\n state: {\n email,\n challengeData: authResult,\n },\n });\n } else {\n const {\n auth: {\n accessToken,\n refreshToken,\n idToken,\n // expiresIn = 36000\n },\n oneTimeToken,\n user,\n } = data;\n const { email: userEmail, identityId } = user;\n const expires = 365;\n // const expires = new Date(Date.now() + expiresIn * 1000);\n // save token to cookies, default alive in 36000 sec\n setToken({ accessToken, refreshToken, idToken }, { expires });\n setUser({ email: userEmail, identityId }, { expires });\n setLoginFlag();\n // window.frames[0].postMessage(JSON.stringify(user), ref);\n this.redirect(oneTimeToken);\n }\n } catch (e: any) {\n LogRocket.track('login error', { email, message: e.message });\n // unconfirmed user\n if (e.code === 4010000002) {\n this.showResendModal(email);\n } else {\n notification.error({\n message: 'Incorrect email or password',\n description: e.message || 'Please try again or contact the admin',\n });\n }\n } finally {\n this.loading(false);\n }\n };\n showResendModal = (resendEmail: string) => {\n this.setState({\n resendEmail,\n resendModalVisible: true,\n });\n };\n hideResendModal = () => {\n this.setState({\n resendModalVisible: false,\n });\n };\n render() {\n const { loading, resendEmail, resendModalVisible } = this.state;\n return (\n \n }\n email={resendEmail}\n visible={resendModalVisible}\n onCancel={this.hideResendModal}\n />\n \n );\n }\n}\nexport default auth(LoginPage);\n","import React, { Component } from 'react';\nimport { Link, RouteComponentProps, withRouter } from 'react-router-dom';\nimport { Form, Input, Button, FormInstance } from 'antd';\nimport OtpInput from 'react-otp-input';\n\nimport styles from './index.module.less';\n\nconst { Item } = Form;\n\nexport interface ChallengePanelProps extends RouteComponentProps {\n onSubmit: (data: any) => void;\n loading: boolean;\n onDisable: () => void;\n}\nclass ChallengePanel extends Component