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AUG,iBACHrO,EAAAA,EAAAA,KAACsO,EAAAA,GAAQ,CAACnD,GAAG,OAGjBnL,EAAAA,EAAAA,KAACqD,GAAakL,EAAAA,EAAAA,GAAA,GAAKjL,GAC9B,C","sources":["components/pages/LoginPage/components/OktaValidationError.tsx","components/pages/LoginPage/components/PasswordResetConfirmation.tsx","components/pages/LoginPage/components/OktaLoginForm.tsx","components/pages/LoginPage/LoginPage.tsx"],"sourcesContent":["import React from 'react';\n\nexport default function OktaValidationError({ error }) {\n if (error) {\n return (\n \n \n {error}\n

\n );\n }\n\n return null;\n}\n","import React from 'react';\nimport { ballBlue } from '../../../../themes/globalConstants';\nimport { makeStyles } from '@material-ui/core/styles';\nimport { CircularProgress } from '@material-ui/core';\n\nexport enum PasswordResetState {\n Loading,\n Success,\n Failure\n}\n\nexport interface Props {\n state: PasswordResetState;\n email: string;\n}\n\nconst useStyles = makeStyles((theme) => ({\n container: {\n display: 'flex',\n justifyContent: 'center',\n aligItems: 'center',\n padding: '2rem'\n },\n loader: {\n color: ballBlue,\n marginBottom: '2rem !important'\n }\n}));\n\nexport default function PasswordResetConfirmation({ state, email }: Props) {\n const classes = useStyles();\n\n const handleBackToSignIn = () => {\n window.location.href = '/source/login';\n };\n return (\n <>\n {state === PasswordResetState.Loading && (\n
\n \n
\n )}\n {state === PasswordResetState.Success && (\n
\n

Email incoming!

\n

\n An email will be sent to {email} with instructions on resetting your\n password. Please wait at least 15 minutes for the email to arrive period.\n

\n \n Back to Sign In\n \n
\n )}\n {state === PasswordResetState.Failure && (\n
\n \n \n There has been an error while attempting to reset your password.\n

\n \n Back to Sign In\n \n
\n )}\n \n );\n}\n","import React, { useEffect, useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport { useOktaAuth } from '@okta/okta-react';\nimport OktaSignIn from '@okta/okta-signin-widget';\nimport '@okta/okta-signin-widget/dist/css/okta-sign-in.min.css';\nimport { makeStyles, useTheme } from '@material-ui/core';\nimport { ltAliceBlue } from '../../../../themes/globalConstants';\nimport OktaValidationError from './OktaValidationError';\nimport PasswordResetConfirmation, { PasswordResetState } from './PasswordResetConfirmation';\nimport UserService from '../../../../utility/services/user-service';\nimport { GetFeatureFlag, FlagTypes } from '../../../../utility/helpers/feature-flag';\nimport { isValidEmail } from '../../../../utility/helpers/user-helpers';\n\nimport Modal from '../../../reusable/molecules/Modal';\nimport ContactForm from '../../../reusable/molecules/ContactForm';\nimport { Trans } from 'react-i18next';\nimport { BrowserRouter, Link } from 'react-router-dom';\nimport ErrorAlert from '../../../reusable/atoms/ErrorAlert';\nimport { Grid } from '@material-ui/core';\n\ninterface Props {\n issuer: string;\n clientId: string;\n redirectUri: string;\n}\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n position: 'fixed',\n top: 0,\n left: 0,\n height: '100vw',\n maxHeight: '100%',\n width: '100vw',\n maxWidth: '100%',\n background: theme.palette.common.white\n },\n footer: {\n position: 'fixed',\n bottom: 0,\n width: '100%'\n },\n // another option may be the sass files from https://github.com/okta/okta-signin-widget/tree/master/assets/sass\n oktaContainer: {\n '& .auth-container': {\n // overall container style\n backgroundColor: `${ltAliceBlue} !important`,\n border: 'none !important'\n },\n '& .auth-header': {\n // overall header style\n padding: '30px 60px !important',\n borderBottom: 'none !important'\n },\n '& .auth-org-logo': {\n height: '100%',\n maxHeight: '80px !important',\n width: '100%',\n maxWidth: 'none !important',\n objectFit: 'cover'\n },\n '& .auth-content': {\n // style of content\n },\n '& .link': {\n // links within auth\n },\n '& .o-form-head': {\n // Sign In h2 label\n },\n '& .o-form-input-container': {\n // container that surrounds input controls\n },\n '& .o-form-label': {\n // label for form fields\n },\n '& .o-form-control': {\n // span that surrounds an input field\n },\n '& .custom-checkbox': {\n // remember me checkbox\n }\n },\n modal: {\n '& .MuiPaper-root': {\n maxWidth: '40.5em'\n },\n '& .MuiDialog-paperScrollPaper': {\n borderRadius: 'unset',\n overflow: 'hidden'\n },\n '& .MuiDialogTitle-root': {\n justifyContent: 'center',\n marginLeft: '2.5em'\n }\n }\n}));\n\nexport default function OktaLoginForm(props: Props) {\n const { authService } = useOktaAuth();\n const theme = useTheme();\n const [isActive, setIsActive] = useState(false);\n\n // useRef is used here because useState values can't be referenced by event listeners needed for password reset\n const recoveryEmail = React.useRef('');\n const [email, setEmail] = useState('');\n const [resetPasswordState, setResetPasswordState] = useState(\n PasswordResetState.Loading\n );\n const [validationErrorMessage, setValidationErrorMessage] = useState('');\n const [recoveryValidationErrorMessage, setRecoveryValidationErrorMessage] =\n useState('');\n const [nextHasBeenClicked, setNextHasBeenClicked] = useState(false);\n const [errorWrapperIsAppended, setErrorWrapperIsAppended] = useState(false);\n const classes = useStyles();\n const internalPasswordResetFeatureFlag =\n GetFeatureFlag(FlagTypes.InternalPasswordReset) ?? false;\n\n const [open, setOpen] = useState(false);\n const closeContactForm = () => {\n setOpen(false);\n };\n const openContactForm = () => {\n setOpen(true);\n };\n\n useEffect(() => {\n const isActive = Boolean(localStorage.getItem('inactive'));\n if (isActive) {\n setIsActive(isActive);\n localStorage.removeItem('inactive');\n }\n }, []);\n\n useEffect(() => {\n const addHelpLinkContactForm = () => {\n const helpLink = document.getElementsByClassName('js-help-link')[0] as HTMLInputElement;\n helpLink.remove();\n\n const helpLinksContainer = document.getElementById(\n 'help-links-container'\n ) as HTMLInputElement;\n\n if (helpLinksContainer) {\n const tempLi = document.createElement('li');\n\n let newHelpLink: any = (\n \n \n Help\n \n \n );\n ReactDOM.render(newHelpLink, tempLi);\n helpLinksContainer.appendChild(tempLi);\n }\n };\n\n const handlePasswordReset = async () => {\n if (!isValidEmail(recoveryEmail.current)) {\n setRecoveryValidationErrorMessage('Please enter a valid email address');\n } else {\n setRecoveryValidationErrorMessage('');\n\n // Swap widget's auth-content div with PasswordResetConfirmation component\n const authContent = document.getElementsByClassName('auth-content')[0];\n if (authContent) {\n authContent.innerHTML = '
';\n const wrapper = document.getElementById('password-reset-confirmation');\n ReactDOM.render(\n ,\n wrapper\n );\n }\n\n const response = await UserService.resetUserPassword(recoveryEmail.current).catch(\n (error) => {\n setResetPasswordState(PasswordResetState.Failure);\n }\n );\n if (response && response.status === 204)\n setResetPasswordState(PasswordResetState.Success);\n else setResetPasswordState(PasswordResetState.Failure);\n }\n };\n\n const addPasswordRecoveryListeners = () => {\n recoveryEmail.current = '';\n setRecoveryValidationErrorMessage('');\n\n const recoveryEmailInput = document.getElementById(\n 'account-recovery-username'\n ) as HTMLInputElement;\n\n if (recoveryEmailInput) {\n if (!document.getElementById('okta-recovery-validation-error-wrapper'))\n recoveryEmailInput.parentElement?.insertAdjacentHTML(\n 'afterend',\n '
'\n );\n\n if (recoveryEmailInput.value) recoveryEmail.current = recoveryEmailInput.value;\n\n recoveryEmailInput.addEventListener('input', (event) => {\n const value = (event.target as HTMLInputElement).value;\n recoveryEmail.current = value;\n });\n }\n\n const resetPasswordByEmailButton = document.getElementsByClassName(\n 'email-button'\n )[0] as HTMLInputElement;\n\n if (resetPasswordByEmailButton) {\n // clone the button and remove the original, which does away with the original button's event listeners\n let clone: any = resetPasswordByEmailButton.cloneNode(true);\n resetPasswordByEmailButton.parentNode?.appendChild(clone);\n resetPasswordByEmailButton.remove();\n clone.onclick = handlePasswordReset;\n }\n };\n\n const signIn = new OktaSignIn({\n baseUrl: props.issuer.split('/oauth2')[0],\n logo: '/source/assets/TheSourceByBall_Logo.svg',\n brandName: 'Customer Portal',\n authParams: {\n pkce: true\n },\n features: {\n idpDiscovery: true,\n autoPush: true,\n multiOptionalFactorEnroll: true,\n // smsRecovery and callRecovery options can be turned back on when these recovery methods are fixed in Okta\n // smsRecovery: true,\n // callRecovery: true,\n registration: true\n },\n colors: {\n brand: theme.palette.primary.main\n },\n idpDiscovery: {\n requestContext: window.location.href\n },\n i18n: {\n en: {\n 'primaryauth.username.placeholder': 'Email',\n 'primaryauth.username.tooltip': 'Email'\n }\n },\n registration: {\n click: function () {\n window.location.href = '/source/registration';\n }\n }\n });\n // When the Okta widget renders, if the state is 'forgot-password'...\n // add event listeners to change to our internal password-recovery email flow\n signIn.on('afterRender', (context) => {\n if (context.controller === 'forgot-password' && internalPasswordResetFeatureFlag)\n addPasswordRecoveryListeners();\n if (context.controller === 'idp-discovery') addHelpLinkContactForm();\n });\n signIn.authClient.session.exists().then((exists) => {\n if (exists) {\n signIn.authClient.session.get().then((session) => {\n authService.redirect({ sessionToken: session.id });\n });\n } else {\n signIn.renderEl(\n {\n el: '#auth-container'\n },\n function success(res) {\n // The user has started the password recovery flow, and is on the confirmation\n // screen letting them know that an email is on the way.\n if (res.status === 'FORGOT_PASSWORD_EMAIL_SENT') {\n // Any followup action you want to take\n return;\n }\n\n // The user has started the unlock account flow, and is on the confirmation\n // screen letting them know that an email is on the way.\n if (res.status === 'UNLOCK_ACCOUNT_EMAIL_SENT') {\n // Any followup action you want to take\n return;\n }\n\n // IDP Discovery login\n if (res.status === 'IDP_DISCOVERY') {\n // followed from https://support.okta.com/help/s/article/Relay-state-lost-when-using-IDP-Discovery-in-Sign-In-widget\n res.idpDiscovery.redirectToIdp();\n\n // may need to visit https://github.com/okta/okta-signin-widget/issues/734\n // and https://github.com/okta/okta-signin-widget/issues/566\n // for stuff around session.get to get token if this doesnt auto work\n // but hoping the status === success will do redirect for us\n }\n\n // Successful login\n if (res.status === 'SUCCESS') {\n authService.redirect({ sessionToken: res.session.token });\n }\n },\n function (error) {\n console.log(error);\n }\n );\n }\n });\n\n // timeout is needed to ensure okta-signin-widget is loaded before accessing DOM elements\n setTimeout(() => {\n let emailInputElement = document.getElementById(\n 'idp-discovery-username'\n ) as HTMLInputElement;\n\n if (emailInputElement) {\n // prevent form submission with enter key when invalid\n emailInputElement.onkeyup = (e) => {\n if (e.key === 'Enter') e.stopImmediatePropagation();\n };\n // track widget's email input with a listener\n emailInputElement.addEventListener('input', (event) => {\n const value = (event.target as HTMLInputElement).value;\n setEmail(value);\n });\n // append an empty wrapper div to contain the validation error component\n emailInputElement.insertAdjacentHTML(\n 'afterend',\n '
'\n );\n setErrorWrapperIsAppended(true);\n\n //initialize from remembered value\n if (emailInputElement.value) {\n setEmail(emailInputElement.value);\n }\n }\n }, 500);\n\n return () => signIn.remove();\n }, [props.issuer, theme, authService, internalPasswordResetFeatureFlag]);\n\n useEffect(() => {\n if (!isValidEmail(email) && errorWrapperIsAppended)\n setValidationErrorMessage('Please enter a valid email address');\n else setValidationErrorMessage('');\n }, [email, errorWrapperIsAppended]);\n\n useEffect(() => {\n let wrapper = document.getElementById(\n 'okta-recovery-validation-error-wrapper'\n ) as HTMLElement;\n if (wrapper)\n ReactDOM.render(\n ,\n wrapper\n );\n }, [recoveryValidationErrorMessage]);\n\n useEffect(() => {\n // find the appended error wrapper in the DOM and render the validation error component inside\n let wrapper = document.getElementById('okta-validation-error-wrapper');\n if (wrapper && nextHasBeenClicked)\n ReactDOM.render(, wrapper);\n\n // when next button is clicked, set nextHasBeenClicked so validation message will be shown\n let clickHandler = (event: any) => {\n setNextHasBeenClicked(true);\n };\n\n // if a validation message exists, prevent the next button from submitting the form\n if (validationErrorMessage) {\n clickHandler = (event) => {\n setNextHasBeenClicked(true);\n event.preventDefault();\n };\n }\n\n // find the next button in the DOM and set the click handler\n let nextButton = document.getElementById('idp-discovery-submit');\n if (nextButton) nextButton.onclick = clickHandler;\n }, [validationErrorMessage, nextHasBeenClicked]);\n\n useEffect(() => {\n const wrapper = document.getElementById('password-reset-confirmation');\n if (wrapper) {\n ReactDOM.render(\n ,\n wrapper\n );\n }\n }, [resetPasswordState]);\n\n return (\n
\n
\n \n \n \n \n \n How Can We Help?}\n closeIcon={true}\n fullWidth={true}\n className={classes.modal}\n >\n {}\n \n
\n
\n );\n}\n","import React from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport LoadingIndicator from '../../reusable/atoms/LoadingIndicator';\nimport { Redirect } from 'react-router-dom';\nimport OktaLoginForm from './components/OktaLoginForm';\n\ninterface Props {\n issuer: string;\n redirectUri: string;\n clientId: string;\n}\n\nexport default function LoginPage(props: Props) {\n const { authState } = useOktaAuth();\n\n if (authState.isPending) {\n return ;\n }\n\n if (authState.isAuthenticated) {\n return ;\n }\n\n return ;\n}\n"],"names":["OktaValidationError","_ref","error","_jsxs","className","style","display","role","children","_jsx","PasswordResetState","useStyles","makeStyles","theme","container","justifyContent","aligItems","padding","loader","color","ballBlue","marginBottom","PasswordResetConfirmation","state","email","classes","handleBackToSignIn","window","location","href","_Fragment","Loading","CircularProgress","size","Success","onClick","Failure","root","position","top","left","height","maxHeight","width","maxWidth","background","palette","common","white","footer","bottom","oktaContainer","backgroundColor","concat","ltAliceBlue","border","borderBottom","objectFit","modal","borderRadius","overflow","marginLeft","OktaLoginForm","props","_GetFeatureFlag","authService","useOktaAuth","useTheme","_useState","useState","_useState2","_slicedToArray","isActive","setIsActive","recoveryEmail","React","_useState3","_useState4","setEmail","_useState5","_useState6","resetPasswordState","setResetPasswordState","_useState7","_useState8","validationErrorMessage","setValidationErrorMessage","_useState9","_useState10","recoveryValidationErrorMessage","setRecoveryValidationErrorMessage","_useState11","_useState12","nextHasBeenClicked","setNextHasBeenClicked","_useState13","_useState14","errorWrapperIsAppended","setErrorWrapperIsAppended","internalPasswordResetFeatureFlag","GetFeatureFlag","FlagTypes","InternalPasswordReset","_useState15","_useState16","open","setOpen","closeContactForm","openContactForm","useEffect","Boolean","localStorage","getItem","removeItem","handlePasswordReset","_asyncToGenerator","_regeneratorRuntime","_callee","authContent","wrapper","response","_context","prev","next","isValidEmail","current","document","getElementsByClassName","innerHTML","getElementById","ReactDOM","UserService","resetUserPassword","catch","sent","status","stop","apply","arguments","signIn","OktaSignIn","baseUrl","issuer","split","logo","brandName","authParams","pkce","features","idpDiscovery","autoPush","multiOptionalFactorEnroll","registration","colors","brand","primary","main","requestContext","i18n","en","click","on","context","controller","_recoveryEmailInput$p","recoveryEmailInput","parentElement","insertAdjacentHTML","value","addEventListener","event","target","resetPasswordByEmailButton","_resetPasswordByEmail","clone","cloneNode","parentNode","appendChild","remove","onclick","addPasswordRecoveryListeners","helpLinksContainer","tempLi","createElement","newHelpLink","BrowserRouter","basename","Link","to","addHelpLinkContactForm","authClient","session","exists","then","get","redirect","sessionToken","id","renderEl","el","res","redirectToIdp","token","console","log","setTimeout","emailInputElement","onkeyup","e","key","stopImmediatePropagation","clickHandler","preventDefault","nextButton","Grid","item","xs","justify","alignItems","ErrorAlert","errorMessage","showError","textCenter","dataTestId","Modal","close","title","Trans","i18nKey","closeIcon","fullWidth","ContactForm","messageType","onClose","LoginPage","authState","isPending","LoadingIndicator","isAuthenticated","Redirect","_objectSpread"],"sourceRoot":""}