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

web-interface.assets.LoginPage.8082683cbeb94d06c5f9.js.map Maven / Gradle / Ivy

There is a newer version: 6.0.6
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/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","LoginPage","didValidateSession","setDidValidateSession","undefined","lastError","setLastError","useFallback","setUseFallback","isCloud","AppConfig","useQuery","Promise","resolve","AuthenticationDomain","loadActiveBackendType","data","isSuccess","useActiveBackend","activeBackend","isBackendDetermined","loginComponent","PluginStore","exports","find","c","hasCustomLogin","formComponent","sessionPromise","validate","then","response","resetLastError","title","name","onClick","React","createElement","as","replace","toUpperCase","LoadingPage","LoadingPageStyles","text","delay","string","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,MAArB,QAEGN,EAAME,OAAOC,OAAOI,oBAGhCP,EAAME,OAAOG,QAAQG,OAArB,QACOR,EAAME,OAAOG,QAAQI,KAArB,YAIdC,EAAW,SAAC,GAAiB,IAAfC,EAAe,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AAMC,cAAchB,EAAeM,cAAe,CACvD7D,cAAewC,IAIZ,kBAAC,EAAD,CAAWxC,cAAewC,IAgB5BoB,IAAmBjB,GAClB,kBAACV,EAAD,CAAcuC,GAAG,IAAIH,QAAS,kBAAM3B,GAAgBD,KAApD,qBACiBA,EAAcc,EAAehC,KAAKkD,QAAQ,OAAO,SAACd,GAAD,OAAOA,EAAEe,iBAAiB,qBAbhG,kBAACC,EAAA,QAAD,Q,4JCpFN,I,IAAMC,EAAoB7C,4BAAH,I,EAAA,c,kBAAA,E,0EACnBC,KAGE2C,EAAc,SAAC,GAAoB,IAAlBE,EAAkB,EAAlBA,KACrB,OACE,gBAAC,IAAD,CAAeV,MAAM,cACnB,gBAACS,EAAD,MACA,gBAAC,IAAD,KACE,8BAAQ,gBAAC,IAAD,CAAMR,KAAK,UAAnB,uBACA,yBACE,gBAAC,KAAD,CAASS,KAAMA,EAAMC,MAAO,QAOtCH,EAAYxF,UAAY,CACtB0F,KAAMzF,IAAU2F,QAGlBJ,EAAYK,aAAe,CACzBH,KAAM,2BAGOF","file":"LoginPage.8082683cbeb94d06c5f9.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 { PluginStore } from 'graylog-web-plugin/plugin';\nimport styled, { createGlobalStyle } from 'styled-components';\nimport { useQuery } from 'react-query';\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';\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 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 LoginPage = () => {\n const [didValidateSession, setDidValidateSession] = useState(false);\n const [lastError, setLastError] = useState(undefined);\n const [useFallback, setUseFallback] = useState(false);\n\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 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 return React.createElement(loginComponent.formComponent, {\n onErrorChange: setLastError,\n });\n }\n\n return ;\n };\n\n if (!didValidateSession || !isBackendDetermined) {\n return (\n \n );\n }\n\n return (\n \n \n Welcome to Graylog\n \n {formatLastError()}\n {renderLoginForm()}\n {hasCustomLogin && !isCloud && (\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 */\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