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

web-interface.assets.LoginPage.472622149827c1587209.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.1
Show newest version
{"version":3,"sources":["webpack:///./src/components/login/LoginBox.jsx","webpack:///./src/components/login/LoginForm.jsx","webpack:///./src/pages/LoginPage.jsx","webpack:///./src/logic/authentication/constants.ts","webpack:///./src/pages/LoadingPage.tsx"],"names":["Wrapper","styled","div","LoginCol","Col","theme","css","colors","global","contentBackground","variant","light","navigationBoxShadow","darker","dark","LoginBox","children","className","md","mdOffset","readFromConfig","xs","xsOffset","propTypes","PropTypes","node","isRequired","SessionActions","CombinedProvider","get","StyledFormGroup","FormGroup","LoginForm","promise","usernameInput","passwordInput","onErrorChange","useState","isLoading","setIsLoading","useEffect","cancel","onSubmit","event","preventDefault","username","getValue","password","location","document","host","login","error","additional","status","message","isCancelled","ref","id","type","placeholder","autoFocus","required","bsStyle","disabled","func","LoginPageStyles","createGlobalStyle","authStyles","StyledButton","Button","StyledPre","pre","ErrorFallback","resetErrorBoundary","isCloud","AppConfig","onClick","shape","string","LoginPage","didValidateSession","setDidValidateSession","undefined","lastError","setLastError","useFallback","setUseFallback","enableExternalBackend","setEnableExternalBackend","loginFormState","setLoginFormState","useQuery","Promise","resolve","AuthenticationDomain","loadActiveBackendType","data","isSuccess","useActiveBackend","activeBackend","isBackendDetermined","loginComponent","PluginStore","exports","find","c","hasCustomLogin","formComponent","sessionPromise","validate","then","response","resetLastError","LoadingPage","shouldDisplayFallbackLink","title","name","PluginLoginForm","FallbackComponent","onError","onReset","renderLoginForm","as","replace","toUpperCase","LoadingPageStyles","text","delay","defaultProps"],"mappings":"2HAAA,sGAwBMA,EAAUC,UAAOC,IAAV,wEAAGD,CAAH,sKAkBPE,EAAWF,kBAAOG,KAAV,yEAAGH,EAAY,gBAAGI,EAAH,EAAGA,MAAH,OAAeC,cAAd,CAAD,wIAEPD,EAAME,OAAOC,OAAOC,kBACpBJ,EAAME,OAAOG,QAAQC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AOA,EAAEmB,iBAAiB,uB,4JEpJpG,I,IAAMC,EAAoB3D,4BAAH,I,EAAA,c,kBAAA,E,0EACnBC,KAGE8C,EAAc,SAAC,GAAoB,IAAlBa,EAAkB,EAAlBA,KACrB,OACE,gBAAC,IAAD,CAAeX,MAAM,cACnB,gBAACU,EAAD,MACA,gBAAC,IAAD,KACE,8BAAQ,gBAAC,IAAD,CAAMT,KAAK,UAAnB,uBACA,yBACE,gBAAC,KAAD,CAASU,KAAMA,EAAMC,MAAO,QAOtCd,EAAY3F,UAAY,CACtBwG,KAAMvG,IAAUuD,QAGlBmC,EAAYe,aAAe,CACzBF,KAAM,2BAGOb","file":"LoginPage.472622149827c1587209.js","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/graylog';\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  legend {\n    color: ${theme.colors.variant.darker.default};\n    border-color: ${theme.colors.variant.dark.default};\n  }\n`);\n\nconst LoginBox = ({ children }) => {\n  return (\n    \n      \n        \n          \n        \n      \n      \n        \n          {children}\n        \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 React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport styled from 'styled-components';\n\nimport { Button, FormGroup } from 'components/graylog';\nimport { Input } from 'components/bootstrap';\nimport CombinedProvider from 'injection/CombinedProvider';\n\nconst { SessionActions } = CombinedProvider.get('Session');\n\nconst StyledFormGroup = styled(FormGroup)`\n  margin-bottom: 0;\n`;\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  }, []);\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 );\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 'react-query';\nimport { ErrorBoundary } from 'react-error-boundary';\n\nimport { DocumentTitle, Icon } from 'components/common';\nimport { Alert, Button } from 'components/graylog';\nimport LoginForm from 'components/login/LoginForm';\nimport LoginBox from 'components/login/LoginBox';\nimport authStyles from 'theme/styles/authStyles';\nimport CombinedProvider from 'injection/CombinedProvider';\nimport AuthenticationDomain from 'domainActions/authentication/AuthenticationDomain';\nimport AppConfig from 'util/AppConfig';\nimport { LOGIN_INITIALIZING_STATE, LOGIN_INITIALIZED_STATE } from 'logic/authentication/constants';\n\nimport LoadingPage from './LoadingPage';\n\nconst { SessionActions } = CombinedProvider.get('Session');\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 Welcome to Graylog\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","/*\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, Icon } from 'components/common';\nimport LoginBox from 'components/login/LoginBox';\nimport authStyles from 'theme/styles/authStyles';\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 Welcome to Graylog\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"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy