Commit a26e7d3e authored by Mathias Engelbrecht Pilegård's avatar Mathias Engelbrecht Pilegård
Browse files

fixed forgot password modal popup flow

parent 5690006f
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => {\n showForgotPasswordForm(!forgotPasswordFormVisibilityState);\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n toggleForgotPasswordFormVisible();\n toggleSubmitOkModalVisible(); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(MessageModal, {\n activeState: submitOkModalRef,\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"5pEGAIOcXDP2viLF3//BMrBmvcg=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","forgotPasswordFormVisibilityState","showForgotPasswordForm","forgotPasswordFormRef","toggleForgotPasswordFormVisible","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault","toggleSubmitOkModalVisible","submitOkModalRef"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1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AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eA+BE,QAAC,YAAD;AAAc,MAAA,WAAW,EAAEoB,gBAA3B;AAA6C,MAAA,aAAa,EAAE,kBAA5D;AAAgF,MAAA,WAAW,EAAE;AAA7F;AAAA;AAAA;AAAA;AAAA,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAoCD,CA7FD;;GAAM3B,mB;;KAAAA,mB;AA+FN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = () => {\r\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => {\r\n showForgotPasswordForm(!forgotPasswordFormVisibilityState)\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n toggleForgotPasswordFormVisible()\r\n toggleSubmitOkModalVisible()\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n <MessageModal activeState={submitOkModalRef} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = ({\n removeModal\n}) => {\n _s();\n\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n {\n /* <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div> */\n }\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n removeModal();\n setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n onClick: e => removeModal(),\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"ccs9TXv4Z39DCQsrqL8dXg2nBZI=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","removeModal","submitOkMessageModalState","setSubmitOkMessageModalState","username","setUsername","handleUsernameChange","e","target","value","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;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B;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,oDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBARF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAoBD,CA3DD;;GAAMN,mB;;KAAAA,mB;AA6DN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = ({ removeModal }) => {\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n {/* <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div> */}\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n removeModal()\r\n setSubmitOkMessageModalState(true)\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\" onClick={e => removeModal()}>\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\Login.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect, useRef } from 'react';\nimport { Redirect } from 'react-router-dom';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./Login.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport signUp from './signUp/SignUp';\nimport config from '../../config';\nimport SignUp from './signUp/SignUp';\nimport PasswordForgotModal from './passwordReset/PasswordForgotModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst Login = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [username, setUsername] = useState('');\n const [password, setPassword] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${username}`,\n password: `${password}`\n });\n const loginRequestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSignInFormSubmit = e => {\n e.preventDefault();\n oktaAuth.signInWithCredentials({\n username,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n };\n\n if (sessionToken) {\n // Hide form while sessionToken is converted into id/access tokens\n return null;\n }\n\n if (!authState || !authState.isAuthenticated) {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(SignUp, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signInForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign in to PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSignInFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"username\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign in\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-in-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 11\n }, this), username > 0 && /*#__PURE__*/_jsxDEV(PasswordForgotModal, {\n loginFormUsername: username\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 16\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 7\n }, this);\n } else {\n return /*#__PURE__*/_jsxDEV(Redirect, {\n to: \"/home\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 12\n }, this);\n }\n};\n\n_s(Login, \"u8yY6NlW4PSOG6xgLhGhaVL5lVE=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Login;\nexport default Login;\n\nvar _c;\n\n$RefreshReg$(_c, \"Login\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/Login.jsx"],"names":["React","useState","useEffect","useRef","Redirect","useOktaAuth","FontAwesomeIcon","NavLink","signUp","config","SignUp","PasswordForgotModal","Login","authState","oktaAuth","sessionToken","setSessionToken","username","setUsername","password","setPassword","handleUsernameChange","e","target","value","handlePasswordChange","userInputData","JSON","stringify","email","loginRequestOptions","method","body","handleSignInFormSubmit","preventDefault","signInWithCredentials","then","res","signInWithRedirect","originalUri","catch","err","console","log","isAuthenticated"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,aAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBA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,GAAG,CAAX,iBACI,QAAC,mBAAD;AAAqB,UAAA,iBAAiB,EAAEA;AAAxC;AAAA;AAAA;AAAA;AAAA,gBAvBP;AAAA;AAAA;AAAA;AAAA;AAAA,cAHF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF;AAgCD,GAjCD,MAiCO;AACL,wBAAO,QAAC,QAAD;AAAU,MAAA,EAAE,EAAC;AAAb;AAAA;AAAA;AAAA;AAAA,YAAP;AACD;AACF,CA/ED;;GAAML,K;UAC4BP,W;;;KAD5BO,K;AAiFN,eAAeA,KAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react';\r\nimport { Redirect } from 'react-router-dom'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Login.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport signUp from './signUp/SignUp';\r\nimport config from '../../config';\r\nimport SignUp from './signUp/SignUp';\r\nimport PasswordForgotModal from './passwordReset/PasswordForgotModal';\r\n\r\nconst Login = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return (\r\n <div className=\"pageContainer\">\r\n <SignUp />\r\n\r\n <div className=\"signInForm\">\r\n <h2>Sign in to PipIt</h2>\r\n <form onSubmit={handleSignInFormSubmit}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"username\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign in&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"sign-in-alt\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n {username > 0\r\n && <PasswordForgotModal loginFormUsername={username} />}\r\n\r\n </div>\r\n </div>\r\n )\r\n } else {\r\n return <Redirect to=\"/home\" />\r\n }\r\n}\r\n\r\nexport default Login"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = ({\n removeModal\n}) => {\n _s();\n\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n removeModal();\n setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n onClick: e => removeModal(),\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(MessageModal, {\n removeModal: () => setSubmitOkMessageModalState(false),\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"ccs9TXv4Z39DCQsrqL8dXg2nBZI=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","removeModal","submitOkMessageModalState","setSubmitOkMessageModalState","username","setUsername","handleUsernameChange","e","target","value","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAqB;AAAA;;AAC/C,QAAM,C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A,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAFF,eAsBE;AAAK,MAAA,SAAS,EAAG,SAAQJ,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,kBAArF;AAAyG,QAAA,WAAW,EAAE;AAAtH;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAtBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA6BD,CAhED;;GAAMH,mB;;KAAAA,mB;AAkEN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = ({ removeModal }) => {\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n removeModal()\r\n setSubmitOkMessageModalState(true)\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div>\r\n {/* Forgot password modal */}\r\n <div >\r\n <div className=\"modal-content\" onClick={e => removeModal()}>\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState);\n\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n toggleForgotPasswordFormVisible();\n setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(MessageModal, {\n removeModal: () => setSubmitOkMessageModalState(false),\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"g4WkMIawwrBahYMYonVecg/0JA0=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","forgotPasswordFormVisibilityState","setForgotPasswordFormVisibilityState","forgotPasswordFormRef","toggleForgotPasswordFormVisible","submitOkMessageModalState","setSubmitOkMessageModalState","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC,QAAM,CAACC,iCAAD,EAAoCC,oCAApC,IAA4ER,QAAQ,CAAC,KAAD,CAA1F;AACA,QAAMS,qBAAqB,GAAGR,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMS,+BAA+B,GAAG,MAAMF,oCAAoC,CAAC,CAACD,iCAAF,CAAlF;;AAEA,QAAM,CAACI,yBAAD,EAA4BC,4BAA5B,IAA4DZ,QAAQ,CAAC,KAAD,CAA1E;AAEA,QAAM,CAACa,QAAD,EAAWC,WAAX,I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f","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = () => {\r\n const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)\r\n\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n toggleForgotPasswordFormVisible()\r\n setSubmitOkMessageModalState(true)\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\messageModal\\\\MessageModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst MessageModal = props => {\n _s();\n\n const [modalVisibilityState, showModal] = useState(true);\n\n const toggleModalVisible = () => showModal(!modalVisibilityState);\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${modalVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"submitOkModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: props.headerMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: props.bodyMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n onClick: toggleModalVisible,\n children: \"Ok\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 15,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 10,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 5\n }, this);\n};\n\n_s(MessageModal, \"o5WiWLNLIkTfnrQf/aeRT17JQYs=\");\n\n_c = MessageModal;\nexport default MessageModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"MessageModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/messageModal/MessageModal.jsx"],"names":["React","useState","MessageModal","props","modalVisibilityState","showModal","toggleModalVisible","headerMessage","bodyMessage"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;;;AAEA,MAAMC,YAAY,GAAIC,KAAD,IAAW;AAAA;;AAC9B,QAAM,CAACC,oBAAD,EAAuBC,SAAvB,IAAoCJ,QAAQ,CAAC,IAAD,CAAlD;;AACA,QAAMK,kBAAkB,GAAG,MAAMD,SAAS,CAAC,CAACD,oBAAF,CAA1C;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAG,SAAQA,oBAAoB,GAAG,QAAH,GAAc,UAAW,EAAtE;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,eAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,eAAf;AAAA,gCACE;AAAA,oBAAKD,KAAK,CAACI;AAAX;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA,oBACGJ,KAAK,CAACK;AADT;AAAA;AAAA;AAAA;AAAA,gBAFF,eAKE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,OAAO,EAAEF,kBAA9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAeD,CAnBD;;GAAMJ,Y;;KAAAA,Y;AAqBN,eAAeA,YAAf","sourcesContent":["import React, { useState } from 'react'\r\n\r\nconst MessageModal = (props) => {\r\n const [modalVisibilityState, showModal] = useState(true)\r\n const toggleModalVisible = () => showModal(!modalVisibilityState)\r\n\r\n return (\r\n <div className={`modal ${modalVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div className=\"modal-content\">\r\n <div className=\"submitOkModal\">\r\n <h2>{props.headerMessage}</h2>\r\n <label>\r\n {props.bodyMessage}\r\n </label>\r\n <button className=\"formSubmitButton\" onClick={toggleModalVisible}>\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default MessageModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\messageModal\\\\MessageModal.jsx\";\nimport React from 'react';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst MessageModal = props => {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal active\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"submitOkModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: props.headerMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: props.bodyMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: \"Ok\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 7,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 6,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 5,\n columnNumber: 5\n }, this);\n};\n\n_c = MessageModal;\nexport default MessageModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"MessageModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/messageModal/MessageModal.jsx"],"names":["React","MessageModal","props","headerMessage","bodyMessage"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;;;AAEA,MAAMC,YAAY,GAAIC,KAAD,IAAW;AAC9B,sBACE;AAAK,IAAA,SAAS,EAAC,cAAf;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,eAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,eAAf;AAAA,gCACE;AAAA,oBAAKA,KAAK,CAACC;AAAX;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA,oBACGD,KAAK,CAACE;AADT;AAAA;AAAA;AAAA;AAAA,gBAFF,eAKE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAeD,CAhBD;;KAAMH,Y;AAkBN,eAAeA,YAAf","sourcesContent":["import React from 'react'\r\n\r\nconst MessageModal = (props) => {\r\n return (\r\n <div className=\"modal active\" >\r\n <div className=\"modal-content\">\r\n <div className=\"submitOkModal\">\r\n <h2>{props.headerMessage}</h2>\r\n <label>\r\n {props.bodyMessage}\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default MessageModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\messageModal\\\\MessageModal.jsx\";\nimport React, { useState, useEffect, useRef } from 'react';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst MessageModal = ({\n removeModal,\n headerMessage,\n bodyMessage\n}) => {\n const stopProp = e => {\n e.stopPropagation();\n }; // useEffect(() => {\n // const pageClickEvent = (e) => {\n // if (messageModalRef.current !== null && !messageModalRef.current.contains(e.target)) {\n // toggleModalVisible()\n // }\n // };\n // // If the item is active (ie open) then listen for clicks\n // if (modalVisibilityState) {\n // window.addEventListener('click', pageClickEvent);\n // }\n // return () => {\n // window.removeEventListener('click', pageClickEvent);\n // }\n // }, [modalVisibilityState]);\n\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${modalVisibilityState ? \"active\" : \"inactive\"}`,\n onClick: e => removeOverlay(),\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"submitOkModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: headerMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: bodyMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n onClick: e => removeOverlay(),\n children: \"Ok\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 5\n }, this);\n};\n\n_c = MessageModal;\nexport default MessageModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"MessageModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/messageModal/MessageModal.jsx"],"names":["React","useState","useEffect","useRef","MessageModal","removeModal","headerMessage","bodyMessage","stopProp","e","stopPropagation","modalVisibilityState","removeOverlay"],"mappings":";AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;;;AAEA,MAAMC,YAAY,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,aAAf;AAA8BC,EAAAA;AAA9B,CAAD,KAAiD;AACpE,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD,CADoE,CAKpE;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAG,SAAQC,oBAAoB,GAAG,QAAH,GAAc,UAAW,EAAtE;AAAyE,IAAA,OAAO,EAAEF,CAAC,IAAIG,aAAa,EAApG;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,eAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,eAAf;AAAA,gCACE;AAAA,oBAAKN;AAAL;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA,oBACGC;AADH;AAAA;AAAA;AAAA;AAAA,gBAFF,eAKE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,OAAO,EAAEE,CAAC,IAAIG,aAAa,EAAhE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAeD,CAtCD;;KAAMR,Y;AAwCN,eAAeA,YAAf","sourcesContent":["import React, { useState, useEffect, useRef } from 'react'\r\n\r\nconst MessageModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n // useEffect(() => {\r\n // const pageClickEvent = (e) => {\r\n // if (messageModalRef.current !== null && !messageModalRef.current.contains(e.target)) {\r\n // toggleModalVisible()\r\n // }\r\n // };\r\n\r\n // // If the item is active (ie open) then listen for clicks\r\n // if (modalVisibilityState) {\r\n // window.addEventListener('click', pageClickEvent);\r\n // }\r\n\r\n // return () => {\r\n // window.removeEventListener('click', pageClickEvent);\r\n // }\r\n\r\n // }, [modalVisibilityState]);\r\n\r\n return (\r\n <div className={`modal ${modalVisibilityState ? \"active\" : \"inactive\"}`} onClick={e => removeOverlay()}>\r\n <div className=\"modal-content\">\r\n <div className=\"submitOkModal\">\r\n <h2>{headerMessage}</h2>\r\n <label>\r\n {bodyMessage}\r\n </label>\r\n <button className=\"formSubmitButton\" onClick={e => removeOverlay()}>\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default MessageModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n // Submit ok modal\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);\n const submitOkModalRef = useRef(null);\n\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form\n\n\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => {\n showForgotPasswordForm(!forgotPasswordFormVisibilityState);\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n useEffect(() => {\n const pageClickEvent = e => {\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\n toggleSubmitOkModalVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (submitOkModalVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [submitOkModalVisibilityState]);\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = () => {\n console.log(\"change password\"); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 107,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 7\n }, this), submitOkModalVisibilityState && /*#__PURE__*/_jsxDEV(MessageModal, {\n ref: submitOkModalRef,\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 119,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"JewdldMzKvoWUXPBjhAQ4J+HRI8=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","submitOkModalVisibilityState","showSubmitOkModal","submitOkModalRef","toggleSubmitOkModalVisible","forgotPasswordFormVisibilityState","showForgotPasswordForm","forgotPasswordFormRef","toggleForgotPasswordFormVisible","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","userInputData","JSON","st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useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = () => {\r\n // Submit ok modal\r\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)\r\n const submitOkModalRef = useRef(null)\r\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)\r\n\r\n // Forgot password form\r\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => {\r\n showForgotPasswordForm(!forgotPasswordFormVisibilityState)\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\r\n toggleSubmitOkModalVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (submitOkModalVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [submitOkModalVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = () => {\r\n console.log(\"change password\")\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n {submitOkModalVisibilityState && (\r\n <MessageModal ref={submitOkModalRef} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n )}\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n // Submit ok modal\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);\n const submitOkModalRef = useRef(null);\n\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form\n\n\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => {\n showForgotPasswordForm(!forgotPasswordFormVisibilityState);\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n useEffect(() => {\n const pageClickEvent = e => {\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\n toggleSubmitOkModalVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (submitOkModalVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [submitOkModalVisibilityState]);\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: JSON.stringify({\n email: `${username}`\n })\n };\n\n const handlePasswordForgot = () => {\n fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error: something went wrong\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {// toggleSubmitOkModalVisible()\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${submitOkModalVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: submitOkModalRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"submitOkModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Email submitted!\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 119,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 120,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: \"Ok\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"JewdldMzKvoWUXPBjhAQ4J+HRI8=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","PasswordForgotModal","submitOkModalVisibilityState","showSubmitOkModal","submitOkModalRef","toggleSubmitOkModalVisible","forgotPasswordFormVisibilityState","showForgotPasswordForm","forgotPasswordFormRef","toggleForgotPasswordFormVisible","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","ForgotPasswordRequestOptions","method","body","JSON","stringify","email","handlePasswordForgot","fetch","serviceAPI","ForgotPasswordURL","then","res","ok","alert","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDP,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMQ,gBAAgB,GAAGP,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMQ,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJgC,CAMhC;;;AACA,QAAM,CAACI,iCAAD,EAAoCC,sBAApC,IAA8DX,QAAQ,CAAC,KAAD,CAA5E;AACA,QAAMY,qBAAqB,GAAGX,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMY,+BAA+B,GAAG,MAAM;AAC5CF,IAAAA,sBAAsB,CAAC,CAACD,iCAAF,C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A;AAAA;AAAA;AAAA,oBADF,eAQE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eAiCE;AAAK,MAAA,SAAS,EAAG,SAAQV,4BAA4B,GAAG,QAAH,GAAc,UAAW,EAA9E;AAAA,6BACE;AAAK,QAAA,GAAG,EAAEE,gBAAV;AAA4B,QAAA,SAAS,EAAC,eAAtC;AAAA,+BACE;AAAK,UAAA,SAAS,EAAC,eAAf;AAAA,kCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAEE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF,eAKE;AAAQ,YAAA,SAAS,EAAC,kBAAlB;AAAqC,YAAA,IAAI,EAAC,QAA1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAjCF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkDD,CA9HD;;GAAMH,mB;;KAAAA,mB;AAgIN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\n\r\nconst PasswordForgotModal = () => {\r\n // Submit ok modal\r\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)\r\n const submitOkModalRef = useRef(null)\r\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)\r\n\r\n // Forgot password form\r\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => {\r\n showForgotPasswordForm(!forgotPasswordFormVisibilityState)\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\r\n toggleSubmitOkModalVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (submitOkModalVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [submitOkModalVisibilityState]);\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: JSON.stringify({\r\n email: `${username}`\r\n })\r\n }\r\n\r\n const handlePasswordForgot = () => {\r\n fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error: something went wrong\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n {/* SubmitOk modal */}\r\n <div className={`modal ${submitOkModalVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={submitOkModalRef} className=\"modal-content\">\r\n <div className=\"submitOkModal\">\r\n <h2>Email submitted!</h2>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = ({\n removeModal\n}) => {\n _s();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n removeModal();\n setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(MessageModal, {\n removeModal: () => setSubmitOkMessageModalState(false),\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"ccs9TXv4Z39DCQsrqL8dXg2nBZI=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","removeModal","stopProp","e","stopPropagation","submitOkMessageModalState","setSubmitOkMessageModalState","username","setUsername","handleUsernameChange","target","value","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault","forgotPasswordFormRef"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP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,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAQE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,oDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBARF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF,eAiBE;AAAK,MAAA,SAAS,EAAG,SAAQJ,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,kBAArF;AAAyG,QAAA,WAAW,EAAE;AAAtH;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAjBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAwBD,CA/DD;;GAAMN,mB;;KAAAA,mB;AAiEN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = ({ removeModal }) => {\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n removeModal()\r\n setSubmitOkMessageModalState(true)\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = ({\n removeModal\n}) => {\n _s();\n\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n removeModal();\n setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-background\",\n onClick: e => removeModal(),\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"ccs9TXv4Z39DCQsrqL8dXg2nBZI=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","removeModal","submitOkMessageModalState","setSubmitOkMessageModalState","stopProp","e","stopPropagation","username","setUsername","handleUsernameChange","target","value","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAqB;AAAA;;AAC/C,QAAM,CAACC,yBAAD,EAA4BC,4BAA5B,IAA4DT,QAAQ,CAAC,KAAD,CAA1E;;AAEA,QAAMU,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIA,QAAM,CAACC,QAAD,EAAWC,WAAX,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;AAAA;AAAA;AAAA;AAAA;AAAA,kBARF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAyBD,CAhED;;GAAMT,mB;;KAAAA,mB;AAkEN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = ({ removeModal }) => {\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n removeModal()\r\n setSubmitOkMessageModalState(true)\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div className=\"modal-background\" onClick={e => removeModal()}>\r\n <div className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n {/* <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div> */}\r\n </div>\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\login\\\\passwordReset\\\\PasswordForgotModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useRef, useEffect } from 'react';\nimport config from '../../../config';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport \"./PasswordForgotModal.css\";\nimport MessageModal from '../../../components/messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst PasswordForgotModal = () => {\n _s();\n\n // Submit ok modal\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);\n const submitOkModalRef = useRef(null);\n\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form\n\n\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);\n const forgotPasswordFormRef = useRef(null);\n\n const toggleForgotPasswordFormVisible = () => {\n showForgotPasswordForm(!forgotPasswordFormVisibilityState);\n };\n\n const [username, setUsername] = useState('');\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\n toggleForgotPasswordFormVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (forgotPasswordFormVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [forgotPasswordFormVisibilityState]);\n useEffect(() => {\n const pageClickEvent = e => {\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\n toggleSubmitOkModalVisible();\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (submitOkModalVisibilityState) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [submitOkModalVisibilityState]);\n const userInputData = JSON.stringify({\n email: `${username}`\n });\n const ForgotPasswordRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handlePasswordForgot = e => {\n e.preventDefault();\n toggleForgotPasswordFormVisible();\n toggleSubmitOkModalVisible(); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Error: something went wrong\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // toggleSubmitOkModalVisible()\n // }\n // })\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"password-forgot-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: toggleForgotPasswordFormVisible,\n children: \"Forgot password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n ref: forgotPasswordFormRef,\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"recoverPasswordForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Recover password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handlePasswordForgot,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: username,\n onChange: handleUsernameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(MessageModal, {\n ref: submitOkModalRef,\n activeState: submitOkModalRef,\n headerMessage: \"Email submitted!\",\n bodyMessage: \"An email with a password recovery link will be sent if it is registered in our system\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 5\n }, this);\n};\n\n_s(PasswordForgotModal, \"JewdldMzKvoWUXPBjhAQ4J+HRI8=\");\n\n_c = PasswordForgotModal;\nexport default PasswordForgotModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"PasswordForgotModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"],"names":["React","useState","useRef","useEffect","config","FontAwesomeIcon","MessageModal","PasswordForgotModal","submitOkModalVisibilityState","showSubmitOkModal","submitOkModalRef","toggleSubmitOkModalVisible","forgotPasswordFormVisibilityState","showForgotPasswordForm","forgotPasswordFormRef","toggleForgotPasswordFormVisible","username","setUsername","handleUsernameChange","e","target","value","pageClickEvent","current","contains","window","addEventListener","removeEventListener","userInputData","JSON","stringify","email","ForgotPasswordRequestOptions","method","body","handlePasswordForgot","preventDefault"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDR,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMS,gBAAgB,GAAGR,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMS,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJgC,CAMhC;;;AACA,QAAM,CAACI,iCAAD,EAAoCC,sBAApC,IAA8DZ,QAAQ,CAAC,KAAD,CAA5E;AACA,QAAMa,qBAAqB,GAAGZ,MAAM,CAAC,IAAD,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AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eA+BE,QAAC,YAAD;AAAc,MAAA,GAAG,EAAER,gBAAnB;AAAqC,MAAA,WAAW,EAAEA,gBAAlD;AAAoE,MAAA,aAAa,EAAE,kBAAnF;AAAuG,MAAA,WAAW,EAAE;AAApH;AAAA;AAAA;AAAA;AAAA,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAoCD,CAtHD;;GAAMH,mB;;KAAAA,mB;AAwHN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useRef, useEffect } from 'react'\r\nimport config from '../../../config'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\nimport \"./PasswordForgotModal.css\"\r\nimport MessageModal from '../../../components/messageModal/MessageModal';\r\n\r\nconst PasswordForgotModal = () => {\r\n // Submit ok modal\r\n const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)\r\n const submitOkModalRef = useRef(null)\r\n const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)\r\n\r\n // Forgot password form\r\n const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)\r\n const forgotPasswordFormRef = useRef(null)\r\n const toggleForgotPasswordFormVisible = () => {\r\n showForgotPasswordForm(!forgotPasswordFormVisibilityState)\r\n }\r\n\r\n const [username, setUsername] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {\r\n toggleForgotPasswordFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (forgotPasswordFormVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [forgotPasswordFormVisibilityState]);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {\r\n toggleSubmitOkModalVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (submitOkModalVisibilityState) {\r\n window.addEventListener('click', pageClickEvent);\r\n }\r\n\r\n return () => {\r\n window.removeEventListener('click', pageClickEvent);\r\n }\r\n\r\n }, [submitOkModalVisibilityState]);\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n })\r\n\r\n const ForgotPasswordRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n }\r\n\r\n const handlePasswordForgot = (e) => {\r\n e.preventDefault();\r\n\r\n toggleForgotPasswordFormVisible()\r\n toggleSubmitOkModalVisible()\r\n // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Error: something went wrong\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // toggleSubmitOkModalVisible()\r\n // }\r\n // })\r\n }\r\n\r\n return (\r\n <div>\r\n <div className=\"password-forgot-prompt\">\r\n <span>\r\n <a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>\r\n </span>\r\n </div>\r\n\r\n {/* Forgot password modal */}\r\n <div className={`modal ${forgotPasswordFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={forgotPasswordFormRef} className=\"modal-content\">\r\n <div className=\"recoverPasswordForm\">\r\n <h2>Recover password</h2>\r\n <form onSubmit={handlePasswordForgot}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n An email with a password recovery link will be sent if it is registered in our system\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n <MessageModal ref={submitOkModalRef} activeState={submitOkModalRef} headerMessage={\"Email submitted!\"} bodyMessage={\"An email with a password recovery link will be sent if it is registered in our system\"} />\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default PasswordForgotModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\messageModal\\\\MessageModal.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst MessageModal = props => {\n _s();\n\n const [modalVisibilityState, showModal] = useState(props.activeState);\n\n const toggleModalVisible = () => showModal(!modalVisibilityState);\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${modalVisibilityState ? \"active\" : \"inactive\"}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"submitOkModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: props.headerMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: props.bodyMessage\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n onClick: toggleModalVisible,\n children: \"Ok\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 15,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 10,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 5\n }, this);\n};\n\n_s(MessageModal, \"a0j9JHC4UO7g+PPm+oPuJjfBun8=\");\n\n_c = MessageModal;\nexport default MessageModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"MessageModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/messageModal/MessageModal.jsx"],"names":["React","useState","MessageModal","props","modalVisibilityState","showModal","activeState","toggleModalVisible","headerMessage","bodyMessage"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;;;AAEA,MAAMC,YAAY,GAAIC,KAAD,IAAW;AAAA;;AAC9B,QAAM,CAACC,oBAAD,EAAuBC,SAAvB,IAAoCJ,QAAQ,CAACE,KAAK,CAACG,WAAP,CAAlD;;AACA,QAAMC,kBAAkB,GAAG,MAAMF,SAAS,CAAC,CAACD,oBAAF,CAA1C;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAG,SAAQA,oBAAoB,GAAG,QAAH,GAAc,UAAW,EAAtE;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,eAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,eAAf;AAAA,gCACE;AAAA,oBAAKD,KAAK,CAACK;AAAX;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA,oBACGL,KAAK,CAACM;AADT;AAAA;AAAA;AAAA;AAAA,gBAFF,eAKE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,OAAO,EAAEF,kBAA9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAeD,CAnBD;;GAAML,Y;;KAAAA,Y;AAqBN,eAAeA,YAAf","sourcesContent":["import React, { useState } from 'react'\r\n\r\nconst MessageModal = (props) => {\r\n const [modalVisibilityState, showModal] = useState(props.activeState)\r\n const toggleModalVisible = () => showModal(!modalVisibilityState)\r\n\r\n return (\r\n <div className={`modal ${modalVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div className=\"modal-content\">\r\n <div className=\"submitOkModal\">\r\n <h2>{props.headerMessage}</h2>\r\n <label>\r\n {props.bodyMessage}\r\n </label>\r\n <button className=\"formSubmitButton\" onClick={toggleModalVisible}>\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default MessageModal\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment