{"version":3,"sources":["app/components/BasicLinks/ButtonLink/index.tsx","app/components/Forms/FormRecaptcha.tsx","app/pages/LoginPage/Components/ContentTitle.tsx","app/pages/LoginPage/Components/LoginWrapper.tsx","app/pages/LoginPage/slice/saga.ts","app/pages/LoginPage/LoginApi.ts","app/pages/LoginPage/slice/index.ts","app/pages/LoginPage/slice/types.ts","app/pages/LoginPage/slice/selectors.ts","app/pages/LoginPage/Components/LoginPanel.tsx","app/pages/LoginPage/Components/SSO_ON.tsx","app/pages/LoginPage/Components/Timer.tsx","app/pages/LoginPage/Components/TwoFactorAuthentication.tsx","app/pages/LoginPage/index.tsx","app/pages/LoginPage/Hooks/useLoginState.tsx"],"names":["ButtonLink","props","StyledLink","color","href","undefined","id","styled","Link","theme","cursor","FormRecaptcha","label","name","onChange","useField","field","meta","helpers","recaptchaRef","React","error","className","fullWidth","title","variant","ref","sitekey","size","badge","value","setValue","defaultValue","TitleSection","display","alignItems","flexDirection","justifyContent","gap","alignSelf","width","paddingBottom","breakpoints","down","ContentTitle","help_Login","description","isMobile","showTopProcessing","useTheme","showHelp","setShowHelp","show_help","trim","BasicAlert","content","type","message","parse","closable","onClose","Box","style","LinearProgress","Wrapper","padding","height","overflowY","border","bookitColors","primary","componentsLight","borderRadius","maxWidth","LoginWrapper","children","pageTitle","pageDescription","disabled","contentMaxWidth","checkIsMobile","useIsMobile","t","useTranslation","loginFooter","translations","LoginFooter","pointerEvents","doLogin","LoginSaga","api","LoginUser","item","httpClient","post","SSOLoginUrl","returnUrl","data","get","SendVerificationCode","CodeVerification","model","action","call","payload","put","actions","login_Success","console","login_Error","takeLatest","login","SignInStatus","SignInFailureReasons","initialState","processing","loginBadAttempts","slice","createSlice","reducers","state","Response","setProvider","Provider","increaseBadAttempts","clearBadAttempts","loginActions","selectLogin","createSelector","loginPage","selectBadAttempts","UserPasswordForm","initial","formRef","onSubmit","submitting","showRememberMe","SSOSubmit","appSettings","useSelector","selectAppSettings","useState","rememberMe","setRememberMe","schema","useMemo","Yup","UserName","required","mobileTabletVersion","Password","RememberMe","default","Recaptcha","reg_CaptchaRequired","nullable","handleCheckboxChange","event","target","checked","showForgotPassword","ShowForgotPassword","innerRef","validationSchema","initialValues","validateOnMount","validateOnBlur","values","formikHelpers","a","setSubmitting","formik","handleSubmit","avoidStyles","fullRow","FormTextField","placeholder","isSubmitting","autoComplete","EnterPassCode","BasicCheckBox","toRootedURL","IForgotPassword","Button","SignIn","onClick","auth_ShibbolethLoginLinkText","LoginButtons","SelectLoginType","onSSO_ON_Submit","onSSO_OFF_Submit","SignInWithCredentials","MyTimer","useTimer","expiryTimestamp","getTime","onExpire","seconds","minutes","start","useEffect","textAlign","fontSize","TwoFactorAuthenticationForm","canceled","setCanceled","oneRef","useRef","twoRef","threeRef","fourRef","fiveRef","sixRef","one","notRequired","two","three","four","five","six","handleKeyUp","useCallback","curr","next","current","focus","handleLastKeyUp","handleExpire","time","Date","setSeconds","getSeconds","inputProps","maxLength","inputRef","onKeyUp","submitForm","paddingTop","Cancel","LoginPage","dispatch","useDispatch","useAppSettingsSlice","appSettingsActions","location","useLocation","settings","selectglobalSettings","useInjectReducer","key","reducer","useInjectSaga","saga","isLoading","selectLoading","resposeData","setResposeData","setProcessiong","DetectIsMobile","showSSO","IsModuleEnabled","KnownModules","ShibbolethAuthentication","OAuth","showNewUser","GetBoolean","AllowedSettings","NewUsersSignupForm","HideLinkToRegistrationForm","v","GetString","SessionTimeout_Persistent","parseInt","loginState","setLoginState","prevLoginState","setPrevLoginState","checkLoginResult","Result","Success","RedirectUrl","url","trimStart","includes","window","replace","RequiresVerification","LockedOut","ErrorMessages","forEach","e","addNotification","Failure","FailureReasons","MustChangePassword","PasswordExpired","handleSSOOFFSubmit","PageUrl","handleSSO_ON_Submit","params","URLSearchParams","search","param","handleSSO_OFF_Submit","handle2FASubmit","code","Code","reSend","rd","ReSend","history","useHistory","ssooffRef","twoFARef","LogInToYourAccount","TwoFactorAuthenticationIsRequired","JoinYourLaboratoryAsA","push","NewUser","HaventReceivedTheCode","useLoginState","MainContent","useEffectOnMount","has","msg","setBarcodeScannigTarget","ScanTarget","Login","All","Help_Login"],"mappings":";wLA+Be,SAASA,EAAWC,GACjC,OACE,cAACC,EAAD,aACEC,MAAOF,EAAME,MACbC,UAAqBC,IAAfJ,EAAMG,KAAqBH,EAAMG,KAAO,IAC9CE,GAAIL,EAAMK,IACNL,IAIV,IAAMC,EAAaK,YAAOC,IAAPD,EAAa,cAAGE,MAAH,MAAgB,CAC9CC,OAAQ,e,gJChCGC,EAAgB,SAAC,GAK2C,EAJvEC,MAIwE,IAAD,EAHvEC,EAGuE,EAHvEA,KAEGZ,GACoE,EAFvEa,SAEuE,8CACxCC,YAAQ,aAAkBF,QAASZ,IADK,mBAChEe,EADgE,KACzDC,EADyD,KACnDC,EADmD,KASjEC,EAAeC,SAAwB,MAC7C,OACE,eAAC,IAAD,CACEC,WAAuBhB,KAAZ,OAAJY,QAAI,IAAJA,OAAA,EAAAA,EAAMI,OACbC,UAAWrB,EAAMqB,UACjBC,WAAW,EACXC,MAAO,YACPC,QAAQ,WALV,UAOE,cAAC,IAAD,CACEC,IAAKP,EACLQ,QAlBsB,2CAmBtBC,KAAK,SACLC,MAAM,SACNf,SAAU,SAAAgB,GACRZ,EAAQa,SAASD,GAAO,IAE1BE,aAAY,UAAEhB,EAAMc,aAAR,aAAiBzB,IAG/B,cAAC,IAAD,UAAiBY,EAAKI,a,iPC7BfY,EAAe1B,YAAO,MAAPA,EAAc,gBAAGE,EAAH,EAAGA,MAAH,MAAgB,CACxD,iBAAkB,CAChByB,QAAS,OACTC,WAAY,SACZC,cAAe,SACfC,eAAgB,SAChBC,IAAK,EACLC,UAAW,UACXC,MAAO,OACP,iBAAiB,aACfN,QAAS,OACTO,cAAe,OACfN,WAAY,aACZG,IAAK,OACLC,UAAW,UACXH,cAAe,UACd3B,EAAMiC,YAAYC,KAAK,MAAQ,CAC9BF,cAAe,cAKhB,SAASG,EAAa3C,GAA2B,IAC9C4C,EA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G,IApP6C,qBA2OxCvO,GA3OwC,MA2O7BC,GA3O6B,MA2OZoP,GA3OY,MA6Q/C,OAvBAC,cAAiB,WACf,GAAI,IAAItB,gBAAgBxD,EAASyD,QAAQsB,IAAI,OAAQ,CACnD,IAAMC,EAAM,IAAIxB,gBAAgBxD,EAASyD,QAAQ3M,IAAI,OACjDkO,GACFpF,EACEtI,EAAQyL,gBAAgB,CACtB1Q,QAAS,QACTgC,QAAS2Q,SAMnBF,cAAiB,WAEf,OADAlF,EAASG,EAAmBkF,wBAAwBC,KAAWC,QACxD,WACLvF,EAASG,EAAmBkF,wBAAwBC,KAAWE,UAGnEpT,IAAMoL,WAAU,WACJ0E,EAAVf,EAAwB,QAAyB,kBAChD,CAACA,IAEGN,EACL,mCAAG,KAEH,cAACnL,EAAD,CACE7B,WAAU,OAAE6F,QAAF,IAAEA,OAAF,EAAEA,EAAa+L,WACzB7P,UAAWA,GACX5B,kBAAmBmE,EACnBtC,gBAAiBA,GACjBC,SAAUqC,EACVpC,gBAAiB,IANnB,SAQKkP,IAA4B","file":"static/js/742.b5e7b10f.chunk.js","sourcesContent":["/**\r\n *\r\n * ButtonLink\r\n *\r\n */\r\nimport React from 'react';\r\nimport { Link, styled } from '@material-ui/core';\r\n\r\nexport interface ButtonLinkProps {\r\n children: React.ReactNode;\r\n onClick?: React.MouseEventHandler &\r\n React.MouseEventHandler &\r\n React.MouseEventHandler;\r\n className?: string;\r\n id?: string;\r\n href?: string;\r\n color?:\r\n | 'inherit'\r\n | 'initial'\r\n | 'primary'\r\n | 'secondary'\r\n | 'textPrimary'\r\n | 'textSecondary'\r\n | 'error';\r\n}\r\n\r\n/**\r\n * Button styles as a Link\r\n * @param param0\r\n * @returns\r\n */\r\nexport default function ButtonLink(props: ButtonLinkProps) {\r\n return (\r\n \r\n );\r\n}\r\nconst StyledLink = styled(Link)(({ theme }) => ({\r\n cursor: 'pointer',\r\n}));\r\n","import * as React from 'react';\r\nimport { FieldHookConfig, useField } from 'formik';\r\nimport { FormControl, FormHelperText } from '@material-ui/core';\r\nimport { IFieldProps } from './FormRender/IFormFieldSetting';\r\nimport ReCAPTCHA from 'react-google-recaptcha';\r\n\r\nexport interface FormRecaptchaProps {\r\n label?: string;\r\n helperText?: string;\r\n}\r\nexport const FormRecaptcha = ({\r\n label,\r\n name,\r\n onChange,\r\n ...props\r\n}: FormRecaptchaProps & FieldHookConfig & IFieldProps) => {\r\n const [field, meta, helpers] = useField({ name, ...props });\r\n const BOOKIT_APP_SITE_KEY = '6LcO4i4UAAAAAP5iOaE1ZUNS_6FjUg0j_FYvZrF-';\r\n // const handleChange = e => {\r\n // if (onChange !== undefined) {\r\n // onChange(e);\r\n // }\r\n // field.onChange(e);\r\n // };\r\n const recaptchaRef = React.useRef(null);\r\n return (\r\n \r\n {\r\n helpers.setValue(value, true);\r\n }}\r\n defaultValue={field.value ?? undefined}\r\n />\r\n\r\n {meta.error}\r\n \r\n );\r\n};\r\n","import * as React from 'react';\r\nimport { H2, H4 } from 'app/components/Typography';\r\nimport { Body } from 'app/components/Typography';\r\nimport { Box, LinearProgress, useTheme } from '@material-ui/core';\r\nimport { BasicAlert } from 'app/components/BasicAlert';\r\nimport parse from 'html-react-parser';\r\nimport styled from 'styled-components';\r\n\r\nexport interface ContentTitleProps {\r\n help_Login?: string | null;\r\n title?: React.ReactNode;\r\n description?: React.ReactNode;\r\n isMobile?: boolean;\r\n showTopProcessing?: boolean;\r\n}\r\nexport const TitleSection = styled('div')(({ theme }) => ({\r\n '&.titleSection': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n flexDirection: 'column',\r\n justifyContent: 'center',\r\n gap: 8,\r\n alignSelf: 'stretch',\r\n width: '100%',\r\n '& .logoSection': {\r\n display: 'flex',\r\n paddingBottom: '24px',\r\n alignItems: 'flex-start',\r\n gap: '10px',\r\n alignSelf: 'stretch',\r\n flexDirection: 'column',\r\n [theme.breakpoints.down('sm')]: {\r\n paddingBottom: '12px',\r\n },\r\n },\r\n },\r\n}));\r\nexport function ContentTitle(props: ContentTitleProps) {\r\n const { help_Login, title, description, isMobile, showTopProcessing } = props;\r\n const theme = useTheme();\r\n const [showHelp, setShowHelp] = React.useState(true);\r\n const show_help = React.useMemo(() => {\r\n return (\r\n //!isMobile &&\r\n help_Login !== null &&\r\n help_Login !== undefined &&\r\n help_Login.trim() !== '' &&\r\n showHelp\r\n );\r\n }, [help_Login, showHelp]);\r\n return (\r\n \r\n {/*
\r\n \r\n
*/}\r\n {!!title && (isMobile ?

{title}

:

{title}

)}\r\n {show_help && help_Login !== undefined && help_Login !== null && (\r\n {\r\n setShowHelp(false);\r\n }}\r\n />\r\n )}\r\n {!!description && {description}}\r\n {showTopProcessing && (\r\n \r\n \r\n \r\n )}\r\n
\r\n );\r\n}\r\n","import { ContentTitle } from './ContentTitle';\r\nimport * as React from 'react';\r\nimport styled from 'styled-components';\r\nimport { useTheme } from '@material-ui/core';\r\nimport { useIsMobile } from 'app/hooks/useIsMobile';\r\nimport parse from 'html-react-parser';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { bookitColors } from 'styles/colors/bookitColors';\r\n\r\nexport interface LoginWrapperProps {\r\n children: React.ReactNode;\r\n help_Login?: string | null;\r\n pageTitle?: React.ReactNode;\r\n pageDescription?: React.ReactNode;\r\n showTopProcessing?: boolean;\r\n disabled: boolean;\r\n contentMaxWidth: number;\r\n}\r\n\r\nexport const Wrapper = styled('div')(({ theme }) => ({\r\n '&.loginWrapperRoot': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'center',\r\n gap: '24px',\r\n flexDirection: 'column',\r\n [theme.breakpoints.down('sm')]: {\r\n padding: '0px 24px 16px 24px',\r\n height: '100%',\r\n overflowY: 'auto',\r\n //justifyContent: 'flex-start',\r\n },\r\n '& .loginFooter': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n border: `1px solid ${bookitColors.primary.componentsLight}`,\r\n borderRadius: '8px',\r\n padding: '12px',\r\n gap: 10,\r\n },\r\n '& .loginContentBody': {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n gap: '16px',\r\n alignSelf: 'center',\r\n maxWidth: '320px',\r\n // height: '100%',\r\n // overflowY: 'auto',\r\n width: '100%',\r\n },\r\n },\r\n}));\r\nexport function LoginWrapper(props: LoginWrapperProps) {\r\n const {\r\n children,\r\n help_Login,\r\n pageTitle,\r\n pageDescription,\r\n showTopProcessing,\r\n disabled,\r\n contentMaxWidth,\r\n } = props;\r\n\r\n const theme = useTheme();\r\n const { checkIsMobile } = useIsMobile();\r\n const isMobile = checkIsMobile();\r\n const { t } = useTranslation();\r\n const loginFooter = React.useMemo(() => {\r\n return t(translations.LoginFooter);\r\n }, [t]);\r\n return (\r\n \r\n \r\n
{children}
\r\n {!!loginFooter && loginFooter !== '' && (\r\n
{parse(loginFooter)}
\r\n )}\r\n \r\n );\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { call, put, takeLatest } from 'redux-saga/effects';\r\nimport { loginActions as actions } from '.';\r\nimport { LoginApi } from '../LoginApi';\r\nimport { LoginUserModel } from './types';\r\n\r\nexport const api = new LoginApi();\r\nfunction* doLogin(action: PayloadAction) {\r\n try {\r\n const data = yield call(api.LoginUser, action.payload);\r\n yield put(actions.login_Success(data));\r\n } catch (error) {\r\n console.error(error);\r\n yield put(actions.login_Error(error as string));\r\n }\r\n}\r\nexport function* LoginSaga() {\r\n yield takeLatest(actions.login.type, doLogin);\r\n}\r\n","import { httpClient } from 'api/HttpClient';\r\nimport {\r\n CodeVerificationModel,\r\n LoginUserModel,\r\n ResponseLoginUserModel,\r\n} from './slice/types';\r\n\r\nexport class LoginApi {\r\n LoginUser = (item: LoginUserModel) => {\r\n return httpClient.post(\r\n `/api/Login/LoginUser`,\r\n item,\r\n );\r\n };\r\n SSOLoginUrl = (returnUrl: string) => {\r\n const data = { returnUrl: returnUrl };\r\n return httpClient.get(`/api/Login/SSOLoginUrl`, data);\r\n };\r\n SendVerificationCode = () => {\r\n return httpClient.post(\r\n `/api/Login/SendVerificationCode`,\r\n );\r\n };\r\n CodeVerification = (model: CodeVerificationModel) => {\r\n return httpClient.post(\r\n `/api/Login/CodeVerification`,\r\n model,\r\n );\r\n };\r\n}\r\n","import { PayloadAction } from '@reduxjs/toolkit';\r\nimport { useInjectReducer, useInjectSaga } from 'redux-injectors';\r\nimport { createSlice } from 'utils/@reduxjs/toolkit';\r\nimport { LoginSaga } from './saga';\r\nimport {\r\n LoginPageState,\r\n LoginUserModel,\r\n ResponseLoginUserModel,\r\n} from './types';\r\n\r\nexport const initialState: LoginPageState = {\r\n processing: false,\r\n loginBadAttempts: 0,\r\n};\r\n\r\nconst slice = createSlice({\r\n name: 'loginPage',\r\n initialState,\r\n reducers: {\r\n login(state, action: PayloadAction) {\r\n state.processing = true;\r\n },\r\n login_Success(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.Response = action.payload;\r\n },\r\n login_Error(state, action: PayloadAction) {\r\n state.processing = false;\r\n state.error = action.payload;\r\n },\r\n setProvider(state, action: PayloadAction) {\r\n if (state.Response !== undefined) {\r\n state.Response.Provider = action.payload;\r\n }\r\n },\r\n increaseBadAttempts(state) {\r\n state.loginBadAttempts = state.loginBadAttempts + 1;\r\n },\r\n clearBadAttempts(state) {\r\n state.loginBadAttempts = 0;\r\n },\r\n },\r\n});\r\n\r\nexport const { actions: loginActions } = slice;\r\n\r\nexport const useLoginSlice = () => {\r\n useInjectReducer({ key: slice.name, reducer: slice.reducer });\r\n useInjectSaga({ key: slice.name, saga: LoginSaga });\r\n return { actions: slice.actions };\r\n};\r\n","import { IResponseType } from 'types/ResponseType';\r\n\r\n/* --- STATE --- */\r\nexport interface LoginPageState {\r\n processing: boolean;\r\n error?: string;\r\n Response?: ResponseLoginUserModel;\r\n loginBadAttempts: number;\r\n}\r\n\r\nexport interface LoginUserModel {\r\n UserName: string | null;\r\n Password: string | null;\r\n RememberMe: boolean;\r\n PageUrl: string;\r\n Recaptcha: string | null;\r\n}\r\n\r\nexport interface ResponseLoginUserModel extends IResponseType {\r\n Result: SignInStatus;\r\n FailureReasons?: SignInFailureReasons;\r\n RedirectUrl: string | null;\r\n Provider: string | null;\r\n}\r\n\r\nexport interface CodeVerificationModel {\r\n Provider: string;\r\n Code: string;\r\n RememberMe: boolean;\r\n}\r\n\r\nexport enum SignInStatus {\r\n Success = 0,\r\n LockedOut = 1,\r\n RequiresVerification = 2,\r\n Failure = 3,\r\n}\r\n\r\nexport enum SignInFailureReasons {\r\n Success,\r\n PasswordExpired,\r\n MustChangePassword,\r\n}\r\n","import { createSelector } from '@reduxjs/toolkit';\r\nimport { RootState } from 'types';\r\nimport { initialState } from '.';\r\n\r\nconst selectSlice = (state: RootState) => state.loginPage || initialState;\r\nexport const selectLogin = createSelector([selectSlice], state => state);\r\nexport const selectProcessing = createSelector(\r\n [selectLogin],\r\n state => state.processing,\r\n);\r\nexport const selectResponse = createSelector(\r\n [selectLogin],\r\n state => state.Response,\r\n);\r\nexport const selectBadAttempts = createSelector(\r\n [selectLogin],\r\n state => state.loginBadAttempts,\r\n);\r\n","import { SchemaOf } from 'yup';\r\nimport * as Yup from 'yup';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { MobileTabletVersion, UserPasswordRemember } from './type';\r\nimport React from 'react';\r\nimport ButtonLink from 'app/components/BasicLinks/ButtonLink';\r\nimport { useSelector } from 'react-redux';\r\nimport { selectAppSettings } from 'app/slice/selectors';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { FormRecaptcha } from 'app/components/Forms/FormRecaptcha';\r\nimport { selectBadAttempts } from '../slice/selectors';\r\nimport { BasicCheckBox } from 'app/components/BasicCheckBox';\r\n\r\nexport interface UserPasswordFormProps {\r\n initial: UserPasswordRemember;\r\n showRememberMe: boolean;\r\n onSubmit: (item: UserPasswordRemember) => void;\r\n SSOSubmit?: () => void;\r\n formRef: React.MutableRefObject | null>;\r\n submitting?: boolean;\r\n mobileTabletVersion?: MobileTabletVersion;\r\n}\r\n\r\nexport function UserPasswordForm(props: UserPasswordFormProps) {\r\n const {\r\n initial,\r\n formRef,\r\n onSubmit,\r\n submitting,\r\n showRememberMe,\r\n SSOSubmit,\r\n } = props;\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const loginBadAttempts = useSelector(selectBadAttempts);\r\n const [rememberMe, setRememberMe] = React.useState(true);\r\n const schema: SchemaOf = React.useMemo(() => {\r\n let result: SchemaOf;\r\n if (loginBadAttempts >= 3) {\r\n result = Yup.object({\r\n UserName: Yup.string()\r\n .required()\r\n .label(\r\n props.mobileTabletVersion !== undefined ? 'Email' : 'UserName',\r\n ),\r\n Password: Yup.string().required(),\r\n RememberMe: Yup.boolean().default(initial.RememberMe),\r\n Recaptcha: Yup.string()\r\n .label(t(translations.Recaptcha) as string)\r\n .required(t(translations.reg_CaptchaRequired) as string)\r\n .nullable(true),\r\n });\r\n return result;\r\n } else {\r\n result = Yup.object({\r\n UserName: Yup.string()\r\n .required()\r\n .label(\r\n props.mobileTabletVersion !== undefined ? 'Email' : 'UserName',\r\n ),\r\n Password: Yup.string().required(),\r\n RememberMe: Yup.boolean().default(initial.RememberMe),\r\n Recaptcha: Yup.string().nullable().default(''),\r\n });\r\n return result;\r\n }\r\n }, [initial.RememberMe, loginBadAttempts, props.mobileTabletVersion, t]);\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(value);\r\n }\r\n };\r\n const handleCheckboxChange = (value, event) => {\r\n setRememberMe(event.target.checked);\r\n };\r\n const showForgotPassword = appSettings?.ShowForgotPassword;\r\n /*IsModuleEnabled(\r\n appSettings,\r\n KnownModules.ForgotPassword,\r\n );*/\r\n return (\r\n <>\r\n {\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {loginBadAttempts >= 3 && (\r\n \r\n \r\n \r\n )}\r\n \r\n \r\n {showRememberMe && (\r\n \r\n )}\r\n {showForgotPassword && (\r\n \r\n {t(translations.IForgotPassword)}\r\n \r\n )}\r\n {/*
\r\n \r\n
\r\n {showForgotPassword && (\r\n
\r\n
\r\n \r\n {t(translations.IForgotPassword)}\r\n \r\n
\r\n
\r\n )} */}\r\n \r\n
\r\n\r\n \r\n {\r\n //formik.submitForm();\r\n }}*/\r\n disabled={submitting}\r\n type=\"submit\"\r\n >\r\n {t(translations.SignIn) as string}\r\n \r\n \r\n {SSOSubmit && (\r\n \r\n \r\n {t(translations.auth_ShibbolethLoginLinkText)}\r\n \r\n \r\n )}\r\n
\r\n
\r\n
\r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n}\r\n","import { useTheme } from '@material-ui/core';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { translations } from 'locales/translations';\r\nimport { useTranslation } from 'react-i18next';\r\nimport styled from 'styled-components';\r\n\r\nexport interface SelectLoginTypeProps {\r\n onSSO_ON_Submit: () => void;\r\n onSSO_OFF_Submit: () => void;\r\n}\r\nexport const LoginButtons = styled('div')(({ theme }) => ({\r\n display: 'flex',\r\n flexDirection: 'column',\r\n alignItems: 'flex-start',\r\n gap: '16px',\r\n alignSelf: 'stretch',\r\n}));\r\nexport function SelectLoginType(props: SelectLoginTypeProps) {\r\n const { t } = useTranslation();\r\n const theme = useTheme();\r\n return (\r\n \r\n \r\n {t(translations.auth_ShibbolethLoginLinkText)}\r\n \r\n \r\n {t(translations.SignInWithCredentials)}\r\n \r\n \r\n );\r\n}\r\n","import React from 'react';\r\nimport { useTimer } from 'react-timer-hook';\r\n\r\nexport interface MyTimerProps {\r\n title: string;\r\n expiryTimestamp: Date;\r\n onExpire: () => void;\r\n}\r\nexport function MyTimer(props: MyTimerProps) {\r\n const {\r\n seconds,\r\n minutes,\r\n /*hours,\r\n days,\r\n isRunning,*/\r\n start,\r\n /*pause,\r\n resume,\r\n restart,*/\r\n } = useTimer({\r\n expiryTimestamp: props.expiryTimestamp.getTime(),\r\n onExpire: props.onExpire,\r\n });\r\n\r\n React.useEffect(() => {\r\n start();\r\n }, [start]);\r\n return (\r\n
\r\n
\r\n {props.title}\r\n {minutes}:{seconds}\r\n
\r\n
\r\n );\r\n}\r\n","import { SchemaOf } from 'yup';\r\nimport * as Yup from 'yup';\r\nimport { Formik, FormikProps } from 'formik';\r\nimport {\r\n FormFieldsSection,\r\n FormLeftSection,\r\n FormRow,\r\n StyledForm,\r\n} from 'app/components/Forms/FormsLayout';\r\nimport { FormTextField } from 'app/components/Forms/FormTextField';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { translations } from 'locales/translations';\r\nimport { Button } from 'app/components/BasicButtons/Button';\r\nimport { TwoFactorAuthenticationParams } from './type';\r\nimport React, { useRef } from 'react';\r\nimport { MyTimer } from './Timer';\r\n\r\nexport interface TwoFactorAuthenticationProps {\r\n initial: TwoFactorAuthenticationParams;\r\n onSubmit: (item: TwoFactorAuthenticationParams | null) => void;\r\n formRef: React.MutableRefObject | null>;\r\n}\r\n\r\nexport function TwoFactorAuthenticationForm(\r\n props: TwoFactorAuthenticationProps,\r\n) {\r\n const { initial, formRef, onSubmit } = props;\r\n const [canceled, setCanceled] = React.useState(false);\r\n const oneRef = useRef();\r\n const twoRef = useRef();\r\n const threeRef = useRef();\r\n const fourRef = useRef();\r\n const fiveRef = useRef();\r\n const sixRef = useRef();\r\n const schema: SchemaOf = Yup.object({\r\n one: Yup.string().notRequired().nullable(),\r\n two: Yup.string().notRequired().nullable(),\r\n three: Yup.string().notRequired().nullable(),\r\n four: Yup.string().notRequired().nullable(),\r\n five: Yup.string().notRequired().nullable(),\r\n six: Yup.string().notRequired().nullable(),\r\n });\r\n const { t } = useTranslation();\r\n const handleSubmit = value => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(canceled ? null : value);\r\n }\r\n };\r\n const handleKeyUp = React.useCallback((curr, next) => {\r\n if (\r\n curr.current?.value !== undefined &&\r\n curr.current?.value.trim() !== ''\r\n ) {\r\n next.current?.focus();\r\n } else {\r\n if (\r\n curr !== undefined &&\r\n curr !== null &&\r\n curr.current !== undefined &&\r\n curr.current !== null &&\r\n curr.current?.value === ' '\r\n ) {\r\n curr.current.value = '';\r\n }\r\n }\r\n }, []);\r\n const handleLastKeyUp = React.useCallback((curr): boolean => {\r\n if (\r\n curr.current?.value !== undefined &&\r\n curr.current?.value.trim() !== ''\r\n ) {\r\n return true;\r\n } else {\r\n if (\r\n curr !== undefined &&\r\n curr !== null &&\r\n curr.current !== undefined &&\r\n curr.current !== null &&\r\n curr.current?.value === ' '\r\n ) {\r\n curr.current.value = '';\r\n }\r\n return false;\r\n }\r\n }, []);\r\n const handleExpire = React.useCallback(() => {\r\n if (onSubmit !== undefined && onSubmit !== null) {\r\n onSubmit(null);\r\n }\r\n }, [onSubmit]);\r\n const time = new Date();\r\n time.setSeconds(time.getSeconds() + 120);\r\n return (\r\n <>\r\n {\r\n formikHelpers.setSubmitting(true);\r\n handleSubmit(values);\r\n }}\r\n >\r\n {formik => {\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n {\r\n handleKeyUp(oneRef, twoRef);\r\n }}\r\n />\r\n {\r\n handleKeyUp(twoRef, threeRef);\r\n }}\r\n />\r\n {\r\n handleKeyUp(threeRef, fourRef);\r\n }}\r\n />\r\n {\r\n handleKeyUp(fourRef, fiveRef);\r\n }}\r\n />\r\n {\r\n handleKeyUp(fiveRef, sixRef);\r\n }}\r\n />\r\n {\r\n if (handleLastKeyUp(sixRef)) {\r\n setCanceled(false);\r\n formik.submitForm();\r\n }\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {\r\n setCanceled(true);\r\n formik.submitForm();\r\n }}\r\n >\r\n {t(translations.Cancel) as string}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n }}\r\n \r\n \r\n );\r\n}\r\n","import { useAppSettingsSlice } from 'app/slice';\r\nimport {\r\n selectAppSettings,\r\n selectglobalSettings,\r\n selectLoading,\r\n} from 'app/slice/selectors';\r\nimport React from 'react';\r\nimport { useDispatch, useSelector } from 'react-redux';\r\nimport { IBasePageProps } from '../IBasePageProps';\r\nimport { LoginWrapper } from './Components/LoginWrapper';\r\nimport {\r\n LoginState,\r\n TwoFactorAuthenticationParams,\r\n UserPasswordRemember,\r\n} from './Components/type';\r\nimport { useLoginSlice } from './slice';\r\nimport {\r\n CodeVerificationModel,\r\n LoginUserModel,\r\n ResponseLoginUserModel,\r\n SignInFailureReasons,\r\n SignInStatus,\r\n} from './slice/types';\r\nimport { api } from './slice/saga';\r\nimport { useLoginState } from './Hooks/useLoginState';\r\nimport { trimStart } from 'lodash';\r\nimport { IsModuleEnabled } from 'types/AppSettings';\r\nimport { KnownModules } from 'types/KnownModules';\r\nimport { AllowedSettings } from 'utils/globalSettings';\r\nimport { DetectIsMobile } from 'utils/mobileDetect';\r\nimport { useLocation } from 'react-router-dom';\r\nimport { toRootedURL } from 'utils/url-utils';\r\nimport { useEffectOnMount } from 'app/hooks/useEffectOnMount';\r\nimport { ScanTarget } from 'app/slice/types';\r\n\r\n/**\r\n *\r\n * LoginPage\r\n *\r\n */\r\nexport interface LoginPageProps extends IBasePageProps {}\r\n\r\nexport function LoginPage(props: LoginPageProps) {\r\n //const history = useHistory();\r\n const dispatch = useDispatch();\r\n const { actions } = useAppSettingsSlice();\r\n const { actions: appSettingsActions } = useAppSettingsSlice();\r\n const location = useLocation();\r\n //const queryProps = getParams(params, props);\r\n const settings = useSelector(selectglobalSettings);\r\n const appSettings = useSelector(selectAppSettings);\r\n const { actions: loginActions } = useLoginSlice();\r\n const isLoading = useSelector(selectLoading);\r\n const [resposeData, setResposeData] = React.useState<\r\n ResponseLoginUserModel\r\n >();\r\n const [rememberMe, setRememberMe] = React.useState(false);\r\n const [processing, setProcessiong] = React.useState(false);\r\n const isMobile = DetectIsMobile();\r\n const showSSO = React.useMemo(() => {\r\n return (\r\n IsModuleEnabled(appSettings, KnownModules.ShibbolethAuthentication) ||\r\n IsModuleEnabled(appSettings, KnownModules.OAuth)\r\n );\r\n }, [appSettings]);\r\n\r\n const showNewUser = React.useMemo(() => {\r\n return (\r\n settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.NewUsersSignupForm],\r\n ) &&\r\n !settings.GetBoolean(\r\n AllowedSettings[AllowedSettings.HideLinkToRegistrationForm],\r\n )\r\n );\r\n }, [settings]);\r\n\r\n const showRememberMe = React.useMemo(() => {\r\n /*if (isMobile) {\r\n return false;\r\n } else {*/\r\n const v = settings.GetString(AllowedSettings.SessionTimeout_Persistent);\r\n if (v.trim() !== '') {\r\n return parseInt(v) > 0;\r\n } else return false;\r\n //}\r\n }, [settings]);\r\n const [loginState, setLoginState] = React.useState(\r\n //'TwoFactorAuthentication',\r\n showSSO ? 'SSOON' : 'Login_SSOOFF',\r\n );\r\n const [prevLoginState, setPrevLoginState] = React.useState(\r\n showSSO ? 'SSOON' : 'Login_SSOOFF',\r\n );\r\n const checkLoginResult = React.useCallback(\r\n (data: ResponseLoginUserModel) => {\r\n switch (data.Result) {\r\n case SignInStatus.Success:\r\n dispatch(loginActions.clearBadAttempts());\r\n if (data.RedirectUrl !== null) {\r\n let url = toRootedURL(trimStart(data.RedirectUrl, '~'));\r\n if (url.includes('aspx')) {\r\n url = toRootedURL(url);\r\n }\r\n window.location.replace(url);\r\n //history.push(url);\r\n }\r\n break;\r\n case SignInStatus.RequiresVerification:\r\n setProcessiong(false);\r\n setPrevLoginState(loginState);\r\n setLoginState('TwoFactorAuthentication');\r\n break;\r\n case SignInStatus.LockedOut:\r\n data.ErrorMessages.forEach(e => {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: e,\r\n }),\r\n );\r\n });\r\n break;\r\n case SignInStatus.Failure:\r\n switch (data.FailureReasons) {\r\n case SignInFailureReasons.MustChangePassword:\r\n case SignInFailureReasons.PasswordExpired:\r\n if (data.RedirectUrl !== null) {\r\n let url = toRootedURL(trimStart(data.RedirectUrl, '~'));\r\n if (url.includes('aspx')) {\r\n url = toRootedURL(url);\r\n }\r\n window.location.replace(url);\r\n //history.push(url);\r\n }\r\n break;\r\n default:\r\n dispatch(loginActions.increaseBadAttempts());\r\n data.ErrorMessages.forEach(e => {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: e,\r\n }),\r\n );\r\n });\r\n break;\r\n }\r\n break;\r\n default:\r\n break;\r\n }\r\n },\r\n [actions, dispatch, loginActions, loginState],\r\n );\r\n const handleSSOOFFSubmit = React.useCallback(\r\n async (values: UserPasswordRemember) => {\r\n const model: LoginUserModel = {\r\n ...values,\r\n PageUrl: window.location.href,\r\n };\r\n setProcessiong(true);\r\n setRememberMe(model.RememberMe);\r\n try {\r\n const data = await api.LoginUser(model);\r\n setResposeData(data);\r\n dispatch(loginActions.login_Success(data));\r\n checkLoginResult(data);\r\n } catch (error) {\r\n console.error(error);\r\n dispatch(loginActions.login_Error(error as string));\r\n }\r\n setProcessiong(false);\r\n },\r\n [checkLoginResult, dispatch, loginActions],\r\n );\r\n const handleSSO_ON_Submit = React.useCallback(async () => {\r\n setProcessiong(true);\r\n try {\r\n const params = new URLSearchParams(location.search);\r\n const param = params.get('ReturnUrl');\r\n const returnUrl = param !== null ? trimStart(param, '~') : '';\r\n const url = await api.SSOLoginUrl(returnUrl);\r\n window.location.replace(trimStart(url, '~'));\r\n } catch (error) {\r\n console.error(error);\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: error as string,\r\n }),\r\n );\r\n }\r\n setProcessiong(false);\r\n }, [actions, dispatch, location.search]);\r\n const handleSSO_OFF_Submit = React.useCallback(() => {\r\n setLoginState('Login_SSOON');\r\n }, []);\r\n const handle2FASubmit = React.useCallback(\r\n async (values: TwoFactorAuthenticationParams | null) => {\r\n if (\r\n resposeData !== undefined &&\r\n resposeData.Provider !== null &&\r\n values !== null &&\r\n values.one &&\r\n values.two &&\r\n values.three &&\r\n values.four &&\r\n values.five &&\r\n values.six\r\n ) {\r\n const code =\r\n values.one +\r\n values.two +\r\n values.three +\r\n values.four +\r\n values.five +\r\n values.six;\r\n setProcessiong(true);\r\n try {\r\n const data = await api.CodeVerification({\r\n Provider: resposeData.Provider,\r\n Code: code,\r\n RememberMe: rememberMe,\r\n } as CodeVerificationModel);\r\n if (data.Result === SignInStatus.Success) {\r\n dispatch(loginActions.clearBadAttempts());\r\n if (resposeData.RedirectUrl !== null) {\r\n const url = trimStart(resposeData.RedirectUrl, '~');\r\n window.location.replace(url);\r\n //history.push(url);\r\n }\r\n } else {\r\n data.ErrorMessages.forEach(e => {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: e,\r\n }),\r\n );\r\n });\r\n }\r\n } catch (error) {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: error as string,\r\n }),\r\n );\r\n }\r\n setProcessiong(false);\r\n }\r\n setLoginState(prevLoginState);\r\n },\r\n [actions, dispatch, loginActions, prevLoginState, rememberMe, resposeData],\r\n );\r\n const reSend = React.useCallback(async () => {\r\n setProcessiong(true);\r\n const rd = { ...resposeData } as ResponseLoginUserModel;\r\n if (rd !== undefined) {\r\n try {\r\n const data = await api.SendVerificationCode();\r\n rd.Provider = data.Provider;\r\n setResposeData(rd);\r\n dispatch(loginActions.setProvider(data.Provider));\r\n } catch (error) {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: error as string,\r\n }),\r\n );\r\n }\r\n }\r\n setProcessiong(false);\r\n }, [actions, dispatch, loginActions, resposeData]);\r\n\r\n const [pageTitle, pageDescription, MainContent] = useLoginState(\r\n loginState,\r\n showNewUser,\r\n showRememberMe,\r\n isMobile,\r\n handleSSOOFFSubmit,\r\n handleSSO_ON_Submit,\r\n handleSSO_OFF_Submit,\r\n handle2FASubmit,\r\n reSend,\r\n );\r\n useEffectOnMount(() => {\r\n if (new URLSearchParams(location.search).has('msg')) {\r\n const msg = new URLSearchParams(location.search).get('msg');\r\n if (msg) {\r\n dispatch(\r\n actions.addNotification({\r\n variant: 'error',\r\n message: msg,\r\n }),\r\n );\r\n }\r\n }\r\n });\r\n useEffectOnMount(() => {\r\n dispatch(appSettingsActions.setBarcodeScannigTarget(ScanTarget.Login));\r\n return () => {\r\n dispatch(appSettingsActions.setBarcodeScannigTarget(ScanTarget.All));\r\n };\r\n });\r\n React.useEffect(() => {\r\n showSSO ? setLoginState('SSOON') : setLoginState('Login_SSOOFF');\r\n }, [showSSO]);\r\n\r\n return isLoading ? (\r\n <>{''}\r\n ) : (\r\n \r\n {!!MainContent ? MainContent : <>}\r\n \r\n );\r\n}\r\n","import { translations } from 'locales/translations';\r\nimport React from 'react';\r\nimport { useTranslation } from 'react-i18next';\r\nimport { UserPasswordForm } from '../Components/LoginPanel';\r\nimport { SelectLoginType } from '../Components/SSO_ON';\r\nimport { TwoFactorAuthenticationForm } from '../Components/TwoFactorAuthentication';\r\nimport {\r\n LoginState,\r\n TwoFactorAuthenticationParams,\r\n UserPasswordRemember,\r\n} from '../Components/type';\r\nimport ButtonLink from 'app/components/BasicLinks/ButtonLink';\r\nimport { FormikProps } from 'formik';\r\nimport { useHistory } from 'react-router-dom';\r\n\r\nexport const useLoginState = (\r\n loginState: LoginState,\r\n showNewUser: boolean,\r\n showRememberMe: boolean,\r\n isMobile: boolean,\r\n handleSSOOFFSubmit: (values: UserPasswordRemember) => Promise,\r\n handleSSO_ON_Submit: () => void,\r\n handleSSO_OFF_Submit: () => void,\r\n handle2FASubmit: (values: TwoFactorAuthenticationParams | null) => void,\r\n ReSend: () => void,\r\n): [\r\n JSX.Element | undefined,\r\n JSX.Element | undefined,\r\n JSX.Element | undefined,\r\n] => {\r\n const { t } = useTranslation();\r\n const history = useHistory();\r\n const ssooffRef = React.useRef | null>(\r\n null,\r\n );\r\n const twoFARef = React.useRef | null>(null);\r\n const pageTitle = React.useMemo(() => {\r\n switch (loginState) {\r\n case 'Login_SSOOFF':\r\n case 'SSOON':\r\n case 'Login_SSOON':\r\n return <>{t(translations.LogInToYourAccount)};\r\n case 'TwoFactorAuthentication':\r\n return <>{t(translations.TwoFactorAuthenticationIsRequired)};\r\n default:\r\n return undefined;\r\n }\r\n }, [loginState, t]);\r\n const pageDescription = React.useMemo(() => {\r\n switch (loginState) {\r\n case 'Login_SSOOFF':\r\n case 'SSOON':\r\n case 'Login_SSOON':\r\n if (showNewUser) {\r\n return (\r\n <>\r\n {t(translations.JoinYourLaboratoryAsA)}{' '}\r\n {\r\n history.push('/RegisterAccount');\r\n }}\r\n >\r\n {t(translations.NewUser)}\r\n \r\n \r\n );\r\n } else return undefined;\r\n case 'TwoFactorAuthentication':\r\n return (\r\n <>\r\n {t(translations.HaventReceivedTheCode)}{' '}\r\n {t(translations.ReSend)}\r\n \r\n );\r\n default:\r\n return undefined;\r\n }\r\n }, [ReSend, history, loginState, showNewUser, t]);\r\n const MainContent = React.useMemo(() => {\r\n switch (loginState) {\r\n case 'Login_SSOOFF':\r\n return (\r\n \r\n );\r\n case 'SSOON':\r\n return (\r\n \r\n );\r\n case 'Login_SSOON':\r\n return (\r\n \r\n );\r\n case 'TwoFactorAuthentication':\r\n return (\r\n \r\n );\r\n default:\r\n return undefined;\r\n }\r\n }, [\r\n handle2FASubmit,\r\n handleSSOOFFSubmit,\r\n handleSSO_OFF_Submit,\r\n handleSSO_ON_Submit,\r\n isMobile,\r\n loginState,\r\n showRememberMe,\r\n ]);\r\n return [pageTitle, pageDescription, MainContent];\r\n};\r\n"],"sourceRoot":""}