All Downloads are FREE. Search and download functionalities are using the official Maven repository.

web-interface.assets.LoginPage.4b26e06569e0f4bd5322.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.5
Show newest version
{"version":3,"file":"LoginPage.4b26e06569e0f4bd5322.js","mappings":"2QAwBA,MAAMA,EAAUC,EAAAA,QAAAA,IAAAA,WAAH,6DAAGA,CAAH,sKAkBPC,GAAWD,EAAAA,EAAAA,SAAOE,EAAAA,IAAV,yEAAGF,EAAY,QAAC,MAAEG,GAAH,SAAeC,EAAAA,EAAAA,KAAd,CAAD,qGAEPD,EAAME,OAAOC,OAAOC,kBACpBJ,EAAME,OAAOG,QAAQC,MAAMC,QAExBP,EAAME,OAAOC,OAAOK,oBALhB,IAQvBC,EAAW,QAAC,SAAEC,GAAH,SACf,gBAACd,EAAD,CAASe,UAAU,aACjB,gBAAC,KAAD,KACE,gBAAC,KAAD,CAAKC,GAAI,EAAGC,SAAU,GACpB,gBAAC,IAAD,CAAqBC,gBAAc,MAGvC,gBAAC,KAAD,KACE,gBAAChB,EAAD,CAAUc,GAAI,EAAGC,SAAU,EAAGE,GAAI,EAAGC,SAAU,GAC5CN,IATQ,EAejBD,EAASQ,UAAY,CACnBP,SAAUQ,IAAAA,KAAAA,YAGZ,S,0FChDA,MAAMC,EAAStB,EAAAA,QAAAA,GAAAA,WAAH,+DAAGA,CAAH,+FAQNuB,GAAavB,EAAAA,EAAAA,SAAOwB,EAAAA,IAAV,8EAAGxB,CAAH,uBAUhB,EANoB,IAClB,gBAACsB,EAAD,KACE,gBAACC,EAAD,CAAYE,KAAK,UADnB,qB,kLCLF,MAAMC,GAAoBC,EAAAA,EAAAA,mBAAH,QACnBC,EAAAA,GAGEC,EAAc,IAAqB,IAApB,KAAEC,GAAkB,EACvC,OACE,gBAAC,KAAD,CAAeC,MAAM,cACnB,gBAACL,EAAD,MACA,gBAAC,IAAD,KACE,gBAAC,IAAD,MACA,yBACE,gBAAC,KAAD,CAASI,KAAMA,EAAME,MAAO,MANpC,E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ACrB1B,OAAaC,EAAb,EAiCF,IAAKJ,IAAuBY,EAC1B,OACE,gBAAClE,EAAA,QAAD,MAIJ,MAAMoF,EAA4BN,GAC/BjB,IACCZ,GCjJ0B,gBDkJ3Bc,EAEH,OACE,gBAAC,KAAD,CAAe7D,MAAM,WACnB,gBAACnB,EAAA,EAAD,KACE,gBAACsG,EAAA,EAAD,MACA,gBAAC1C,EAAD,MA5CAa,EAEA,uBAAKvE,UAAU,cACb,gBAAC,KAAD,CAAOkE,QAAQ,UACb,0BAAQjB,KAAK,SAASjD,UAAU,QAAQmE,QAAS+B,GAAjD,KAAkF3B,IAMnF,KAGe,MACtB,IAAKG,GAAemB,EAAgB,CAClC,MAAQC,cAAeO,GAAoBZ,EAE3C,OACE,gBAAC,EAAAa,cAAD,CAAeC,kBAAmBzC,EACnB0C,QAAS,IAAM3B,GAAyB,GACxC4B,QAAS,IAAM9B,GAAe,IAC3C,gBAAC0B,EAAD,CAAiBhF,cAAemD,EAAcO,kBAAmBA,IAGtE,CAED,OAAO,gBAAC,EAAD,CAAW1D,cAAemD,GAAjC,EAoBKkC,GACAP,GACD,gBAACxC,EAAD,CAAcgD,GAAG,IAAIxC,QAAS,IAAMQ,GAAgBD,IAChD,cAAaA,EAAce,EAAexC,KAAK2D,QAAQ,OAAQhB,GAAMA,EAAEiB,gBAAiB,qBATlG,C","sources":["webpack://graylog-web-interface/./src/components/login/LoginBox.jsx","webpack://graylog-web-interface/./src/components/login/LoginHeader.tsx","webpack://graylog-web-interface/./src/pages/LoadingPage.tsx","webpack://graylog-web-interface/./src/components/login/LoginForm.jsx","webpack://graylog-web-interface/./src/pages/LoginPage.jsx","webpack://graylog-web-interface/./src/logic/authentication/constants.ts"],"sourcesContent":["/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport styled, { css } from 'styled-components';\n\nimport { Col, Row } from 'components/bootstrap';\n\nimport PublicNotifications from '../common/PublicNotifications';\n\nconst Wrapper = styled.div`\n  display: flex;\n  align-items: center;\n  justify-content: flex-start;\n  padding-top: 25vh;\n  flex-direction: column;\n  height: 100%;\n  \n  .row {\n    width: 100%;\n  }\n  \n  &::before,\n  &::after {\n    content: none;\n  }\n`;\n\nconst LoginCol = styled(Col)(({ theme }) => css`\n  padding: 15px;\n  background-color: ${theme.colors.global.contentBackground};\n  border: 1px solid ${theme.colors.variant.light.default};\n  border-radius: 4px;\n  box-shadow: 0 0 21px ${theme.colors.global.navigationBoxShadow};\n`);\n\nconst LoginBox = ({ children }) => (\n  \n    \n      \n        \n      \n    \n    \n      \n        {children}\n      \n    \n  \n);\n\nLoginBox.propTypes = {\n  children: PropTypes.node.isRequired,\n};\n\nexport default LoginBox;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport styled from 'styled-components';\n\nimport { Icon } from 'components/common';\n\nconst Header = styled.h1`\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  margin-bottom: 21px;\n  margin-top: 6px;\n`;\n\nconst HeaderIcon = styled(Icon)`\n  margin-right: 9px;\n`;\n\nconst LoginHeader = () => (\n  
\n Welcome to Graylog\n
\n);\n\nexport default LoginHeader;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { createGlobalStyle } from 'styled-components';\n\nimport { DocumentTitle, Spinner } from 'components/common';\nimport LoginBox from 'components/login/LoginBox';\nimport authStyles from 'theme/styles/authStyles';\nimport LoginHeader from 'components/login/LoginHeader';\n\ntype Props = {\n text: string,\n};\n\nconst LoadingPageStyles = createGlobalStyle`\n ${authStyles}\n`;\n\nconst LoadingPage = ({ text }: Props) => {\n return (\n \n \n \n \n

\n \n

\n
\n
\n );\n};\n\nLoadingPage.propTypes = {\n text: PropTypes.string,\n};\n\nLoadingPage.defaultProps = {\n text: 'Loading, please wait...',\n};\n\nexport default LoadingPage;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\n\nimport { ModalSubmit } from 'components/common';\nimport { Input } from 'components/bootstrap';\nimport { SessionActions } from 'stores/sessions/SessionStore';\n\nconst LoginForm = ({ onErrorChange }) => {\n const [isLoading, setIsLoading] = useState(false);\n let promise;\n let usernameInput;\n let passwordInput;\n\n useEffect(() => {\n return () => {\n if (promise) {\n promise.cancel();\n }\n };\n }, [promise]);\n\n const onSignInClicked = (event) => {\n event.preventDefault();\n onErrorChange();\n setIsLoading(true);\n const username = usernameInput.getValue();\n const password = passwordInput.getValue();\n const location = document.location.host;\n\n promise = SessionActions.login(username, password, location);\n\n promise.catch((error) => {\n if (error.additional.status === 401) {\n onErrorChange('Invalid credentials, please verify them and retry.');\n } else {\n onErrorChange(`Error - the server returned: ${error.additional.status} - ${error.message}`);\n }\n });\n\n promise.finally(() => {\n if (!promise.isCancelled()) {\n setIsLoading(false);\n }\n });\n };\n\n return (\n
\n { usernameInput = username; }}\n id=\"username\"\n type=\"text\"\n placeholder=\"Username\"\n autoFocus\n required />\n\n { passwordInput = password; }}\n id=\"password\"\n type=\"password\"\n placeholder=\"Password\"\n required />\n\n \n \n );\n};\n\nLoginForm.propTypes = {\n onErrorChange: PropTypes.func.isRequired,\n};\n\nexport default LoginForm;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\nimport React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { PluginStore } from 'graylog-web-plugin/plugin';\nimport styled, { createGlobalStyle } from 'styled-components';\nimport { useQuery } from '@tanstack/react-query';\nimport { ErrorBoundary } from 'react-error-boundary';\n\nimport { DocumentTitle } from 'components/common';\nimport { Alert, Button } from 'components/bootstrap';\nimport LoginForm from 'components/login/LoginForm';\nimport LoginBox from 'components/login/LoginBox';\nimport authStyles from 'theme/styles/authStyles';\nimport AuthenticationDomain from 'domainActions/authentication/AuthenticationDomain';\nimport AppConfig from 'util/AppConfig';\nimport { LOGIN_INITIALIZING_STATE, LOGIN_INITIALIZED_STATE } from 'logic/authentication/constants';\nimport { SessionActions } from 'stores/sessions/SessionStore';\nimport LoginHeader from 'components/login/LoginHeader';\n\nimport LoadingPage from './LoadingPage';\n\nconst LoginPageStyles = createGlobalStyle`\n ${authStyles}\n`;\n\nconst StyledButton = styled(Button)`\n margin-top: 1em;\n display: inline-block;\n cursor: pointer;\n`;\n\nconst StyledPre = styled.pre`\n white-space: pre-line;\n`;\n\nconst useActiveBackend = (isCloud) => {\n const cloudBackendLoader = () => {\n if (isCloud) {\n return Promise.resolve('oidc-v1');\n }\n\n return AuthenticationDomain.loadActiveBackendType();\n };\n\n const { data, isSuccess } = useQuery(['activeBackendType'], cloudBackendLoader);\n\n return [data, isSuccess];\n};\n\nconst ErrorFallback = ({ error, resetErrorBoundary }) => {\n const isCloud = AppConfig.isCloud();\n\n return (\n \n {isCloud ? (\n

Error loading login screen, please contact your Graylog account manager.

\n ) : (\n <>\n

\n Error using active authentication service login. Please check its configuration or contact your\n Graylog account manager. Error details:\n

\n {error.message}\n \n \n )}\n
\n );\n};\n\nErrorFallback.propTypes = {\n error: PropTypes.shape({\n message: PropTypes.string.isRequired,\n }).isRequired,\n resetErrorBoundary: PropTypes.func.isRequired,\n};\n\nconst LoginPage = () => {\n const [didValidateSession, setDidValidateSession] = useState(false);\n const [lastError, setLastError] = useState(undefined);\n const [useFallback, setUseFallback] = useState(false);\n const [enableExternalBackend, setEnableExternalBackend] = useState(true);\n const [loginFormState, setLoginFormState] = useState(LOGIN_INITIALIZING_STATE);\n const isCloud = AppConfig.isCloud();\n const [activeBackend, isBackendDetermined] = useActiveBackend(isCloud);\n\n const registeredLoginComponents = PluginStore.exports('loginProviderType');\n const loginComponent = registeredLoginComponents.find((c) => c.type === activeBackend);\n const hasCustomLogin = loginComponent && loginComponent.formComponent;\n\n useEffect(() => {\n const sessionPromise = SessionActions.validate().then((response) => {\n setDidValidateSession(true);\n\n return response;\n });\n\n return () => {\n sessionPromise.cancel();\n };\n }, []);\n\n useEffect(() => {\n setLastError(undefined);\n }, [useFallback]);\n\n const resetLastError = () => {\n setLastError(undefined);\n };\n\n const formatLastError = () => {\n if (lastError) {\n return (\n
\n \n {lastError}\n \n
\n );\n }\n\n return null;\n };\n\n const renderLoginForm = () => {\n if (!useFallback && hasCustomLogin) {\n const { formComponent: PluginLoginForm } = loginComponent;\n\n return (\n setEnableExternalBackend(false)}\n onReset={() => setUseFallback(true)}>\n \n \n );\n }\n\n return ;\n };\n\n if (!didValidateSession || !isBackendDetermined) {\n return (\n \n );\n }\n\n const shouldDisplayFallbackLink = hasCustomLogin\n && enableExternalBackend\n && !isCloud\n && loginFormState === LOGIN_INITIALIZED_STATE;\n\n return (\n \n \n \n \n {formatLastError()}\n {renderLoginForm()}\n {shouldDisplayFallbackLink && (\n setUseFallback(!useFallback)}>\n {`Login with ${useFallback ? loginComponent.type.replace(/^\\w/, (c) => c.toUpperCase()) : 'default method'}`}\n \n )}\n \n \n );\n};\n\nexport default LoginPage;\n","/*\n * Copyright (C) 2020 Graylog, Inc.\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the Server Side Public License, version 1,\n * as published by MongoDB, Inc.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * Server Side Public License for more details.\n *\n * You should have received a copy of the Server Side Public License\n * along with this program. If not, see\n * .\n */\n\nconst LOGIN_INITIALIZING_STATE = 'INITIALIZING'; // Initial State for the plugin login form set on the login page in created.\nconst LOGIN_INITIALIZED_STATE = 'INITIALIZED'; // Should be set once the plugin based login form is initialized\nconst LOGIN_TRANSITIONING_STATE = 'TRANSITIONING'; // value when the plugin based form is in transition state for example handling login callback\n\nexport {\n LOGIN_INITIALIZING_STATE,\n LOGIN_INITIALIZED_STATE,\n LOGIN_TRANSITIONING_STATE,\n};\n"],"names":["Wrapper","styled","LoginCol","Col","theme","css","colors","global","contentBackground","variant","light","default","navigationBoxShadow","LoginBox","children","className","md","mdOffset","readFromConfig","xs","xsOffset","propTypes","PropTypes","Header","HeaderIcon","Icon","name","LoadingPageStyles","createGlobalStyle","authStyles","LoadingPage","text","title","delay","defaultProps","LoginForm","onErrorChange","isLoading","setIsLoading","useState","promise","usernameInput","passwordInput","useEffect","cancel","onSubmit","event","preventDefault","username","getValue","password","location","document","host","SessionActions","catch","error","additional","status","message","finally","isCancelled","ref","id","type","placeholder","autoFocus","required","displayCancel","isSubmitting","isAsyncSubmit","submitLoadingText","submitButtonText","LoginPageStyles","StyledButton","Button","StyledPre","ErrorFallback","resetErrorBoundary","isCloud","AppConfig","bsStyle","onClick","isRequired","didValidateSession","setDidValidateSession","lastError","setLastError","undefined","useFallback","setUseFallback","enableExternalBackend","setEnableExternalBackend","loginFormState","setLoginFormState","activeBackend","isBackendDetermined","data","isSuccess","useQuery","Promise","resolve","AuthenticationDomain","useActiveBackend","loginComponent","PluginStore","find","c","hasCustomLogin","formComponent","sessionPromise","then","response","resetLastError","shouldDisplayFallbackLink","LoginHeader","PluginLoginForm","ErrorBoundary","FallbackComponent","onError","onReset","renderLoginForm","as","replace","toUpperCase"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy