{"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","LinearProgress","LoginWrapper","children","pageTitle","pageDescription","disabled","useIsMobile","loginFooter","t","useTranslation","translations","LoginFooter","isLogingFooterEmtpy","isEmptyOrWhitespace","loginFooterContent","Wrapper","clsx","loginDisabled","maxWidth","pointerEvents","padding","height","overflowY","border","bookitColors","primary","componentsLight","borderRadius","paddingTop","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","autoFocus","SignIn","onClick","auth_ShibbolethLoginLinkText","LoginButtons","div","SelectLoginType","onSSO_ON_Submit","onSSO_OFF_Submit","SignInWithCredentials","TimerContent","MyTimer","useTimer","expiryTimestamp","getTime","onExpire","seconds","minutes","start","useEffect","BasicTypography","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","textBoxWidth","minInputWidth","inputRef","onKeyUp","submitForm","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","contentMaxWidth"],"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,iPC5BfY,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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A0OZqQ,GA1OY,MA4Q/C,OAvBAC,cAAiB,WACf,GAAI,IAAItB,gBAAgBxD,EAASyD,QAAQsB,IAAI,OAAQ,CACnD,IAAMC,EAAM,IAAIxB,gBAAgBxD,EAASyD,QAAQ9M,IAAI,OACjDqO,GACFpF,EACEzI,EAAQ4L,gBAAgB,CACtB/Q,QAAS,QACTgC,QAASgR,SAMnBF,cAAiB,WAEf,OADAlF,EAASG,EAAmBkF,wBAAwBC,KAAWC,QACxD,WACLvF,EAASG,EAAmBkF,wBAAwBC,KAAWE,UAGnEzT,IAAMyL,WAAU,WACJ0E,EAAVf,EAAwB,QAAyB,kBAChD,CAACA,IAEGN,EACL,mCAAG,KAEH,cAACpM,EAAD,CACEjB,WAAU,OAAE+F,QAAF,IAAEA,OAAF,EAAEA,EAAakM,WACzB9Q,UAAWA,GACXhB,kBAAmBqE,EACnBpD,gBAAiBA,GACjBC,SAAUmD,EACV0N,gBAAiB,IANnB,SAQKT,IAA4B","file":"static/js/746.a737e743.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 { 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\nimport { Div100 } from 'app/components/AssetQuickSearch/styled';\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\nimport clsx from 'clsx';\r\nimport { isEmptyOrWhitespace } from 'utils/typeUtils';\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 function LoginWrapper({\r\n children,\r\n help_Login,\r\n pageTitle,\r\n pageDescription,\r\n showTopProcessing,\r\n disabled,\r\n}: LoginWrapperProps) {\r\n const theme = useTheme();\r\n const { isMobile } = useIsMobile();\r\n const { t } = useTranslation();\r\n const loginFooter = t(translations.LoginFooter) as string;\r\n const isLogingFooterEmtpy = isEmptyOrWhitespace(loginFooter);\r\n const loginFooterContent = parse(loginFooter);\r\n return (\r\n \r\n \r\n
{children}
\r\n {!isLogingFooterEmtpy && (\r\n
{loginFooterContent}
\r\n )}\r\n \r\n );\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 maxWidth: '600px',\r\n pointerEvents: 'auto',\r\n '&.loginDisabled': {\r\n pointerEvents: 'none',\r\n },\r\n [theme.breakpoints.down('sm')]: {\r\n padding: '0px 24px 16px 24px',\r\n height: '100%',\r\n overflowY: 'auto',\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 width: '100%',\r\n '& .remember-forgot': {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n width: '100%',\r\n },\r\n '& .twofactor-timer': {\r\n width: '100%',\r\n display: 'flex',\r\n justifyContent: 'center',\r\n flexDirection: 'column',\r\n alignItems: 'center',\r\n paddingTop: 24,\r\n gap: 36,\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 //PROPS\r\n const { initial, formRef, onSubmit, submitting, showRememberMe, SSOSubmit } =\r\n props;\r\n const { t } = useTranslation();\r\n const appSettings = useSelector(selectAppSettings);\r\n const loginBadAttempts = useSelector(selectBadAttempts);\r\n\r\n //STATES\r\n const [rememberMe, setRememberMe] = React.useState(true);\r\n\r\n //SCHEMA\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\r\n //FUNCTIONS\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\r\n //RENDER\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 \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 { 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\nconst LoginButtons = styled.div`\r\n display: flex;\r\n flex-direction: column;\r\n align-items: flex-start;\r\n gap: 16px;\r\n align-self: stretch;\r\n`;\r\n\r\nexport function SelectLoginType(props: SelectLoginTypeProps) {\r\n //PROPS\r\n const { t } = useTranslation();\r\n\r\n //RENDER\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 BasicTypography from 'app/components/Typography/BasicTypography';\r\nimport React from 'react';\r\nimport { useTimer } from 'react-timer-hook';\r\nimport styled from 'styled-components';\r\n\r\nexport interface MyTimerProps {\r\n title: string;\r\n expiryTimestamp: Date;\r\n onExpire: () => void;\r\n}\r\nconst TimerContent = styled.div`\r\n text-align: center;\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] =\r\n React.useState();\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 =\r\n 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":""}