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

web-interface.assets.LoginPage.19813f815fa74d8290e2.js.map Maven / Gradle / Ivy

{"version":3,"file":"LoginPage.19813f815fa74d8290e2.js","mappings":"2QAwBMA,EAAUC,EAAAA,QAAAA,IAAAA,WAAH,6DAAGA,CAAH,sKAkBPC,GAAWD,EAAAA,EAAAA,SAAOE,EAAAA,IAAV,yEAAGF,EAAY,gBAAGG,EAAH,EAAGA,MAAH,OAAeC,EAAAA,EAAAA,KAAd,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,EAAfA,SAClB,OACE,gBAACf,EAAD,CAASgB,UAAU,aACjB,gBAAC,KAAD,KACE,gBAAC,KAAD,CAAKC,GAAI,EAAGC,SAAU,GACpB,gBAAC,IAAD,CAAqBC,gBAAc,MAGvC,gBAAC,KAAD,KACE,gBAACjB,EAAD,CAAUe,GAAI,EAAGC,SAAU,EAAGE,GAAI,EAAGC,SAAU,GAC5CN,MAOXD,EAASQ,UAAY,CACnBP,SAAUQ,IAAAA,KAAAA,YAGZ,W,gKChDMC,GAAoBC,EAAAA,EAAAA,mBAAH,QACnBC,EAAAA,GAGEC,EAAc,SAAC,GAAoB,IAAlBC,EAAkB,EAAlBA,KACrB,OACE,gBAAC,KAAD,CAAeC,MAAM,cACnB,gBAACL,EAAD,MACA,gBAAC,IAAD,KACE,8BAAQ,gBAAC,KAAD,CAAMM,KAAK,UAAnB,uBACA,yBACE,gBAAC,KAAD,CAASF,KAAMA,EAAMG,MAAO,QAOtCJ,EAAYL,UAAY,CACtBM,KAAML,IAAAA,QAGRI,EAAYK,aAAe,CACzBJ,KAAM,2BAGR,W,gqCC/BA,IAAMK,GAAkBhC,EAAAA,EAAAA,SAA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GT,OAAO,WACLF,EAAe5D,YAEhB,KAEHD,EAAAA,EAAAA,YAAU,WACRuC,OAAaF,KACZ,CAACG,IAEJ,IAAMwB,EAAiB,WACrBzB,OAAaF,IAiCf,IAAKF,IAAuBmB,EAC1B,OACE,gBAACtE,EAAA,QAAD,MAIJ,IAAMiF,EAA4BN,GAC/BjB,IACCX,GChJ0B,gBDiJ3Ba,EAEH,OACE,gBAAC,KAAD,CAAe1D,MAAM,WACnB,gBAACf,EAAA,EAAD,KACE,8BAAQ,gBAAC,KAAD,CAAMgB,KAAK,UAAnB,uBACA,gBAACsC,EAAD,MA5CAa,EAEA,uBAAKjE,UAAU,cACb,gBAAC,KAAD,CAAOkD,QAAQ,UACb,0BAAQJ,KAAK,SAAS9C,UAAU,QAAQ4D,QAAS+B,GAAjD,KAAkF1B,IAMnF,KAGe,WACtB,IAAKE,GAAemB,EAAgB,CAClC,IAAuBO,EAAoBX,EAAnCK,cAER,OACE,gBAAC,EAAAO,cAAD,CAAeC,kBAAmBvC,EACnBwC,QAAS,kBAAM1B,GAAyB,IACxC2B,QAAS,kBAAM7B,GAAe,KAC3C,gBAACyB,EAAD,CAAiBtE,cAAe2C,EAAcM,kBAAmBA,KAKvE,OAAO,gBAAC,EAAD,CAAWjD,cAAe2C,IAoB5BgC,GACAN,GACD,gBAACvC,EAAD,CAAc8C,GAAG,IAAIvC,QAAS,kBAAMQ,GAAgBD,KAApD,qBACiBA,EAAce,EAAepC,KAAKsD,QAAQ,OAAO,SAACf,GAAD,OAAOA,EAAEgB,iBAAiB","sources":["webpack://graylog-web-interface/./src/components/login/LoginBox.jsx","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  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 * 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","/*\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, Input } from 'components/bootstrap';\nimport { SessionActions } from 'stores/sessions/SessionStore';\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/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';\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 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"],"names":["Wrapper","styled","LoginCol","Col","theme","css","colors","global","contentBackground","variant","light","navigationBoxShadow","darker","dark","LoginBox","children","className","md","mdOffset","readFromConfig","xs","xsOffset","propTypes","PropTypes","LoadingPageStyles","createGlobalStyle","authStyles","LoadingPage","text","title","name","delay","defaultProps","StyledFormGroup","FormGroup","LoginForm","promise","usernameInput","passwordInput","onErrorChange","useState","isLoading","setIsLoading","useEffect","cancel","onSubmit","event","preventDefault","username","getValue","password","location","document","host","SessionActions","error","additional","status","message","isCancelled","ref","id","type","placeholder","autoFocus","required","bsStyle","disabled","LoginPageStyles","StyledButton","Button","StyledPre","ErrorFallback","resetErrorBoundary","isCloud","AppConfig","onClick","isRequired","didValidateSession","setDidValidateSession","undefined","lastError","setLastError","useFallback","setUseFallback","enableExternalBackend","setEnableExternalBackend","loginFormState","setLoginFormState","useQuery","Promise","resolve","AuthenticationDomain","data","isSuccess","useActiveBackend","activeBackend","isBackendDetermined","loginComponent","PluginStore","find","c","hasCustomLogin","formComponent","sessionPromise","then","response","resetLastError","shouldDisplayFallbackLink","PluginLoginForm","ErrorBoundary","FallbackComponent","onError","onReset","renderLoginForm","as","replace","toUpperCase"],"sourceRoot":""}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy