{"version":3,"sources":["components/PushNotificationIcon.module.css","utils/Configuration.ts","utils/BasePath.ts","utils/AssetPath.ts","hooks/NotificationsContext.ts","components/ColoredSnackbarContent.tsx","components/NotificationBar.tsx","Routes.ts","themes/Light.ts","themes/Dark.ts","themes/Grey.ts","assets/images/applestore-badge.svg","assets/images/googleplay-badge.svg","components/AppStoreBadges.tsx","constants.ts","assets/images/user.svg","layouts/LoginLayout.tsx","services/Api.ts","services/Client.ts","services/RegisterDevice.ts","utils/IdentityToken.ts","views/DeviceRegistration/RegisterOneTimePassword.tsx","models/Methods.ts","services/State.ts","components/FingerTouchIcon.tsx","views/DeviceRegistration/RegisterSecurityKey.tsx","services/UserPreferences.ts","services/Configuration.ts","hooks/RemoteCall.ts","hooks/RedirectionURL.ts","views/LoadingPage/LoadingPage.tsx","components/SuccessIcon.tsx","views/LoginPortal/Authenticated.tsx","views/LoginPortal/AuthenticatedView/AuthenticatedView.tsx","components/FixedTextField.tsx","services/FirstFactor.ts","views/LoginPortal/FirstFactor/FirstFactorForm.tsx","components/PushNotificationIcon.tsx","hooks/IntermittentClass.ts","components/PieChartIcon.tsx","components/TimerIcon.tsx","views/LoginPortal/SecondFactor/MethodSelectionDialog.tsx","services/OneTimePassword.ts","components/InformationIcon.tsx","views/LoginPortal/SecondFactor/MethodContainer.tsx","views/LoginPortal/SecondFactor/OneTimePasswordMethod.tsx","views/LoginPortal/SecondFactor/IconWithContext.tsx","views/LoginPortal/SecondFactor/OTPDial.tsx","views/LoginPortal/SecondFactor/PushNotificationMethod.tsx","components/FailureIcon.tsx","hooks/Mounted.ts","services/PushNotification.ts","views/LoginPortal/SecondFactor/SecurityKeyMethod.tsx","components/LinearProgressBar.tsx","services/SecurityKey.ts","hooks/Timer.ts","views/LoginPortal/SecondFactor/SecondFactorForm.tsx","views/LoginPortal/LoginPortal.tsx","hooks/State.ts","hooks/UserInfo.ts","hooks/Configuration.ts","services/SignOut.ts","views/LoginPortal/SignOut/SignOut.tsx","services/ResetPassword.ts","views/ResetPassword/ResetPasswordStep1.tsx","views/ResetPassword/ResetPasswordStep2.tsx","App.tsx","serviceWorker.ts","index.tsx","components/FingerTouchIcon.module.css"],"names":["module","exports","getEmbeddedVariable","variableName","value","document","body","getAttribute","Error","getBasePath","__webpack_public_path__","defaultOptions","NotificationsContext","createContext","notification","setNotification","useNotifications","useNotificationsProps","useContext","notificationBuilder","level","message","timeout","createInfoNotification","useCallback","createSuccessNotification","createWarnNotification","createErrorNotification","isActive","resetNotification","variantIcon","success","CheckCircleIcon","warning","WarningIcon","error","ErrorIcon","info","InfoIcon","ColoredSnackbarContent","props","classes","useStyles","Icon","className","variant","others","SnackbarContent","classnames","icon","iconVariant","makeStyles","theme","backgroundColor","green","palette","dark","primary","main","amber","fontSize","opacity","marginRight","spacing","display","alignItems","NotificationBar","useState","tmpNotification","setTmpNotification","useEffect","shouldSnackbarBeOpen","undefined","Snackbar","open","anchorOrigin","vertical","horizontal","autoHideDuration","onClose","onExited","FirstFactorRoute","AuthenticatedRoute","SecondFactorRoute","SecondFactorU2FRoute","SecondFactorTOTPRoute","SecondFactorPushRoute","ResetPasswordStep1Route","LogoutRoute","Light","createMuiTheme","custom","loadingBar","background","default","paper","Dark","type","Grey","overrides","MuiCssBaseline","color","MuiOutlinedInput","root","borderColor","borderWidth","notchedOutline","MuiCheckbox","MuiInputBase","input","MuiInputLabel","AppStoreBadges","target","targetBlank","width","iconSize","Link","href","googlePlayLink","src","GooglePlay","alt","style","appleStoreLink","AppleStore","GoogleAuthenticator","_extends","Object","assign","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","this","_objectWithoutProperties","excluded","sourceKeys","keys","indexOf","_objectWithoutPropertiesLoose","getOwnPropertySymbols","sourceSymbolKeys","propertyIsEnumerable","d","SvgUser","_ref","svgRef","title","titleId","id","x","y","viewBox","enableBackground","xmlSpace","ref","ForwardRef","LoginLayout","Grid","container","justify","Container","maxWidth","rootContainer","item","xs","Typography","children","showBrand","poweredBy","minHeight","textAlign","paddingLeft","paddingRight","margin","fill","grey","basePath","FirstFactorPath","InitiateTOTPRegistrationPath","CompleteTOTPRegistrationPath","InitiateU2FRegistrationPath","CompleteU2FRegistrationStep1Path","CompleteU2FRegistrationStep2Path","InitiateU2FSignInPath","CompleteU2FSignInPath","CompletePushNotificationSignInPath","CompleteTOTPSignInPath","InitiateResetPasswordPath","CompleteResetPasswordPath","ResetPasswordPath","LogoutPath","StatePath","UserInfoPath","UserInfo2FAMethodPath","ConfigurationPath","toData","resp","data","hasServiceError","errResp","toErrorResponse","status","errored","PostWithOptionalResponse","path","a","axios","post","res","Post","Get","get","initiateTOTPRegistrationProcess","completeTOTPRegistrationProcess","processToken","token","initiateU2FRegistrationProcess","completeU2FRegistrationProcessStep1","completeU2FRegistrationProcessStep2","response","extractIdentityToken","locationSearch","queryParams","queryString","parse","SecondFactorMethod","AuthenticationLevel","RegisterOneTimePassword","history","useHistory","location","useLocation","secretURL","setSecretURL","secretBase32","setSecretBase32","hasErrored","setHasErrored","isLoading","setIsLoading","search","completeRegistrationProcess","secret","otpauth_url","base32_secret","console","SecretButton","text","action","IconButton","secretButtons","onClick","navigator","clipboard","writeText","qrcodeFuzzyStyle","fuzzy","googleAuthenticator","googleAuthenticatorText","googleAuthenticatorBadges","qrcodeContainer","qrcode","size","CircularProgress","loader","failureIcon","faTimesCircle","TextField","label","InputProps","readOnly","faKey","faCopy","Button","doneButton","push","disabled","paddingTop","paddingBottom","marginTop","marginBottom","filter","typography","position","top","left","red","FingerTouchIcon","shakingClass","animated","shaking","strong","height","hand","wave","RegisterSecurityKey","setRegistrationInProgress","handleBackClick","registerStep1","registerRequests","r","appId","challenge","version","u2fApi","register","registerResponse","instruction","toEnum","method","U2F","TOTP","MobilePush","toString","getUserPreferences","setPreferred2FAMethod","getConfiguration","config","available_methods","Set","map","useRemoteCall","fn","deps","setData","inProgress","setInProgress","setError","fnCallback","useRedirectionURL","getState","LoadingPage","useTheme","SuccessIcon","faCheckCircle","Authenticated","iconContainer","flex","AuthenticatedView","name","SignOutRoute","mainContainer","border","borderRadius","padding","FixedTextField","InputLabelProps","inputProps","autoCapitalize","postFirstFactor","username","password","rememberMe","targetURL","keepMeLoggedIn","FirstFactorForm","redirectionURL","setRememberMe","setUsername","usernameError","setUsernameError","setPassword","passwordError","setPasswordError","usernameRef","useRef","passwordRef","setTimeout","current","focus","clearTimeout","handleSignIn","onAuthenticationStart","onAuthenticationSuccess","redirect","onAuthenticationFailure","inputRef","required","fullWidth","onChange","v","onFocus","onKeyPress","ev","preventDefault","resetPassword","leftAlign","actionRow","flexEnd","FormControlLabel","control","Checkbox","checked","component","resetLink","flexDirection","cursor","flexGrow","justifyContent","rightAlign","verticalAlign","PushNotificationIcon","wiggleClass","classname","activeMilliseconds","inactiveMillisecond","startMillisecond","currentClass","setCurrentClass","firstTime","setFirstTime","useIntermittentClass","wiggle","PieChartIcon","maxProgress","cx","cy","stroke","strokeWidth","strokeDasharray","progress","transform","TimerIcon","radius","timeProgress","setTimeProgress","initialValue","Date","getTime","period","interval","setInterval","clearInterval","MethodSelectionDialog","pieChartIcon","Dialog","DialogContent","methods","has","MethodItem","u2fSupported","DialogActions","buttonRoot","completeTOTPSignIn","passcode","State","InformationIcon","faInfoCircle","DefaultMethodContainer","stateClass","state","ALREADY_AUTHENTICATED","NOT_REGISTERED","NotRegisteredContainer","METHOD","explanation","containerFlex","onRegisterClick","flexWrap","alignContent","MethodContainer","IconWithContext","context","OTPDial","dial","otpInput","shouldAutoFocus","numInputs","isDisabled","InProgress","Success","Failure","inputStyle","otpDigitInput","inputError","marginLeft","OneTimePasswordMethod","setPasscode","authenticationLevel","TwoFactor","Idle","setState","onSignInSuccess","onSignInError","onSignInErrorCallback","onSignInSuccessCallback","signInFunc","passcodeStr","methodState","MethodContainerState","registered","totp_period","FailureIcon","useIsMountedRef","isMountedRef","completePushNotificationSignIn","PushNotificationMethod","SignInInProgress","mounted","LinearProgressBar","progressRoot","transition","LinearProgress","bar1Determinate","initiateU2FSignin","completeU2FSignin","signResponse","SecurityKeyMethod","WaitTouch","timeoutMs","startDate","setStartDate","percent","setPercent","trigger","clear","intervalNode","p","useTimer","signInTimeout","timerPercent","triggerTimer","doInitiateSignIn","signRequest","signRequests","registeredKeys","keyHandle","sign","SigninInProgress","timer","onRetryClick","progressBarStyle","touch","failure","SecondFactorForm","methodSelectionOpen","setMethodSelectionOpen","registrationInProgress","setU2fSupported","ensureSupport","then","initiateRegistration","initiateRegistrationFunc","handleMethodSelected","onMethodChanged","userInfo","display_name","configuration","methodContainer","exact","has_totp","err","has_u2f","to","LoginPortal","firstFactorDisabled","setFirstFactorDisabled","fetchState","fetchStateError","fetchUserInfo","fetchUserInfoError","fetchConfiguration","fetchConfigurationError","url","authentication_level","OneFactor","Unauthenticated","redirectionSuffix","encodeURIComponent","second_factor_enabled","handleAuthSuccess","window","firstFactorReady","pathname","ComponentOrLoading","ready","signOut","SignOut","timedOut","setTimedOut","doSignOut","typo","initiateResetPasswordProcess","completeResetPasswordProcess","newPassword","ResetPasswordStep1","doInitiateResetPasswordProcess","e","ResetPasswordStep2","formDisabled","setFormDisabled","password1","setPassword1","password2","setPassword2","errorPassword1","setErrorPassword1","errorPassword2","setErrorPassword2","completeProcess","doResetPassword","includes","Theme","themes","faConfig","autoAddCss","App","ThemeProvider","CssBaseline","Provider","basename","Boolean","hostname","match","ReactDOM","render","getElementById","serviceWorker","registration","unregister"],"mappings":"+EACAA,EAAOC,QAAU,CAAC,OAAS,uC,yECDpB,SAASC,EAAoBC,GAChC,IAAMC,EAAQC,SAASC,KAAKC,aAAd,eAAmCJ,IACjD,GAAc,OAAVC,EACA,MAAM,IAAII,MAAJ,aAAgBL,EAAhB,gCAGV,OAAOC,ECJJ,SAASK,IACZ,OAAOP,EAAoB,YCD/BQ,IAA0B,IAEJ,KAAlBD,MACAC,IAA0BD,IAAgB,K,+FCAxCE,EACO,EAQPC,EAAuBC,wBAAwC,CAAEC,aAAc,KAAMC,gBAAiB,eAE7FH,IAER,SAASI,IACZ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,GAAD,MAEJ,cAAC,IAAD,CAAOzV,K3DhDS,yB2DgDuByV,OAAK,EAA5C,SACI,cAAC,GAAD,MAEJ,cAAC,IAAD,CAAOzV,K3DlDa,8B2DkDuByV,OAAK,EAAhD,SACI,cAAC,GAAD,MAEJ,cAAC,IAAD,CAAOzV,KAAM1H,EAAamd,OAAK,EAA/B,SACI,cAAC,GAAD,MAEJ,cAAC,IAAD,CAAOzV,KAAMjI,EAAb,SACI,cAAC,GAAD,CAAaqR,WjE1DQ,SAAtCpW,EAAoB,ciE0DuCqY,cjEtDlB,SAAzCrY,EAAoB,qBiEwDP,cAAC,IAAD,CAAOgN,KAAK,IAAZ,SACI,cAAC,IAAD,CAAU6V,GAAI9d,kBC3DtBwhB,QACa,cAA7BxC,OAAOrV,SAAS8X,UAEiB,UAA7BzC,OAAOrV,SAAS8X,UAEhBzC,OAAOrV,SAAS8X,SAASC,MAAM,2DCPvCC,IAASC,OAAO,cAAC,GAAD,IAASxmB,SAASymB,eAAe,SDqHzC,kBAAmB5W,WACnBA,UAAU6W,cAAc1C,MAAMnC,MAAK,SAAC8E,GAChCA,EAAaC,iB,mBEhIzBjnB,EAAOC,QAAU,CAAC,KAAO,8BAA8B,OAAS,gCAAgC,QAAU,oC","file":"static/js/main.d8b0af67.chunk.js","sourcesContent":["// extracted by mini-css-extract-plugin\nmodule.exports = {\"wiggle\":\"PushNotificationIcon_wiggle__kPe3e\"};","export function getEmbeddedVariable(variableName: string) {\n const value = document.body.getAttribute(`data-${variableName}`);\n if (value === null) {\n throw new Error(`No ${variableName} embedded variable detected`);\n }\n\n return value;\n}\n\nexport function getRememberMe() {\n return getEmbeddedVariable(\"rememberme\") === \"true\";\n}\n\nexport function getResetPassword() {\n return getEmbeddedVariable(\"resetpassword\") === \"true\";\n}\n\nexport function getTheme() {\n return getEmbeddedVariable(\"theme\");\n}\n","import { getEmbeddedVariable } from \"./Configuration\";\n\nexport function getBasePath() {\n return getEmbeddedVariable(\"basepath\");\n}\n","import { getBasePath } from \"./BasePath\";\n\n__webpack_public_path__ = \"/\";\n\nif (getBasePath() !== \"\") {\n __webpack_public_path__ = getBasePath() + \"/\";\n}\n","import { useCallback, createContext, useContext } from \"react\";\n\nimport { Level } from \"../components/ColoredSnackbarContent\";\nimport { Notification } from \"../models/Notifications\";\n\nconst defaultOptions = {\n timeout: 5,\n};\n\ninterface NotificationContextProps {\n notification: Notification | null;\n setNotification: (n: Notification | null) => void;\n}\n\nconst NotificationsContext = createContext({ notification: null, setNotification: () => {} });\n\nexport default NotificationsContext;\n\nexport function useNotifications() {\n let useNotificationsProps = useContext(NotificationsContext);\n\n const notificationBuilder = (level: Level) => {\n return (message: string, timeout?: number) => {\n useNotificationsProps.setNotification({\n level,\n message,\n timeout: timeout ? timeout : defaultOptions.timeout,\n });\n };\n };\n\n const resetNotification = () => useNotificationsProps.setNotification(null);\n /* eslint-disable react-hooks/exhaustive-deps */\n const createInfoNotification = useCallback(notificationBuilder(\"info\"), []);\n const createSuccessNotification = useCallback(notificationBuilder(\"success\"), []);\n const createWarnNotification = useCallback(notificationBuilder(\"warning\"), []);\n const createErrorNotification = useCallback(notificationBuilder(\"error\"), []);\n /* eslint-enable react-hooks/exhaustive-deps */\n const isActive = useNotificationsProps.notification !== null;\n\n return {\n notification: useNotificationsProps.notification,\n resetNotification,\n createInfoNotification,\n createSuccessNotification,\n createWarnNotification,\n createErrorNotification,\n isActive,\n };\n}\n","import React from \"react\";\n\nimport { makeStyles, SnackbarContent } from \"@material-ui/core\";\nimport { amber, green } from \"@material-ui/core/colors\";\nimport { SnackbarContentProps } from \"@material-ui/core/SnackbarContent\";\nimport CheckCircleIcon from \"@material-ui/icons/CheckCircle\";\nimport ErrorIcon from \"@material-ui/icons/Error\";\nimport InfoIcon from \"@material-ui/icons/Info\";\nimport WarningIcon from \"@material-ui/icons/Warning\";\nimport classnames from \"classnames\";\n\nconst variantIcon = {\n success: CheckCircleIcon,\n warning: WarningIcon,\n error: ErrorIcon,\n info: InfoIcon,\n};\n\nexport type Level = keyof typeof variantIcon;\n\nexport interface Props extends SnackbarContentProps {\n className?: string;\n level: Level;\n message: string;\n}\n\nconst ColoredSnackbarContent = function (props: Props) {\n const classes = useStyles();\n const Icon = variantIcon[props.level];\n\n const { className, variant, message, ...others } = props;\n\n return (\n \n \n {message}\n \n }\n {...others}\n />\n );\n};\n\nexport default ColoredSnackbarContent;\n\nconst useStyles = makeStyles((theme) => ({\n success: {\n backgroundColor: green[600],\n },\n error: {\n backgroundColor: theme.palette.error.dark,\n },\n info: {\n backgroundColor: theme.palette.primary.main,\n },\n warning: {\n backgroundColor: amber[700],\n },\n icon: {\n fontSize: 20,\n },\n iconVariant: {\n opacity: 0.9,\n marginRight: theme.spacing(1),\n },\n message: {\n display: \"flex\",\n alignItems: \"center\",\n },\n}));\n","import React, { useState, useEffect } from \"react\";\n\nimport { Snackbar } from \"@material-ui/core\";\n\nimport { useNotifications } from \"../hooks/NotificationsContext\";\nimport { Notification } from \"../models/Notifications\";\nimport ColoredSnackbarContent from \"./ColoredSnackbarContent\";\n\nexport interface Props {\n onClose: () => void;\n}\n\nconst NotificationBar = function (props: Props) {\n const [tmpNotification, setTmpNotification] = useState(null as Notification | null);\n const { notification } = useNotifications();\n\n useEffect(() => {\n if (notification && notification !== null) {\n setTmpNotification(notification);\n }\n }, [notification]);\n\n const shouldSnackbarBeOpen = notification !== undefined && notification !== null;\n\n return (\n setTmpNotification(null)}\n >\n \n \n );\n};\n\nexport default NotificationBar;\n","export const FirstFactorRoute = \"/\";\nexport const AuthenticatedRoute = \"/authenticated\";\n\nexport const SecondFactorRoute = \"/2fa\";\nexport const SecondFactorU2FRoute = \"/2fa/security-key\";\nexport const SecondFactorTOTPRoute = \"/2fa/one-time-password\";\nexport const SecondFactorPushRoute = \"/2fa/push-notification\";\n\nexport const ResetPasswordStep1Route = \"/reset-password/step1\";\nexport const ResetPasswordStep2Route = \"/reset-password/step2\";\nexport const RegisterSecurityKeyRoute = \"/security-key/register\";\nexport const RegisterOneTimePasswordRoute = \"/one-time-password/register\";\nexport const LogoutRoute = \"/logout\";\n","import { createMuiTheme } from \"@material-ui/core/styles\";\n\nconst Light = createMuiTheme({\n custom: {\n icon: \"#000\",\n loadingBar: \"#000\",\n },\n palette: {\n primary: {\n main: \"#1976d2\",\n },\n background: {\n default: \"#fff\",\n paper: \"#fff\",\n },\n },\n});\n\nexport default Light;\n","import { createMuiTheme } from \"@material-ui/core/styles\";\n\nconst Dark = createMuiTheme({\n custom: {\n icon: \"#fff\",\n loadingBar: \"#fff\",\n },\n palette: {\n type: \"dark\",\n primary: {\n main: \"#1976d2\",\n },\n },\n});\n\nexport default Dark;\n","import { createMuiTheme } from \"@material-ui/core/styles\";\n\nconst Grey = createMuiTheme({\n custom: {\n icon: \"#929aa5\",\n loadingBar: \"#929aa5\",\n },\n palette: {\n primary: {\n main: \"#929aa5\",\n },\n background: {\n default: \"#2f343e\",\n paper: \"#2f343e\",\n },\n },\n overrides: {\n MuiCssBaseline: {\n \"@global\": {\n body: {\n backgroundColor: \"#2f343e\",\n color: \"#929aa5\",\n },\n },\n },\n MuiOutlinedInput: {\n root: {\n \"& $notchedOutline\": {\n borderColor: \"#929aa5\",\n },\n \"&:hover:not($disabled):not($focused):not($error) $notchedOutline\": {\n borderColor: \"#929aa5\",\n borderWidth: 2,\n },\n \"&$focused $notchedOutline\": {\n borderColor: \"#929aa5\",\n },\n },\n notchedOutline: {},\n },\n MuiCheckbox: {\n root: {\n color: \"#929aa5\",\n },\n },\n MuiInputBase: {\n input: {\n color: \"#929aa5\",\n },\n },\n MuiInputLabel: {\n root: {\n color: \"#929aa5\",\n },\n },\n },\n});\n\nexport default Grey;\n","export default __webpack_public_path__ + \"static/media/applestore-badge.15f01eef.svg\";","export default __webpack_public_path__ + \"static/media/googleplay-badge.6577102c.svg\";","import React from \"react\";\n\nimport { Link } from \"@material-ui/core\";\n\nimport AppleStore from \"../assets/images/applestore-badge.svg\";\nimport GooglePlay from \"../assets/images/googleplay-badge.svg\";\n\nexport interface Props {\n iconSize: number;\n googlePlayLink: string;\n appleStoreLink: string;\n\n targetBlank?: boolean;\n className?: string;\n}\n\nconst AppStoreBadges = function (props: Props) {\n const target = props.targetBlank ? \"_blank\" : undefined;\n\n const width = props.iconSize;\n\n return (\n
\n \n \"google\n \n \n \"apple\n \n
\n );\n};\n\nexport default AppStoreBadges;\n","export const GoogleAuthenticator = {\n googlePlay: \"https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2&hl=en_us\",\n appleStore: \"https://apps.apple.com/us/app/google-authenticator/id388497605\",\n};\n","function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport * as React from \"react\";\n\nvar _ref2 = /*#__PURE__*/React.createElement(\"path\", {\n d: \"M55,27.5C55,12.337,42.663,0,27.5,0S0,12.337,0,27.5c0,8.009,3.444,15.228,8.926,20.258l-0.026,0.023l0.892,0.752 c0.058,0.049,0.121,0.089,0.179,0.137c0.474,0.393,0.965,0.766,1.465,1.127c0.162,0.117,0.324,0.234,0.489,0.348 c0.534,0.368,1.082,0.717,1.642,1.048c0.122,0.072,0.245,0.142,0.368,0.212c0.613,0.349,1.239,0.678,1.88,0.98 c0.047,0.022,0.095,0.042,0.142,0.064c2.089,0.971,4.319,1.684,6.651,2.105c0.061,0.011,0.122,0.022,0.184,0.033 c0.724,0.125,1.456,0.225,2.197,0.292c0.09,0.008,0.18,0.013,0.271,0.021C25.998,54.961,26.744,55,27.5,55 c0.749,0,1.488-0.039,2.222-0.098c0.093-0.008,0.186-0.013,0.279-0.021c0.735-0.067,1.461-0.164,2.178-0.287 c0.062-0.011,0.125-0.022,0.187-0.034c2.297-0.412,4.495-1.109,6.557-2.055c0.076-0.035,0.153-0.068,0.229-0.104 c0.617-0.29,1.22-0.603,1.811-0.936c0.147-0.083,0.293-0.167,0.439-0.253c0.538-0.317,1.067-0.648,1.581-1 c0.185-0.126,0.366-0.259,0.549-0.391c0.439-0.316,0.87-0.642,1.289-0.983c0.093-0.075,0.193-0.14,0.284-0.217l0.915-0.764 l-0.027-0.023C51.523,42.802,55,35.55,55,27.5z M2,27.5C2,13.439,13.439,2,27.5,2S53,13.439,53,27.5 c0,7.577-3.325,14.389-8.589,19.063c-0.294-0.203-0.59-0.385-0.893-0.537l-8.467-4.233c-0.76-0.38-1.232-1.144-1.232-1.993v-2.957 c0.196-0.242,0.403-0.516,0.617-0.817c1.096-1.548,1.975-3.27,2.616-5.123c1.267-0.602,2.085-1.864,2.085-3.289v-3.545 c0-0.867-0.318-1.708-0.887-2.369v-4.667c0.052-0.52,0.236-3.448-1.883-5.864C34.524,9.065,31.541,8,27.5,8 s-7.024,1.065-8.867,3.168c-2.119,2.416-1.935,5.346-1.883,5.864v4.667c-0.568,0.661-0.887,1.502-0.887,2.369v3.545 c0,1.101,0.494,2.128,1.34,2.821c0.81,3.173,2.477,5.575,3.093,6.389v2.894c0,0.816-0.445,1.566-1.162,1.958l-7.907,4.313 c-0.252,0.137-0.502,0.297-0.752,0.476C5.276,41.792,2,35.022,2,27.5z\"\n});\n\nfunction SvgUser(_ref, svgRef) {\n var title = _ref.title,\n titleId = _ref.titleId,\n props = _objectWithoutProperties(_ref, [\"title\", \"titleId\"]);\n\n return /*#__PURE__*/React.createElement(\"svg\", _extends({\n id: \"UserSvg\",\n x: \"0px\",\n y: \"0px\",\n viewBox: \"0 0 55 55\",\n style: {\n enableBackground: \"new 0 0 55 55\"\n },\n xmlSpace: \"preserve\",\n ref: svgRef,\n \"aria-labelledby\": titleId\n }, props), title ? /*#__PURE__*/React.createElement(\"title\", {\n id: titleId\n }, title) : null, _ref2);\n}\n\nvar ForwardRef = /*#__PURE__*/React.forwardRef(SvgUser);\nexport default __webpack_public_path__ + \"static/media/user.8772ccb3.svg\";\nexport { ForwardRef as ReactComponent };","import React, { ReactNode } from \"react\";\n\nimport { Grid, makeStyles, Container, Typography, Link } from \"@material-ui/core\";\nimport { grey } from \"@material-ui/core/colors\";\n\nimport { ReactComponent as UserSvg } from \"../assets/images/user.svg\";\n\nexport interface Props {\n id?: string;\n children?: ReactNode;\n title: string;\n showBrand?: boolean;\n}\n\nconst LoginLayout = function (props: Props) {\n const style = useStyles();\n return (\n \n \n \n \n \n \n \n \n {props.title}\n \n \n \n {props.children}\n \n {props.showBrand ? (\n \n \n Powered by Authelia\n \n \n ) : null}\n \n \n \n );\n};\n\nexport default LoginLayout;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n minHeight: \"90vh\",\n textAlign: \"center\",\n },\n rootContainer: {\n paddingLeft: 32,\n paddingRight: 32,\n },\n title: {},\n icon: {\n margin: theme.spacing(),\n width: \"64px\",\n fill: theme.custom.icon,\n },\n body: {},\n poweredBy: {\n fontSize: \"0.7em\",\n color: grey[500],\n },\n}));\n","import { AxiosResponse } from \"axios\";\n\nimport { getBasePath } from \"../utils/BasePath\";\n\nconst basePath = getBasePath();\n\nexport const FirstFactorPath = basePath + \"/api/firstfactor\";\nexport const InitiateTOTPRegistrationPath = basePath + \"/api/secondfactor/totp/identity/start\";\nexport const CompleteTOTPRegistrationPath = basePath + \"/api/secondfactor/totp/identity/finish\";\n\nexport const InitiateU2FRegistrationPath = basePath + \"/api/secondfactor/u2f/identity/start\";\nexport const CompleteU2FRegistrationStep1Path = basePath + \"/api/secondfactor/u2f/identity/finish\";\nexport const CompleteU2FRegistrationStep2Path = basePath + \"/api/secondfactor/u2f/register\";\n\nexport const InitiateU2FSignInPath = basePath + \"/api/secondfactor/u2f/sign_request\";\nexport const CompleteU2FSignInPath = basePath + \"/api/secondfactor/u2f/sign\";\n\nexport const CompletePushNotificationSignInPath = basePath + \"/api/secondfactor/duo\";\nexport const CompleteTOTPSignInPath = basePath + \"/api/secondfactor/totp\";\n\nexport const InitiateResetPasswordPath = basePath + \"/api/reset-password/identity/start\";\nexport const CompleteResetPasswordPath = basePath + \"/api/reset-password/identity/finish\";\n// Do the password reset during completion.\nexport const ResetPasswordPath = basePath + \"/api/reset-password\";\n\nexport const LogoutPath = basePath + \"/api/logout\";\nexport const StatePath = basePath + \"/api/state\";\nexport const UserInfoPath = basePath + \"/api/user/info\";\nexport const UserInfo2FAMethodPath = basePath + \"/api/user/info/2fa_method\";\n\nexport const ConfigurationPath = basePath + \"/api/configuration\";\n\nexport interface ErrorResponse {\n status: \"KO\";\n message: string;\n}\n\nexport interface Response {\n status: \"OK\";\n data: T;\n}\n\nexport type ServiceResponse = Response | ErrorResponse;\n\nfunction toErrorResponse(resp: AxiosResponse>): ErrorResponse | undefined {\n if (resp.data && \"status\" in resp.data && resp.data[\"status\"] === \"KO\") {\n return resp.data as ErrorResponse;\n }\n return undefined;\n}\n\nexport function toData(resp: AxiosResponse>): T | undefined {\n if (resp.data && \"status\" in resp.data && resp.data[\"status\"] === \"OK\") {\n return resp.data.data as T;\n }\n return undefined;\n}\n\nexport function hasServiceError(resp: AxiosResponse>) {\n const errResp = toErrorResponse(resp);\n if (errResp && errResp.status === \"KO\") {\n return { errored: true, message: errResp.message };\n }\n return { errored: false, message: null };\n}\n","import axios from \"axios\";\n\nimport { ServiceResponse, hasServiceError, toData } from \"./Api\";\n\nexport async function PostWithOptionalResponse(path: string, body?: any) {\n const res = await axios.post>(path, body);\n\n if (res.status !== 200 || hasServiceError(res).errored) {\n throw new Error(`Failed POST to ${path}. Code: ${res.status}. Message: ${hasServiceError(res).message}`);\n }\n return toData(res);\n}\n\nexport async function Post(path: string, body?: any) {\n const res = await PostWithOptionalResponse(path, body);\n if (!res) {\n throw new Error(\"unexpected type of response\");\n }\n return res;\n}\n\nexport async function Get(path: string): Promise {\n const res = await axios.get>(path);\n\n if (res.status !== 200 || hasServiceError(res).errored) {\n throw new Error(`Failed GET from ${path}. Code: ${res.status}.`);\n }\n\n const d = toData(res);\n if (!d) {\n throw new Error(\"unexpected type of response\");\n }\n return d;\n}\n","import U2fApi from \"u2f-api\";\n\nimport {\n InitiateTOTPRegistrationPath,\n CompleteTOTPRegistrationPath,\n InitiateU2FRegistrationPath,\n CompleteU2FRegistrationStep1Path,\n CompleteU2FRegistrationStep2Path,\n} from \"./Api\";\nimport { Post, PostWithOptionalResponse } from \"./Client\";\n\nexport async function initiateTOTPRegistrationProcess() {\n await PostWithOptionalResponse(InitiateTOTPRegistrationPath);\n}\n\ninterface CompleteTOTPRegistrationResponse {\n base32_secret: string;\n otpauth_url: string;\n}\n\nexport async function completeTOTPRegistrationProcess(processToken: string) {\n return Post(CompleteTOTPRegistrationPath, { token: processToken });\n}\n\nexport async function initiateU2FRegistrationProcess() {\n return PostWithOptionalResponse(InitiateU2FRegistrationPath);\n}\n\ninterface U2RRegistrationStep1Response {\n appId: string;\n registerRequests: [\n {\n version: string;\n challenge: string;\n },\n ];\n}\n\nexport async function completeU2FRegistrationProcessStep1(processToken: string) {\n return Post(CompleteU2FRegistrationStep1Path, { token: processToken });\n}\n\nexport async function completeU2FRegistrationProcessStep2(response: U2fApi.RegisterResponse) {\n return PostWithOptionalResponse(CompleteU2FRegistrationStep2Path, response);\n}\n","import queryString from \"query-string\";\n\nexport function extractIdentityToken(locationSearch: string) {\n const queryParams = queryString.parse(locationSearch);\n return queryParams && \"token\" in queryParams ? (queryParams[\"token\"] as string) : null;\n}\n","import React, { useEffect, useCallback, useState } from \"react\";\n\nimport { IconDefinition, faCopy, faKey, faTimesCircle } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\nimport { makeStyles, Typography, Button, IconButton, Link, CircularProgress, TextField } from \"@material-ui/core\";\nimport { red } from \"@material-ui/core/colors\";\nimport classnames from \"classnames\";\nimport QRCode from \"qrcode.react\";\nimport { useHistory, useLocation } from \"react-router\";\n\nimport AppStoreBadges from \"../../components/AppStoreBadges\";\nimport { GoogleAuthenticator } from \"../../constants\";\nimport { useNotifications } from \"../../hooks/NotificationsContext\";\nimport LoginLayout from \"../../layouts/LoginLayout\";\nimport { FirstFactorRoute } from \"../../Routes\";\nimport { completeTOTPRegistrationProcess } from \"../../services/RegisterDevice\";\nimport { extractIdentityToken } from \"../../utils/IdentityToken\";\n\nconst RegisterOneTimePassword = function () {\n const style = useStyles();\n const history = useHistory();\n const location = useLocation();\n\n // The secret retrieved from the API is all is ok.\n const [secretURL, setSecretURL] = useState(\"empty\");\n const [secretBase32, setSecretBase32] = useState(undefined as string | undefined);\n const { createSuccessNotification, createErrorNotification } = useNotifications();\n const [hasErrored, setHasErrored] = useState(false);\n const [isLoading, setIsLoading] = useState(false);\n\n // Get the token from the query param to give it back to the API when requesting\n // the secret for OTP.\n const processToken = extractIdentityToken(location.search);\n\n const handleDoneClick = () => {\n history.push(FirstFactorRoute);\n };\n\n const completeRegistrationProcess = useCallback(async () => {\n if (!processToken) {\n return;\n }\n\n setIsLoading(true);\n try {\n const secret = await completeTOTPRegistrationProcess(processToken);\n setSecretURL(secret.otpauth_url);\n setSecretBase32(secret.base32_secret);\n } catch (err) {\n console.error(err);\n createErrorNotification(\"Failed to generate the code to register your device\", 10000);\n setHasErrored(true);\n }\n setIsLoading(false);\n }, [processToken, createErrorNotification]);\n\n useEffect(() => {\n completeRegistrationProcess();\n }, [completeRegistrationProcess]);\n function SecretButton(text: string | undefined, action: string, icon: IconDefinition) {\n return (\n {\n navigator.clipboard.writeText(`${text}`);\n createSuccessNotification(`${action}`);\n }}\n >\n \n \n );\n }\n const qrcodeFuzzyStyle = isLoading || hasErrored ? style.fuzzy : undefined;\n\n return (\n \n
\n
\n Need Google Authenticator?\n \n
\n
\n \n \n {!hasErrored && isLoading ? : null}\n {hasErrored ? : null}\n \n
\n
\n {secretURL !== \"empty\" ? (\n \n ) : null}\n {secretBase32 ? SecretButton(secretBase32, \"OTP Secret copied to clipboard.\", faKey) : null}\n {secretURL !== \"empty\" ? SecretButton(secretURL, \"OTP URL copied to clipboard.\", faCopy) : null}\n
\n \n Done\n \n
\n
\n );\n};\n\nexport default RegisterOneTimePassword;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n paddingTop: theme.spacing(4),\n paddingBottom: theme.spacing(4),\n },\n qrcode: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n fuzzy: {\n filter: \"blur(10px)\",\n },\n secret: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n width: \"256px\",\n },\n googleAuthenticator: {},\n googleAuthenticatorText: {\n fontSize: theme.typography.fontSize * 0.8,\n },\n googleAuthenticatorBadges: {},\n secretButtons: {\n width: \"128px\",\n },\n doneButton: {\n width: \"256px\",\n },\n qrcodeContainer: {\n position: \"relative\",\n display: \"inline-block\",\n },\n loader: {\n position: \"absolute\",\n top: \"calc(128px - 64px)\",\n left: \"calc(128px - 64px)\",\n color: \"rgba(255, 255, 255, 0.5)\",\n },\n failureIcon: {\n position: \"absolute\",\n top: \"calc(128px - 64px)\",\n left: \"calc(128px - 64px)\",\n color: red[400],\n fontSize: \"128px\",\n },\n}));\n","export enum SecondFactorMethod {\n TOTP = 1,\n U2F = 2,\n MobilePush = 3,\n}\n","import { StatePath } from \"./Api\";\nimport { Get } from \"./Client\";\n\nexport enum AuthenticationLevel {\n Unauthenticated = 0,\n OneFactor = 1,\n TwoFactor = 2,\n}\n\nexport interface AutheliaState {\n username: string;\n authentication_level: AuthenticationLevel;\n}\n\nexport async function getState(): Promise {\n return Get(StatePath);\n}\n","import React from \"react\";\n\nimport classnames from \"classnames\";\n\nimport style from \"./FingerTouchIcon.module.css\";\n\nexport interface Props {\n size: number;\n\n animated?: boolean;\n strong?: boolean;\n}\n\nconst FingerTouchIcon = function (props: Props) {\n const shakingClass = props.animated ? style.shaking : undefined;\n const strong = props.strong ? style.strong : undefined;\n\n return (\n \n \n \n \n );\n};\n\nexport default FingerTouchIcon;\n","import React, { useState, useEffect, useCallback } from \"react\";\n\nimport { makeStyles, Typography, Button } from \"@material-ui/core\";\nimport { useHistory, useLocation } from \"react-router\";\nimport u2fApi from \"u2f-api\";\n\nimport FingerTouchIcon from \"../../components/FingerTouchIcon\";\nimport { useNotifications } from \"../../hooks/NotificationsContext\";\nimport LoginLayout from \"../../layouts/LoginLayout\";\nimport { FirstFactorPath } from \"../../services/Api\";\nimport {\n completeU2FRegistrationProcessStep1,\n completeU2FRegistrationProcessStep2,\n} from \"../../services/RegisterDevice\";\nimport { extractIdentityToken } from \"../../utils/IdentityToken\";\n\nconst RegisterSecurityKey = function () {\n const style = useStyles();\n const history = useHistory();\n const location = useLocation();\n const { createErrorNotification } = useNotifications();\n const [, setRegistrationInProgress] = useState(false);\n\n const processToken = extractIdentityToken(location.search);\n\n const handleBackClick = () => {\n history.push(FirstFactorPath);\n };\n\n const registerStep1 = useCallback(async () => {\n if (!processToken) {\n return;\n }\n try {\n setRegistrationInProgress(true);\n const res = await completeU2FRegistrationProcessStep1(processToken);\n const registerRequests: u2fApi.RegisterRequest[] = [];\n for (var i in res.registerRequests) {\n const r = res.registerRequests[i];\n registerRequests.push({\n appId: res.appId,\n challenge: r.challenge,\n version: r.version,\n });\n }\n const registerResponse = await u2fApi.register(registerRequests, [], 60);\n await completeU2FRegistrationProcessStep2(registerResponse);\n setRegistrationInProgress(false);\n history.push(FirstFactorPath);\n } catch (err) {\n console.error(err);\n createErrorNotification(\n \"Failed to register your security key. The identity verification process might have timed out.\",\n );\n }\n }, [processToken, createErrorNotification, history]);\n\n useEffect(() => {\n registerStep1();\n }, [registerStep1]);\n\n return (\n \n
\n \n
\n Touch the token on your security key\n \n \n
\n );\n};\n\nexport default RegisterSecurityKey;\n\nconst useStyles = makeStyles((theme) => ({\n icon: {\n paddingTop: theme.spacing(4),\n paddingBottom: theme.spacing(4),\n },\n instruction: {\n paddingBottom: theme.spacing(4),\n },\n}));\n","import { SecondFactorMethod } from \"../models/Methods\";\nimport { UserInfo } from \"../models/UserInfo\";\nimport { UserInfoPath, UserInfo2FAMethodPath } from \"./Api\";\nimport { Get, PostWithOptionalResponse } from \"./Client\";\n\nexport type Method2FA = \"u2f\" | \"totp\" | \"mobile_push\";\n\nexport interface UserInfoPayload {\n display_name: string;\n method: Method2FA;\n has_u2f: boolean;\n has_totp: boolean;\n}\n\nexport interface MethodPreferencePayload {\n method: Method2FA;\n}\n\nexport function toEnum(method: Method2FA): SecondFactorMethod {\n switch (method) {\n case \"u2f\":\n return SecondFactorMethod.U2F;\n case \"totp\":\n return SecondFactorMethod.TOTP;\n case \"mobile_push\":\n return SecondFactorMethod.MobilePush;\n }\n}\n\nexport function toString(method: SecondFactorMethod): Method2FA {\n switch (method) {\n case SecondFactorMethod.U2F:\n return \"u2f\";\n case SecondFactorMethod.TOTP:\n return \"totp\";\n case SecondFactorMethod.MobilePush:\n return \"mobile_push\";\n }\n}\n\nexport async function getUserPreferences(): Promise {\n const res = await Get(UserInfoPath);\n return { ...res, method: toEnum(res.method) };\n}\n\nexport function setPreferred2FAMethod(method: SecondFactorMethod) {\n return PostWithOptionalResponse(UserInfo2FAMethodPath, { method: toString(method) } as MethodPreferencePayload);\n}\n","import { Configuration } from \"../models/Configuration\";\nimport { ConfigurationPath } from \"./Api\";\nimport { Get } from \"./Client\";\nimport { toEnum, Method2FA } from \"./UserPreferences\";\n\ninterface ConfigurationPayload {\n available_methods: Method2FA[];\n second_factor_enabled: boolean;\n totp_period: number;\n}\n\nexport async function getConfiguration(): Promise {\n const config = await Get(ConfigurationPath);\n return { ...config, available_methods: new Set(config.available_methods.map(toEnum)) };\n}\n","import { useState, useCallback, DependencyList } from \"react\";\n\ntype PromisifiedFunction = (...args: any) => Promise;\n\nexport function useRemoteCall(\n fn: PromisifiedFunction,\n deps: DependencyList,\n): [Ret | undefined, PromisifiedFunction, boolean, Error | undefined] {\n const [data, setData] = useState(undefined as Ret | undefined);\n const [inProgress, setInProgress] = useState(false);\n const [error, setError] = useState(undefined as Error | undefined);\n\n const fnCallback = useCallback(fn, [fn, deps]);\n\n const triggerCallback = useCallback(async () => {\n try {\n setInProgress(true);\n const res = await fnCallback();\n setInProgress(false);\n setData(res);\n } catch (err) {\n console.error(err);\n setError(err);\n }\n }, [setInProgress, setError, fnCallback]);\n\n return [data, triggerCallback, inProgress, error];\n}\n","import queryString from \"query-string\";\nimport { useLocation } from \"react-router\";\n\nexport function useRedirectionURL() {\n const location = useLocation();\n const queryParams = queryString.parse(location.search);\n return queryParams && \"rd\" in queryParams ? (queryParams[\"rd\"] as string) : undefined;\n}\n","import React from \"react\";\n\nimport { useTheme, Typography, Grid } from \"@material-ui/core\";\nimport ReactLoading from \"react-loading\";\n\nconst LoadingPage = function () {\n const theme = useTheme();\n return (\n \n \n \n Loading...\n \n \n );\n};\n\nexport default LoadingPage;\n","import React from \"react\";\n\nimport { faCheckCircle } from \"@fortawesome/free-regular-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\nconst SuccessIcon = function () {\n return ;\n};\n\nexport default SuccessIcon;\n","import React from \"react\";\n\nimport { Typography, makeStyles } from \"@material-ui/core\";\n\nimport SuccessIcon from \"../../components/SuccessIcon\";\n\nconst Authenticated = function () {\n const classes = useStyles();\n return (\n
\n
\n \n
\n Authenticated\n
\n );\n};\n\nexport default Authenticated;\n\nconst useStyles = makeStyles((theme) => ({\n iconContainer: {\n marginBottom: theme.spacing(2),\n flex: \"0 0 100%\",\n },\n}));\n","import React from \"react\";\n\nimport { Grid, makeStyles, Button } from \"@material-ui/core\";\nimport { useHistory } from \"react-router\";\n\nimport LoginLayout from \"../../../layouts/LoginLayout\";\nimport { LogoutRoute as SignOutRoute } from \"../../../Routes\";\nimport Authenticated from \"../Authenticated\";\n\nexport interface Props {\n name: string;\n}\n\nconst AuthenticatedView = function (props: Props) {\n const style = useStyles();\n const history = useHistory();\n\n const handleLogoutClick = () => {\n history.push(SignOutRoute);\n };\n\n return (\n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default AuthenticatedView;\n\nconst useStyles = makeStyles((theme) => ({\n mainContainer: {\n border: \"1px solid #d6d6d6\",\n borderRadius: \"10px\",\n padding: theme.spacing(4),\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n}));\n","import React from \"react\";\n\nimport { makeStyles } from \"@material-ui/core\";\nimport TextField, { TextFieldProps } from \"@material-ui/core/TextField\";\n\n/**\n * This component fixes outlined TextField\n * https://github.com/mui-org/material-ui/issues/14530#issuecomment-463576879\n *\n * @param props the TextField props\n */\nconst FixedTextField = function (props: TextFieldProps) {\n const style = useStyles();\n return (\n \n {props.children}\n \n );\n};\n\nexport default FixedTextField;\n\nconst useStyles = makeStyles((theme) => ({\n label: {\n backgroundColor: theme.palette.background.default,\n paddingLeft: theme.spacing(0.1),\n paddingRight: theme.spacing(0.1),\n },\n}));\n","import { FirstFactorPath } from \"./Api\";\nimport { PostWithOptionalResponse } from \"./Client\";\nimport { SignInResponse } from \"./SignIn\";\n\ninterface PostFirstFactorBody {\n username: string;\n password: string;\n keepMeLoggedIn: boolean;\n targetURL?: string;\n}\n\nexport async function postFirstFactor(username: string, password: string, rememberMe: boolean, targetURL?: string) {\n const data: PostFirstFactorBody = {\n username,\n password,\n keepMeLoggedIn: rememberMe,\n };\n\n if (targetURL) {\n data.targetURL = targetURL;\n }\n const res = await PostWithOptionalResponse(FirstFactorPath, data);\n return res ? res : ({} as SignInResponse);\n}\n","import React, { MutableRefObject, useEffect, useRef, useState } from \"react\";\n\nimport { makeStyles, Grid, Button, FormControlLabel, Checkbox, Link } from \"@material-ui/core\";\nimport classnames from \"classnames\";\nimport { useHistory } from \"react-router\";\n\nimport FixedTextField from \"../../../components/FixedTextField\";\nimport { useNotifications } from \"../../../hooks/NotificationsContext\";\nimport { useRedirectionURL } from \"../../../hooks/RedirectionURL\";\nimport LoginLayout from \"../../../layouts/LoginLayout\";\nimport { ResetPasswordStep1Route } from \"../../../Routes\";\nimport { postFirstFactor } from \"../../../services/FirstFactor\";\n\nexport interface Props {\n disabled: boolean;\n rememberMe: boolean;\n resetPassword: boolean;\n\n onAuthenticationStart: () => void;\n onAuthenticationFailure: () => void;\n onAuthenticationSuccess: (redirectURL: string | undefined) => void;\n}\n\nconst FirstFactorForm = function (props: Props) {\n const style = useStyles();\n const history = useHistory();\n const redirectionURL = useRedirectionURL();\n\n const [rememberMe, setRememberMe] = useState(false);\n const [username, setUsername] = useState(\"\");\n const [usernameError, setUsernameError] = useState(false);\n const [password, setPassword] = useState(\"\");\n const [passwordError, setPasswordError] = useState(false);\n const { createErrorNotification } = useNotifications();\n // TODO (PR: #806, Issue: #511) potentially refactor\n const usernameRef = useRef() as MutableRefObject;\n const passwordRef = useRef() as MutableRefObject;\n useEffect(() => {\n const timeout = setTimeout(() => usernameRef.current.focus(), 10);\n return () => clearTimeout(timeout);\n }, [usernameRef]);\n\n const disabled = props.disabled;\n\n const handleRememberMeChange = () => {\n setRememberMe(!rememberMe);\n };\n\n const handleSignIn = async () => {\n if (username === \"\" || password === \"\") {\n if (username === \"\") {\n setUsernameError(true);\n }\n\n if (password === \"\") {\n setPasswordError(true);\n }\n return;\n }\n\n props.onAuthenticationStart();\n try {\n const res = await postFirstFactor(username, password, rememberMe, redirectionURL);\n props.onAuthenticationSuccess(res ? res.redirect : undefined);\n } catch (err) {\n console.error(err);\n createErrorNotification(\"Incorrect username or password.\");\n props.onAuthenticationFailure();\n setPassword(\"\");\n passwordRef.current.focus();\n }\n };\n\n const handleResetPasswordClick = () => {\n history.push(ResetPasswordStep1Route);\n };\n\n return (\n \n \n \n setUsername(v.target.value)}\n onFocus={() => setUsernameError(false)}\n autoCapitalize=\"none\"\n onKeyPress={(ev) => {\n if (ev.key === \"Enter\") {\n if (!username.length) {\n setUsernameError(true);\n } else if (username.length && password.length) {\n handleSignIn();\n } else {\n setUsernameError(false);\n passwordRef.current.focus();\n }\n }\n }}\n />\n \n \n setPassword(v.target.value)}\n onFocus={() => setPasswordError(false)}\n type=\"password\"\n onKeyPress={(ev) => {\n if (ev.key === \"Enter\") {\n if (!username.length) {\n usernameRef.current.focus();\n } else if (!password.length) {\n passwordRef.current.focus();\n }\n handleSignIn();\n ev.preventDefault();\n }\n }}\n />\n \n {props.rememberMe || props.resetPassword ? (\n \n {props.rememberMe ? (\n {\n if (ev.key === \"Enter\") {\n if (!username.length) {\n usernameRef.current.focus();\n } else if (!password.length) {\n passwordRef.current.focus();\n }\n handleSignIn();\n }\n }}\n value=\"rememberMe\"\n color=\"primary\"\n />\n }\n className={style.rememberMe}\n label=\"Remember me\"\n />\n ) : null}\n {props.resetPassword ? (\n \n Reset password?\n \n ) : null}\n \n ) : null}\n \n \n Sign in\n \n \n \n \n );\n};\n\nexport default FirstFactorForm;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n marginTop: theme.spacing(),\n marginBottom: theme.spacing(),\n },\n actionRow: {\n display: \"flex\",\n flexDirection: \"row\",\n marginTop: theme.spacing(-1),\n marginBottom: theme.spacing(-1),\n },\n resetLink: {\n cursor: \"pointer\",\n paddingTop: 13.5,\n paddingBottom: 13.5,\n },\n rememberMe: {\n flexGrow: 1,\n },\n flexEnd: {\n justifyContent: \"flex-end\",\n },\n leftAlign: {\n textAlign: \"left\",\n },\n rightAlign: {\n textAlign: \"right\",\n verticalAlign: \"bottom\",\n },\n}));\n","import React from \"react\";\n\nimport { useIntermittentClass } from \"../hooks/IntermittentClass\";\nimport style from \"./PushNotificationIcon.module.css\";\n\nexport interface Props {\n width: number;\n height: number;\n\n animated?: boolean;\n}\n\nconst PushNotificationIcon = function (props: Props) {\n const idleMilliseconds = 2500;\n const wiggleMilliseconds = 500;\n const startMilliseconds = 500;\n const wiggleClass = useIntermittentClass(\n props.animated ? style.wiggle : \"\",\n wiggleMilliseconds,\n idleMilliseconds,\n startMilliseconds,\n );\n\n return (\n \n \n \n \n \n \n \n\n \n \n \n \n \n );\n};\n\nexport default PushNotificationIcon;\n","import { useState, useEffect } from \"react\";\n\nexport function useIntermittentClass(\n classname: string,\n activeMilliseconds: number,\n inactiveMillisecond: number,\n startMillisecond?: number,\n) {\n const [currentClass, setCurrentClass] = useState(\"\");\n const [firstTime, setFirstTime] = useState(true);\n\n useEffect(() => {\n let timeout: NodeJS.Timeout;\n\n if (firstTime) {\n if (startMillisecond && startMillisecond > 0) {\n timeout = setTimeout(() => {\n setCurrentClass(classname);\n setFirstTime(false);\n }, startMillisecond);\n } else {\n timeout = setTimeout(() => {\n setCurrentClass(classname);\n setFirstTime(false);\n }, 0);\n }\n } else {\n if (currentClass === \"\") {\n timeout = setTimeout(() => setCurrentClass(classname), inactiveMillisecond);\n } else {\n timeout = setTimeout(() => setCurrentClass(\"\"), activeMilliseconds);\n }\n }\n return () => clearTimeout(timeout);\n }, [currentClass, classname, activeMilliseconds, inactiveMillisecond, startMillisecond, firstTime]);\n\n return currentClass;\n}\n","import React from \"react\";\n\nexport interface Props {\n maxProgress?: number;\n progress: number;\n\n width?: number;\n height?: number;\n\n color?: string;\n backgroundColor?: string;\n}\n\nconst PieChartIcon = function (props: Props) {\n const maxProgress = props.maxProgress ? props.maxProgress : 100;\n const width = props.width ? props.width : 20;\n const height = props.height ? props.height : 20;\n\n const color = props.color ? props.color : \"black\";\n const backgroundColor = props.backgroundColor ? props.backgroundColor : \"white\";\n\n return (\n \n \n \n \n \n );\n};\n\nexport default PieChartIcon;\n","import React, { useState, useEffect } from \"react\";\n\nimport PieChartIcon from \"./PieChartIcon\";\n\nexport interface Props {\n width: number;\n height: number;\n period: number;\n\n color?: string;\n backgroundColor?: string;\n}\n\nconst TimerIcon = function (props: Props) {\n const radius = 31.6;\n const [timeProgress, setTimeProgress] = useState(0);\n\n useEffect(() => {\n // Get the current number of seconds to initialize timer.\n const initialValue = (((new Date().getTime() / 1000) % props.period) / props.period) * radius;\n setTimeProgress(initialValue);\n\n const interval = setInterval(() => {\n const value = (((new Date().getTime() / 1000) % props.period) / props.period) * radius;\n setTimeProgress(value);\n }, 100);\n return () => clearInterval(interval);\n }, [props]);\n\n return (\n \n );\n};\n\nexport default TimerIcon;\n","import React, { ReactNode } from \"react\";\n\nimport {\n Dialog,\n Grid,\n makeStyles,\n DialogContent,\n Button,\n DialogActions,\n Typography,\n useTheme,\n} from \"@material-ui/core\";\n\nimport FingerTouchIcon from \"../../../components/FingerTouchIcon\";\nimport PushNotificationIcon from \"../../../components/PushNotificationIcon\";\nimport TimerIcon from \"../../../components/TimerIcon\";\nimport { SecondFactorMethod } from \"../../../models/Methods\";\n\nexport interface Props {\n open: boolean;\n methods: Set;\n u2fSupported: boolean;\n\n onClose: () => void;\n onClick: (method: SecondFactorMethod) => void;\n}\n\nconst MethodSelectionDialog = function (props: Props) {\n const style = useStyles();\n const theme = useTheme();\n\n const pieChartIcon = (\n \n );\n\n return (\n \n \n \n {props.methods.has(SecondFactorMethod.TOTP) ? (\n props.onClick(SecondFactorMethod.TOTP)}\n />\n ) : null}\n {props.methods.has(SecondFactorMethod.U2F) && props.u2fSupported ? (\n }\n onClick={() => props.onClick(SecondFactorMethod.U2F)}\n />\n ) : null}\n {props.methods.has(SecondFactorMethod.MobilePush) ? (\n }\n onClick={() => props.onClick(SecondFactorMethod.MobilePush)}\n />\n ) : null}\n \n \n \n \n \n \n );\n};\n\nexport default MethodSelectionDialog;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n textAlign: \"center\",\n },\n}));\n\ninterface MethodItemProps {\n id: string;\n method: string;\n icon: ReactNode;\n\n onClick: () => void;\n}\n\nfunction MethodItem(props: MethodItemProps) {\n const style = makeStyles((theme) => ({\n item: {\n paddingTop: theme.spacing(4),\n paddingBottom: theme.spacing(4),\n width: \"100%\",\n },\n icon: {\n display: \"inline-block\",\n fill: \"white\",\n },\n buttonRoot: {\n display: \"block\",\n },\n }))();\n\n return (\n \n \n
{props.icon}
\n
\n {props.method}\n
\n \n
\n );\n}\n","import { CompleteTOTPSignInPath } from \"./Api\";\nimport { PostWithOptionalResponse } from \"./Client\";\nimport { SignInResponse } from \"./SignIn\";\n\ninterface CompleteU2FSigninBody {\n token: string;\n targetURL?: string;\n}\n\nexport function completeTOTPSignIn(passcode: string, targetURL: string | undefined) {\n const body: CompleteU2FSigninBody = { token: `${passcode}` };\n if (targetURL) {\n body.targetURL = targetURL;\n }\n return PostWithOptionalResponse(CompleteTOTPSignInPath, body);\n}\n","import React from \"react\";\n\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\nexport interface Props {}\n\nconst InformationIcon = function (props: Props) {\n return ;\n};\n\nexport default InformationIcon;\n","import React, { ReactNode, Fragment } from \"react\";\n\nimport { makeStyles, Typography, Link, useTheme } from \"@material-ui/core\";\nimport classnames from \"classnames\";\n\nimport InformationIcon from \"../../../components/InformationIcon\";\nimport Authenticated from \"../Authenticated\";\n\nexport enum State {\n ALREADY_AUTHENTICATED = 1,\n NOT_REGISTERED = 2,\n METHOD = 3,\n}\n\nexport interface Props {\n id: string;\n title: string;\n explanation: string;\n state: State;\n children: ReactNode;\n\n onRegisterClick?: () => void;\n}\n\nconst DefaultMethodContainer = function (props: Props) {\n const style = useStyles();\n\n let container: ReactNode;\n let stateClass: string = \"\";\n switch (props.state) {\n case State.ALREADY_AUTHENTICATED:\n container = ;\n stateClass = \"state-already-authenticated\";\n break;\n case State.NOT_REGISTERED:\n container = ;\n stateClass = \"state-not-registered\";\n break;\n case State.METHOD:\n container = {props.children};\n stateClass = \"state-method\";\n break;\n }\n\n return (\n
\n {props.title}\n
\n
{container}
\n
\n {props.onRegisterClick ? (\n \n Not registered yet?\n \n ) : null}\n
\n );\n};\n\nexport default DefaultMethodContainer;\n\nconst useStyles = makeStyles((theme) => ({\n container: {\n height: \"200px\",\n },\n containerFlex: {\n display: \"flex\",\n flexWrap: \"wrap\",\n height: \"100%\",\n width: \"100%\",\n alignItems: \"center\",\n alignContent: \"center\",\n justifyContent: \"center\",\n },\n}));\n\nfunction NotRegisteredContainer() {\n const theme = useTheme();\n return (\n \n
\n \n
\n \n Register your first device by clicking on the link below\n \n
\n );\n}\n\ninterface MethodContainerProps {\n explanation: string;\n children: ReactNode;\n}\n\nfunction MethodContainer(props: MethodContainerProps) {\n const theme = useTheme();\n return (\n \n
{props.children}
\n {props.explanation}\n
\n );\n}\n","import React, { useState, useEffect, useCallback } from \"react\";\n\nimport { useRedirectionURL } from \"../../../hooks/RedirectionURL\";\nimport { completeTOTPSignIn } from \"../../../services/OneTimePassword\";\nimport { AuthenticationLevel } from \"../../../services/State\";\nimport MethodContainer, { State as MethodContainerState } from \"./MethodContainer\";\nimport OTPDial from \"./OTPDial\";\n\nexport enum State {\n Idle = 1,\n InProgress = 2,\n Success = 3,\n Failure = 4,\n}\n\nexport interface Props {\n id: string;\n authenticationLevel: AuthenticationLevel;\n registered: boolean;\n totp_period: number;\n\n onRegisterClick: () => void;\n onSignInError: (err: Error) => void;\n onSignInSuccess: (redirectURL: string | undefined) => void;\n}\n\nconst OneTimePasswordMethod = function (props: Props) {\n const [passcode, setPasscode] = useState(\"\");\n const [state, setState] = useState(\n props.authenticationLevel === AuthenticationLevel.TwoFactor ? State.Success : State.Idle,\n );\n const redirectionURL = useRedirectionURL();\n\n const { onSignInSuccess, onSignInError } = props;\n /* eslint-disable react-hooks/exhaustive-deps */\n const onSignInErrorCallback = useCallback(onSignInError, []);\n const onSignInSuccessCallback = useCallback(onSignInSuccess, []);\n /* eslint-enable react-hooks/exhaustive-deps */\n\n const signInFunc = useCallback(async () => {\n if (props.authenticationLevel === AuthenticationLevel.TwoFactor) {\n return;\n }\n\n const passcodeStr = `${passcode}`;\n\n if (!passcode || passcodeStr.length !== 6) {\n return;\n }\n\n try {\n setState(State.InProgress);\n const res = await completeTOTPSignIn(passcodeStr, redirectionURL);\n setState(State.Success);\n onSignInSuccessCallback(res ? res.redirect : undefined);\n } catch (err) {\n console.error(err);\n onSignInErrorCallback(new Error(\"The one-time password might be wrong\"));\n setState(State.Failure);\n }\n setPasscode(\"\");\n }, [passcode, onSignInErrorCallback, onSignInSuccessCallback, redirectionURL, props.authenticationLevel]);\n\n // Set successful state if user is already authenticated.\n useEffect(() => {\n if (props.authenticationLevel >= AuthenticationLevel.TwoFactor) {\n setState(State.Success);\n }\n }, [props.authenticationLevel, setState]);\n\n useEffect(() => {\n signInFunc();\n }, [signInFunc]);\n\n let methodState = MethodContainerState.METHOD;\n if (props.authenticationLevel === AuthenticationLevel.TwoFactor) {\n methodState = MethodContainerState.ALREADY_AUTHENTICATED;\n } else if (!props.registered) {\n methodState = MethodContainerState.NOT_REGISTERED;\n }\n\n return (\n \n \n \n );\n};\n\nexport default OneTimePasswordMethod;\n","import React, { ReactNode } from \"react\";\n\nimport { makeStyles } from \"@material-ui/core\";\nimport classnames from \"classnames\";\n\ninterface IconWithContextProps {\n icon: ReactNode;\n context: ReactNode;\n\n className?: string;\n}\n\nconst IconWithContext = function (props: IconWithContextProps) {\n const iconSize = 64;\n const style = makeStyles((theme) => ({\n root: {},\n iconContainer: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n },\n icon: {\n width: iconSize,\n height: iconSize,\n },\n context: {\n display: \"block\",\n },\n }))();\n\n return (\n
\n
\n
{props.icon}
\n
\n
{props.context}
\n
\n );\n};\n\nexport default IconWithContext;\n","import React, { Fragment } from \"react\";\n\nimport { makeStyles } from \"@material-ui/core\";\nimport classnames from \"classnames\";\nimport OtpInput from \"react-otp-input\";\n\nimport SuccessIcon from \"../../../components/SuccessIcon\";\nimport TimerIcon from \"../../../components/TimerIcon\";\nimport IconWithContext from \"./IconWithContext\";\nimport { State } from \"./OneTimePasswordMethod\";\n\nexport interface Props {\n passcode: string;\n state: State;\n period: number;\n\n onChange: (passcode: string) => void;\n}\n\nconst OTPDial = function (props: Props) {\n const style = useStyles();\n const dial = (\n \n \n \n );\n\n return } context={dial} />;\n};\n\nexport default OTPDial;\n\nconst useStyles = makeStyles((theme) => ({\n timeProgress: {},\n register: {\n marginTop: theme.spacing(),\n },\n otpInput: {\n display: \"inline-block\",\n marginTop: theme.spacing(2),\n },\n otpDigitInput: {\n padding: theme.spacing(),\n marginLeft: theme.spacing(0.5),\n marginRight: theme.spacing(0.5),\n fontSize: \"1rem\",\n borderRadius: \"5px\",\n border: \"1px solid rgba(0,0,0,0.3)\",\n },\n inputError: {\n border: \"1px solid rgba(255, 2, 2, 0.95)\",\n },\n}));\n\ninterface IconProps {\n state: State;\n period: number;\n}\n\nfunction Icon(props: IconProps) {\n return (\n \n {props.state !== State.Success ? (\n \n ) : null}\n {props.state === State.Success ? : null}\n \n );\n}\n","import React, { useEffect, useCallback, useState, ReactNode } from \"react\";\n\nimport { Button, makeStyles } from \"@material-ui/core\";\n\nimport FailureIcon from \"../../../components/FailureIcon\";\nimport PushNotificationIcon from \"../../../components/PushNotificationIcon\";\nimport SuccessIcon from \"../../../components/SuccessIcon\";\nimport { useIsMountedRef } from \"../../../hooks/Mounted\";\nimport { useRedirectionURL } from \"../../../hooks/RedirectionURL\";\nimport { completePushNotificationSignIn } from \"../../../services/PushNotification\";\nimport { AuthenticationLevel } from \"../../../services/State\";\nimport MethodContainer, { State as MethodContainerState } from \"./MethodContainer\";\n\nexport enum State {\n SignInInProgress = 1,\n Success = 2,\n Failure = 3,\n}\n\nexport interface Props {\n id: string;\n authenticationLevel: AuthenticationLevel;\n\n onSignInError: (err: Error) => void;\n onSignInSuccess: (redirectURL: string | undefined) => void;\n}\n\nconst PushNotificationMethod = function (props: Props) {\n const style = useStyles();\n const [state, setState] = useState(State.SignInInProgress);\n const redirectionURL = useRedirectionURL();\n const mounted = useIsMountedRef();\n\n const { onSignInSuccess, onSignInError } = props;\n /* eslint-disable react-hooks/exhaustive-deps */\n const onSignInErrorCallback = useCallback(onSignInError, []);\n const onSignInSuccessCallback = useCallback(onSignInSuccess, []);\n /* eslint-enable react-hooks/exhaustive-deps */\n\n const signInFunc = useCallback(async () => {\n if (props.authenticationLevel === AuthenticationLevel.TwoFactor) {\n return;\n }\n\n try {\n setState(State.SignInInProgress);\n const res = await completePushNotificationSignIn(redirectionURL);\n // If the request was initiated and the user changed 2FA method in the meantime,\n // the process is interrupted to avoid updating state of unmounted component.\n if (!mounted.current) return;\n\n setState(State.Success);\n setTimeout(() => {\n if (!mounted.current) return;\n onSignInSuccessCallback(res ? res.redirect : undefined);\n }, 1500);\n } catch (err) {\n // If the request was initiated and the user changed 2FA method in the meantime,\n // the process is interrupted to avoid updating state of unmounted component.\n if (!mounted.current) return;\n\n console.error(err);\n onSignInErrorCallback(new Error(\"There was an issue completing sign in process\"));\n setState(State.Failure);\n }\n }, [onSignInErrorCallback, onSignInSuccessCallback, setState, redirectionURL, mounted, props.authenticationLevel]);\n\n useEffect(() => {\n signInFunc();\n }, [signInFunc]);\n\n // Set successful state if user is already authenticated.\n useEffect(() => {\n if (props.authenticationLevel >= AuthenticationLevel.TwoFactor) {\n setState(State.Success);\n }\n }, [props.authenticationLevel, setState]);\n\n let icon: ReactNode;\n switch (state) {\n case State.SignInInProgress:\n icon = ;\n break;\n case State.Success:\n icon = ;\n break;\n case State.Failure:\n icon = ;\n }\n\n let methodState = MethodContainerState.METHOD;\n if (props.authenticationLevel === AuthenticationLevel.TwoFactor) {\n methodState = MethodContainerState.ALREADY_AUTHENTICATED;\n }\n\n return (\n \n
{icon}
\n
\n \n
\n \n );\n};\n\nexport default PushNotificationMethod;\n\nconst useStyles = makeStyles((theme) => ({\n icon: {\n width: \"64px\",\n height: \"64px\",\n display: \"inline-block\",\n },\n}));\n","import React from \"react\";\n\nimport { faTimesCircle } from \"@fortawesome/free-regular-svg-icons\";\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\n\nexport interface Props {}\n\nconst FailureIcon = function (props: Props) {\n return ;\n};\n\nexport default FailureIcon;\n","import { useRef, useEffect } from \"react\";\n\nexport function useIsMountedRef() {\n const isMountedRef = useRef(false);\n useEffect(() => {\n isMountedRef.current = true;\n return () => {\n isMountedRef.current = false;\n };\n });\n return isMountedRef;\n}\n","import { CompletePushNotificationSignInPath } from \"./Api\";\nimport { PostWithOptionalResponse } from \"./Client\";\nimport { SignInResponse } from \"./SignIn\";\n\ninterface CompleteU2FSigninBody {\n targetURL?: string;\n}\n\nexport function completePushNotificationSignIn(targetURL: string | undefined) {\n const body: CompleteU2FSigninBody = {};\n if (targetURL) {\n body.targetURL = targetURL;\n }\n return PostWithOptionalResponse(CompletePushNotificationSignInPath, body);\n}\n","import React, { useCallback, useEffect, useState, Fragment } from \"react\";\n\nimport { makeStyles, Button, useTheme } from \"@material-ui/core\";\nimport { CSSProperties } from \"@material-ui/styles\";\nimport u2fApi from \"u2f-api\";\n\nimport FailureIcon from \"../../../components/FailureIcon\";\nimport FingerTouchIcon from \"../../../components/FingerTouchIcon\";\nimport LinearProgressBar from \"../../../components/LinearProgressBar\";\nimport { useIsMountedRef } from \"../../../hooks/Mounted\";\nimport { useRedirectionURL } from \"../../../hooks/RedirectionURL\";\nimport { useTimer } from \"../../../hooks/Timer\";\nimport { initiateU2FSignin, completeU2FSignin } from \"../../../services/SecurityKey\";\nimport { AuthenticationLevel } from \"../../../services/State\";\nimport IconWithContext from \"./IconWithContext\";\nimport MethodContainer, { State as MethodContainerState } from \"./MethodContainer\";\n\nexport enum State {\n WaitTouch = 1,\n SigninInProgress = 2,\n Failure = 3,\n}\n\nexport interface Props {\n id: string;\n authenticationLevel: AuthenticationLevel;\n registered: boolean;\n\n onRegisterClick: () => void;\n onSignInError: (err: Error) => void;\n onSignInSuccess: (redirectURL: string | undefined) => void;\n}\n\nconst SecurityKeyMethod = function (props: Props) {\n const signInTimeout = 30;\n const [state, setState] = useState(State.WaitTouch);\n const style = useStyles();\n const redirectionURL = useRedirectionURL();\n const mounted = useIsMountedRef();\n const [timerPercent, triggerTimer] = useTimer(signInTimeout * 1000 - 500);\n\n const { onSignInSuccess, onSignInError } = props;\n /* eslint-disable react-hooks/exhaustive-deps */\n const onSignInErrorCallback = useCallback(onSignInError, []);\n const onSignInSuccessCallback = useCallback(onSignInSuccess, []);\n /* eslint-enable react-hooks/exhaustive-deps */\n\n const doInitiateSignIn = useCallback(async () => {\n // If user is already authenticated, we don't initiate sign in process.\n if (!props.registered || props.authenticationLevel >= AuthenticationLevel.TwoFactor) {\n return;\n }\n\n try {\n triggerTimer();\n setState(State.WaitTouch);\n const signRequest = await initiateU2FSignin();\n const signRequests: u2fApi.SignRequest[] = [];\n for (var i in signRequest.registeredKeys) {\n const r = signRequest.registeredKeys[i];\n signRequests.push({\n appId: signRequest.appId,\n challenge: signRequest.challenge,\n keyHandle: r.keyHandle,\n version: r.version,\n });\n }\n const signResponse = await u2fApi.sign(signRequests, signInTimeout);\n // If the request was initiated and the user changed 2FA method in the meantime,\n // the process is interrupted to avoid updating state of unmounted component.\n if (!mounted.current) return;\n\n setState(State.SigninInProgress);\n const res = await completeU2FSignin(signResponse, redirectionURL);\n onSignInSuccessCallback(res ? res.redirect : undefined);\n } catch (err) {\n // If the request was initiated and the user changed 2FA method in the meantime,\n // the process is interrupted to avoid updating state of unmounted component.\n if (!mounted.current) return;\n console.error(err);\n onSignInErrorCallback(new Error(\"Failed to initiate security key sign in process\"));\n setState(State.Failure);\n }\n }, [\n onSignInSuccessCallback,\n onSignInErrorCallback,\n redirectionURL,\n mounted,\n triggerTimer,\n props.authenticationLevel,\n props.registered,\n ]);\n\n useEffect(() => {\n doInitiateSignIn();\n }, [doInitiateSignIn]);\n\n let methodState = MethodContainerState.METHOD;\n if (props.authenticationLevel === AuthenticationLevel.TwoFactor) {\n methodState = MethodContainerState.ALREADY_AUTHENTICATED;\n } else if (!props.registered) {\n methodState = MethodContainerState.NOT_REGISTERED;\n }\n\n return (\n \n
\n \n
\n \n );\n};\n\nexport default SecurityKeyMethod;\n\nconst useStyles = makeStyles((theme) => ({\n icon: {\n display: \"inline-block\",\n },\n}));\n\ninterface IconProps {\n state: State;\n\n timer: number;\n onRetryClick: () => void;\n}\n\nfunction Icon(props: IconProps) {\n const state = props.state as State;\n const theme = useTheme();\n\n const progressBarStyle: CSSProperties = {\n marginTop: theme.spacing(),\n };\n\n const touch = (\n }\n context={}\n className={state === State.WaitTouch ? undefined : \"hidden\"}\n />\n );\n\n const failure = (\n }\n context={\n \n }\n className={state === State.Failure ? undefined : \"hidden\"}\n />\n );\n\n return (\n \n {touch}\n {failure}\n \n );\n}\n","import React from \"react\";\n\nimport { makeStyles, LinearProgress } from \"@material-ui/core\";\nimport { CSSProperties } from \"@material-ui/styles\";\n\nexport interface Props {\n value: number;\n height?: number;\n className?: string;\n style?: CSSProperties;\n}\n\nconst LinearProgressBar = function (props: Props) {\n const style = makeStyles((theme) => ({\n progressRoot: {\n height: props.height ? props.height : theme.spacing(),\n },\n transition: {\n transition: \"transform .2s linear\",\n },\n }))();\n return (\n \n );\n};\n\nexport default LinearProgressBar;\n","import u2fApi from \"u2f-api\";\n\nimport { InitiateU2FSignInPath, CompleteU2FSignInPath } from \"./Api\";\nimport { Post, PostWithOptionalResponse } from \"./Client\";\nimport { SignInResponse } from \"./SignIn\";\n\ninterface InitiateU2FSigninResponse {\n appId: string;\n challenge: string;\n registeredKeys: {\n appId: string;\n keyHandle: string;\n version: string;\n }[];\n}\n\nexport async function initiateU2FSignin() {\n return Post(InitiateU2FSignInPath);\n}\n\ninterface CompleteU2FSigninBody {\n signResponse: u2fApi.SignResponse;\n targetURL?: string;\n}\n\nexport function completeU2FSignin(signResponse: u2fApi.SignResponse, targetURL: string | undefined) {\n const body: CompleteU2FSigninBody = { signResponse };\n if (targetURL) {\n body.targetURL = targetURL;\n }\n return PostWithOptionalResponse(CompleteU2FSignInPath, body);\n}\n","import { useState, useCallback, useEffect } from \"react\";\n\nexport function useTimer(timeoutMs: number): [number, () => void, () => void] {\n const Interval = 100;\n const [startDate, setStartDate] = useState(undefined as Date | undefined);\n const [percent, setPercent] = useState(0);\n\n const trigger = useCallback(() => {\n setPercent(0);\n setStartDate(new Date());\n }, [setStartDate, setPercent]);\n\n const clear = useCallback(() => {\n setPercent(0);\n setStartDate(undefined);\n }, []);\n\n useEffect(() => {\n if (!startDate) {\n return;\n }\n\n const intervalNode = setInterval(() => {\n const elapsedMs = startDate ? new Date().getTime() - startDate.getTime() : 0;\n let p = (elapsedMs / timeoutMs) * 100.0;\n if (p >= 100) {\n p = 100;\n setStartDate(undefined);\n }\n setPercent(p);\n }, Interval);\n\n return () => clearInterval(intervalNode);\n }, [startDate, setPercent, setStartDate, timeoutMs]);\n\n return [percent, trigger, clear];\n}\n","import React, { useState, useEffect } from \"react\";\n\nimport { Grid, makeStyles, Button } from \"@material-ui/core\";\nimport { useHistory, Switch, Route, Redirect } from \"react-router\";\nimport u2fApi from \"u2f-api\";\n\nimport { useNotifications } from \"../../../hooks/NotificationsContext\";\nimport LoginLayout from \"../../../layouts/LoginLayout\";\nimport { Configuration } from \"../../../models/Configuration\";\nimport { SecondFactorMethod } from \"../../../models/Methods\";\nimport { UserInfo } from \"../../../models/UserInfo\";\nimport {\n LogoutRoute as SignOutRoute,\n SecondFactorTOTPRoute,\n SecondFactorPushRoute,\n SecondFactorU2FRoute,\n SecondFactorRoute,\n} from \"../../../Routes\";\nimport { initiateTOTPRegistrationProcess, initiateU2FRegistrationProcess } from \"../../../services/RegisterDevice\";\nimport { AuthenticationLevel } from \"../../../services/State\";\nimport { setPreferred2FAMethod } from \"../../../services/UserPreferences\";\nimport MethodSelectionDialog from \"./MethodSelectionDialog\";\nimport OneTimePasswordMethod from \"./OneTimePasswordMethod\";\nimport PushNotificationMethod from \"./PushNotificationMethod\";\nimport SecurityKeyMethod from \"./SecurityKeyMethod\";\n\nconst EMAIL_SENT_NOTIFICATION = \"An email has been sent to your address to complete the process.\";\n\nexport interface Props {\n authenticationLevel: AuthenticationLevel;\n\n userInfo: UserInfo;\n configuration: Configuration;\n\n onMethodChanged: (method: SecondFactorMethod) => void;\n onAuthenticationSuccess: (redirectURL: string | undefined) => void;\n}\n\nconst SecondFactorForm = function (props: Props) {\n const style = useStyles();\n const history = useHistory();\n const [methodSelectionOpen, setMethodSelectionOpen] = useState(false);\n const { createInfoNotification, createErrorNotification } = useNotifications();\n const [registrationInProgress, setRegistrationInProgress] = useState(false);\n const [u2fSupported, setU2fSupported] = useState(false);\n\n // Check that U2F is supported.\n useEffect(() => {\n u2fApi.ensureSupport().then(\n () => setU2fSupported(true),\n () => console.error(\"U2F not supported\"),\n );\n }, [setU2fSupported]);\n\n const initiateRegistration = (initiateRegistrationFunc: () => Promise) => {\n return async () => {\n if (registrationInProgress) {\n return;\n }\n setRegistrationInProgress(true);\n try {\n await initiateRegistrationFunc();\n createInfoNotification(EMAIL_SENT_NOTIFICATION);\n } catch (err) {\n console.error(err);\n createErrorNotification(\"There was a problem initiating the registration process\");\n }\n setRegistrationInProgress(false);\n };\n };\n\n const handleMethodSelectionClick = () => {\n setMethodSelectionOpen(true);\n };\n\n const handleMethodSelected = async (method: SecondFactorMethod) => {\n try {\n await setPreferred2FAMethod(method);\n setMethodSelectionOpen(false);\n props.onMethodChanged(method);\n } catch (err) {\n console.error(err);\n createErrorNotification(\"There was an issue updating preferred second factor method\");\n }\n };\n\n const handleLogoutClick = () => {\n history.push(SignOutRoute);\n };\n\n return (\n \n setMethodSelectionOpen(false)}\n onClick={handleMethodSelected}\n />\n \n \n \n {\" | \"}\n \n \n \n \n \n createErrorNotification(err.message)}\n onSignInSuccess={props.onAuthenticationSuccess}\n />\n \n \n createErrorNotification(err.message)}\n onSignInSuccess={props.onAuthenticationSuccess}\n />\n \n \n createErrorNotification(err.message)}\n onSignInSuccess={props.onAuthenticationSuccess}\n />\n \n \n \n \n \n \n \n \n );\n};\n\nexport default SecondFactorForm;\n\nconst useStyles = makeStyles((theme) => ({\n methodContainer: {\n border: \"1px solid #d6d6d6\",\n borderRadius: \"10px\",\n padding: theme.spacing(4),\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n}));\n","import React, { useEffect, Fragment, ReactNode, useState, useCallback } from \"react\";\n\nimport { Switch, Route, Redirect, useHistory, useLocation } from \"react-router\";\n\nimport { useConfiguration } from \"../../hooks/Configuration\";\nimport { useNotifications } from \"../../hooks/NotificationsContext\";\nimport { useRedirectionURL } from \"../../hooks/RedirectionURL\";\nimport { useAutheliaState } from \"../../hooks/State\";\nimport { useUserPreferences as userUserInfo } from \"../../hooks/UserInfo\";\nimport { SecondFactorMethod } from \"../../models/Methods\";\nimport {\n FirstFactorRoute,\n SecondFactorRoute,\n SecondFactorTOTPRoute,\n SecondFactorPushRoute,\n SecondFactorU2FRoute,\n AuthenticatedRoute,\n} from \"../../Routes\";\nimport { AuthenticationLevel } from \"../../services/State\";\nimport LoadingPage from \"../LoadingPage/LoadingPage\";\nimport AuthenticatedView from \"./AuthenticatedView/AuthenticatedView\";\nimport FirstFactorForm from \"./FirstFactor/FirstFactorForm\";\nimport SecondFactorForm from \"./SecondFactor/SecondFactorForm\";\n\nexport interface Props {\n rememberMe: boolean;\n resetPassword: boolean;\n}\n\nconst LoginPortal = function (props: Props) {\n const history = useHistory();\n const location = useLocation();\n const redirectionURL = useRedirectionURL();\n const { createErrorNotification } = useNotifications();\n const [firstFactorDisabled, setFirstFactorDisabled] = useState(true);\n\n const [state, fetchState, , fetchStateError] = useAutheliaState();\n const [userInfo, fetchUserInfo, , fetchUserInfoError] = userUserInfo();\n const [configuration, fetchConfiguration, , fetchConfigurationError] = useConfiguration();\n\n const redirect = useCallback((url: string) => history.push(url), [history]);\n\n // Fetch the state when portal is mounted.\n useEffect(() => {\n fetchState();\n }, [fetchState]);\n\n // Fetch preferences and configuration when user is authenticated.\n useEffect(() => {\n if (state && state.authentication_level >= AuthenticationLevel.OneFactor) {\n fetchUserInfo();\n fetchConfiguration();\n }\n }, [state, fetchUserInfo, fetchConfiguration]);\n\n // Enable first factor when user is unauthenticated.\n useEffect(() => {\n if (state && state.authentication_level > AuthenticationLevel.Unauthenticated) {\n setFirstFactorDisabled(true);\n }\n }, [state, setFirstFactorDisabled]);\n\n // Display an error when state fetching fails\n useEffect(() => {\n if (fetchStateError) {\n createErrorNotification(\"There was an issue fetching the current user state\");\n }\n }, [fetchStateError, createErrorNotification]);\n\n // Display an error when configuration fetching fails\n useEffect(() => {\n if (fetchConfigurationError) {\n createErrorNotification(\"There was an issue retrieving global configuration\");\n }\n }, [fetchConfigurationError, createErrorNotification]);\n\n // Display an error when preferences fetching fails\n useEffect(() => {\n if (fetchUserInfoError) {\n createErrorNotification(\"There was an issue retrieving user preferences\");\n }\n }, [fetchUserInfoError, createErrorNotification]);\n\n // Redirect to the correct stage if not enough authenticated\n useEffect(() => {\n if (state) {\n const redirectionSuffix = redirectionURL ? `?rd=${encodeURIComponent(redirectionURL)}` : \"\";\n\n if (state.authentication_level === AuthenticationLevel.Unauthenticated) {\n setFirstFactorDisabled(false);\n redirect(`${FirstFactorRoute}${redirectionSuffix}`);\n } else if (state.authentication_level >= AuthenticationLevel.OneFactor && userInfo && configuration) {\n if (!configuration.second_factor_enabled) {\n redirect(AuthenticatedRoute);\n } else {\n if (userInfo.method === SecondFactorMethod.U2F) {\n redirect(`${SecondFactorU2FRoute}${redirectionSuffix}`);\n } else if (userInfo.method === SecondFactorMethod.MobilePush) {\n redirect(`${SecondFactorPushRoute}${redirectionSuffix}`);\n } else {\n redirect(`${SecondFactorTOTPRoute}${redirectionSuffix}`);\n }\n }\n }\n }\n }, [state, redirectionURL, redirect, userInfo, setFirstFactorDisabled, configuration]);\n\n const handleAuthSuccess = async (redirectionURL: string | undefined) => {\n if (redirectionURL) {\n // Do an external redirection pushed by the server.\n window.location.href = redirectionURL;\n } else {\n // Refresh state\n fetchState();\n }\n };\n\n const firstFactorReady =\n state !== undefined &&\n state.authentication_level === AuthenticationLevel.Unauthenticated &&\n location.pathname === FirstFactorRoute;\n\n return (\n \n \n \n setFirstFactorDisabled(true)}\n onAuthenticationFailure={() => setFirstFactorDisabled(false)}\n onAuthenticationSuccess={handleAuthSuccess}\n />\n \n \n \n {state && userInfo && configuration ? (\n fetchUserInfo()}\n onAuthenticationSuccess={handleAuthSuccess}\n />\n ) : null}\n \n \n {userInfo ? : null}\n \n \n \n \n \n );\n};\n\nexport default LoginPortal;\n\ninterface ComponentOrLoadingProps {\n ready: boolean;\n\n children: ReactNode;\n}\n\nfunction ComponentOrLoading(props: ComponentOrLoadingProps) {\n return (\n \n
\n \n
\n {props.ready ? props.children : null}\n
\n );\n}\n","import { getState } from \"../services/State\";\nimport { useRemoteCall } from \"./RemoteCall\";\n\nexport function useAutheliaState() {\n return useRemoteCall(getState, []);\n}\n","import { getUserPreferences } from \"../services/UserPreferences\";\nimport { useRemoteCall } from \"./RemoteCall\";\n\nexport function useUserPreferences() {\n return useRemoteCall(getUserPreferences, []);\n}\n","import { getConfiguration } from \"../services/Configuration\";\nimport { useRemoteCall } from \"./RemoteCall\";\n\nexport function useConfiguration() {\n return useRemoteCall(getConfiguration, []);\n}\n","import { LogoutPath } from \"./Api\";\nimport { PostWithOptionalResponse } from \"./Client\";\n\nexport async function signOut() {\n return PostWithOptionalResponse(LogoutPath);\n}\n","import React, { useEffect, useCallback, useState } from \"react\";\n\nimport { Typography, makeStyles } from \"@material-ui/core\";\nimport { Redirect } from \"react-router\";\n\nimport { useIsMountedRef } from \"../../../hooks/Mounted\";\nimport { useNotifications } from \"../../../hooks/NotificationsContext\";\nimport { useRedirectionURL } from \"../../../hooks/RedirectionURL\";\nimport LoginLayout from \"../../../layouts/LoginLayout\";\nimport { FirstFactorRoute } from \"../../../Routes\";\nimport { signOut } from \"../../../services/SignOut\";\n\nexport interface Props {}\n\nconst SignOut = function (props: Props) {\n const mounted = useIsMountedRef();\n const style = useStyles();\n const { createErrorNotification } = useNotifications();\n const redirectionURL = useRedirectionURL();\n const [timedOut, setTimedOut] = useState(false);\n\n const doSignOut = useCallback(async () => {\n try {\n // TODO(c.michaud): pass redirection URL to backend for validation.\n await signOut();\n setTimeout(() => {\n if (!mounted) {\n return;\n }\n setTimedOut(true);\n }, 2000);\n } catch (err) {\n console.error(err);\n createErrorNotification(\"There was an issue signing out\");\n }\n }, [createErrorNotification, setTimedOut, mounted]);\n\n useEffect(() => {\n doSignOut();\n }, [doSignOut]);\n\n if (timedOut) {\n if (redirectionURL) {\n window.location.href = redirectionURL;\n } else {\n return ;\n }\n }\n\n return (\n \n You're being signed out and redirected...\n \n );\n};\n\nexport default SignOut;\n\nconst useStyles = makeStyles((theme) => ({\n typo: {\n padding: theme.spacing(),\n },\n}));\n","import { InitiateResetPasswordPath, CompleteResetPasswordPath, ResetPasswordPath } from \"./Api\";\nimport { PostWithOptionalResponse } from \"./Client\";\n\nexport async function initiateResetPasswordProcess(username: string) {\n return PostWithOptionalResponse(InitiateResetPasswordPath, { username });\n}\n\nexport async function completeResetPasswordProcess(token: string) {\n return PostWithOptionalResponse(CompleteResetPasswordPath, { token });\n}\n\nexport async function resetPassword(newPassword: string) {\n return PostWithOptionalResponse(ResetPasswordPath, { password: newPassword });\n}\n","import React, { useState } from \"react\";\n\nimport { Grid, Button, makeStyles } from \"@material-ui/core\";\nimport { useHistory } from \"react-router\";\n\nimport FixedTextField from \"../../components/FixedTextField\";\nimport { useNotifications } from \"../../hooks/NotificationsContext\";\nimport LoginLayout from \"../../layouts/LoginLayout\";\nimport { FirstFactorRoute } from \"../../Routes\";\nimport { initiateResetPasswordProcess } from \"../../services/ResetPassword\";\n\nconst ResetPasswordStep1 = function () {\n const style = useStyles();\n const [username, setUsername] = useState(\"\");\n const [error, setError] = useState(false);\n const { createInfoNotification, createErrorNotification } = useNotifications();\n const history = useHistory();\n\n const doInitiateResetPasswordProcess = async () => {\n if (username === \"\") {\n setError(true);\n return;\n }\n\n try {\n await initiateResetPasswordProcess(username);\n createInfoNotification(\"An email has been sent to your address to complete the process.\");\n } catch (err) {\n createErrorNotification(\"There was an issue initiating the password reset process.\");\n }\n };\n\n const handleResetClick = () => {\n doInitiateResetPasswordProcess();\n };\n\n const handleCancelClick = () => {\n history.push(FirstFactorRoute);\n };\n\n return (\n \n \n \n setUsername(e.target.value)}\n onKeyPress={(ev) => {\n if (ev.key === \"Enter\") {\n doInitiateResetPasswordProcess();\n ev.preventDefault();\n }\n }}\n />\n \n \n \n \n \n \n Cancel\n \n \n \n \n );\n};\n\nexport default ResetPasswordStep1;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n}));\n","import React, { useState, useCallback, useEffect } from \"react\";\n\nimport { Grid, Button, makeStyles } from \"@material-ui/core\";\nimport classnames from \"classnames\";\nimport { useHistory, useLocation } from \"react-router\";\n\nimport FixedTextField from \"../../components/FixedTextField\";\nimport { useNotifications } from \"../../hooks/NotificationsContext\";\nimport LoginLayout from \"../../layouts/LoginLayout\";\nimport { FirstFactorRoute } from \"../../Routes\";\nimport { completeResetPasswordProcess, resetPassword } from \"../../services/ResetPassword\";\nimport { extractIdentityToken } from \"../../utils/IdentityToken\";\n\nconst ResetPasswordStep2 = function () {\n const style = useStyles();\n const location = useLocation();\n const [formDisabled, setFormDisabled] = useState(true);\n const [password1, setPassword1] = useState(\"\");\n const [password2, setPassword2] = useState(\"\");\n const [errorPassword1, setErrorPassword1] = useState(false);\n const [errorPassword2, setErrorPassword2] = useState(false);\n const { createSuccessNotification, createErrorNotification } = useNotifications();\n const history = useHistory();\n // Get the token from the query param to give it back to the API when requesting\n // the secret for OTP.\n const processToken = extractIdentityToken(location.search);\n\n const completeProcess = useCallback(async () => {\n if (!processToken) {\n setFormDisabled(true);\n createErrorNotification(\"No verification token provided\");\n return;\n }\n\n try {\n setFormDisabled(true);\n await completeResetPasswordProcess(processToken);\n setFormDisabled(false);\n } catch (err) {\n console.error(err);\n createErrorNotification(\n \"There was an issue completing the process. The verification token might have expired.\",\n );\n setFormDisabled(true);\n }\n }, [processToken, createErrorNotification]);\n\n useEffect(() => {\n completeProcess();\n }, [completeProcess]);\n\n const doResetPassword = async () => {\n if (password1 === \"\" || password2 === \"\") {\n if (password1 === \"\") {\n setErrorPassword1(true);\n }\n if (password2 === \"\") {\n setErrorPassword2(true);\n }\n return;\n }\n if (password1 !== password2) {\n setErrorPassword1(true);\n setErrorPassword2(true);\n createErrorNotification(\"Passwords do not match.\");\n return;\n }\n\n try {\n await resetPassword(password1);\n createSuccessNotification(\"Password has been reset.\");\n setTimeout(() => history.push(FirstFactorRoute), 1500);\n setFormDisabled(true);\n } catch (err) {\n console.error(err);\n if (err.message.includes(\"0000052D.\")) {\n createErrorNotification(\"Your supplied password does not meet the password policy requirements.\");\n } else {\n createErrorNotification(\"There was an issue resetting the password.\");\n }\n }\n };\n\n const handleResetClick = () => doResetPassword();\n\n const handleCancelClick = () => history.push(FirstFactorRoute);\n\n return (\n \n \n \n setPassword1(e.target.value)}\n error={errorPassword1}\n className={classnames(style.fullWidth)}\n />\n \n \n setPassword2(e.target.value)}\n error={errorPassword2}\n onKeyPress={(ev) => {\n if (ev.key === \"Enter\") {\n doResetPassword();\n ev.preventDefault();\n }\n }}\n className={classnames(style.fullWidth)}\n />\n \n \n \n Reset\n \n \n \n \n Cancel\n \n \n \n \n );\n};\n\nexport default ResetPasswordStep2;\n\nconst useStyles = makeStyles((theme) => ({\n root: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n fullWidth: {\n width: \"100%\",\n },\n}));\n","import React, { useState } from \"react\";\n\nimport { config as faConfig } from \"@fortawesome/fontawesome-svg-core\";\nimport { CssBaseline, ThemeProvider } from \"@material-ui/core\";\nimport { BrowserRouter as Router, Route, Switch, Redirect } from \"react-router-dom\";\n\nimport NotificationBar from \"./components/NotificationBar\";\nimport NotificationsContext from \"./hooks/NotificationsContext\";\nimport { Notification } from \"./models/Notifications\";\nimport {\n FirstFactorRoute,\n ResetPasswordStep2Route,\n ResetPasswordStep1Route,\n RegisterSecurityKeyRoute,\n RegisterOneTimePasswordRoute,\n LogoutRoute,\n} from \"./Routes\";\nimport * as themes from \"./themes\";\nimport { getBasePath } from \"./utils/BasePath\";\nimport { getRememberMe, getResetPassword, getTheme } from \"./utils/Configuration\";\nimport RegisterOneTimePassword from \"./views/DeviceRegistration/RegisterOneTimePassword\";\nimport RegisterSecurityKey from \"./views/DeviceRegistration/RegisterSecurityKey\";\nimport LoginPortal from \"./views/LoginPortal/LoginPortal\";\nimport SignOut from \"./views/LoginPortal/SignOut/SignOut\";\nimport ResetPasswordStep1 from \"./views/ResetPassword/ResetPasswordStep1\";\nimport ResetPasswordStep2 from \"./views/ResetPassword/ResetPasswordStep2\";\n\nimport \"@fortawesome/fontawesome-svg-core/styles.css\";\n\nfaConfig.autoAddCss = false;\n\nfunction Theme() {\n switch (getTheme()) {\n case \"dark\":\n return themes.Dark;\n case \"grey\":\n return themes.Grey;\n default:\n return themes.Light;\n }\n}\n\nconst App: React.FC = () => {\n const [notification, setNotification] = useState(null as Notification | null);\n\n return (\n \n \n \n \n setNotification(null)} />\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n );\n};\n\nexport default App;\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read https://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === \"localhost\" ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === \"[::1]\" ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(/^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/),\n);\n\ntype Config = {\n onSuccess?: (registration: ServiceWorkerRegistration) => void;\n onUpdate?: (registration: ServiceWorkerRegistration) => void;\n};\n\nexport function register(config?: Config) {\n if (process.env.NODE_ENV === \"production\" && \"serviceWorker\" in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL((process as { env: { [key: string]: string } }).env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener(\"load\", () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n \"This web app is being served cache-first by a service \" +\n \"worker. To learn more, visit https://bit.ly/CRA-PWA\",\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl: string, config?: Config) {\n navigator.serviceWorker\n .register(swUrl)\n .then((registration) => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === \"installed\") {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n \"New content is available and will be used when all \" +\n \"tabs for this page are closed. See https://bit.ly/CRA-PWA.\",\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log(\"Content is cached for offline use.\");\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch((error) => {\n console.error(\"Error during service worker registration:\", error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl: string, config?: Config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then((response) => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get(\"content-type\");\n if (response.status === 404 || (contentType != null && contentType.indexOf(\"javascript\") === -1)) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\"No internet connection found. App is running in offline mode.\");\n });\n}\n\nexport function unregister() {\n if (\"serviceWorker\" in navigator) {\n navigator.serviceWorker.ready.then((registration) => {\n registration.unregister();\n });\n }\n}\n","import \"./utils/AssetPath\";\n\nimport React from \"react\";\n\nimport ReactDOM from \"react-dom\";\n\nimport \"./index.css\";\nimport App from \"./App\";\nimport * as serviceWorker from \"./serviceWorker\";\n\nReactDOM.render(, document.getElementById(\"root\"));\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: https://bit.ly/CRA-PWA\nserviceWorker.unregister();\n","// extracted by mini-css-extract-plugin\nmodule.exports = {\"hand\":\"FingerTouchIcon_hand__fZM01\",\"strong\":\"FingerTouchIcon_strong__XLkjn\",\"shaking\":\"FingerTouchIcon_shaking__2J7jA\"};"],"sourceRoot":""}