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

added ability to change password from the account page + some refactoring

parent c9ac64c1
This diff is collapsed.
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport config from '../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = ({\n userInfo\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const accessToken = oktaAuth.getAccessToken();\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const [confirmNewPassword, setConfirmNewPassword] = useState(null);\n\n const handleOldPasswordChange = e => {\n setOldPassword(e.target.value);\n };\n\n const handleNewPasswordChange = e => {\n setNewPassword(e.target.value);\n };\n\n const handleConfirmNewPasswordChange = e => {\n setConfirmNewPassword(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${userInfo && userInfo.email}`,\n oldPassword: `${oldPassword}`,\n newPassword: `${newPassword}`\n });\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: userInputData\n };\n\n const handleChangePasswordFormSubmit = e => {\n e.preventDefault();\n\n if (!oldPassword || !newPassword || !confirmNewPassword) {\n window.alert(\"A password field is blank\");\n return;\n }\n\n if (!(confirmNewPassword.length >= 7)) {\n window.alert(\"Password must consist of 8 characters or more\");\n return;\n }\n\n if (!(newPassword == confirmNewPassword)) {\n window.alert(\"Passwords do not match\");\n return;\n } else {\n fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Old password is not correct\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n setSubmitOkMessageModalState(true);\n }\n });\n }\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"oldPassword\",\n type: \"password\",\n value: oldPassword,\n onChange: handleOldPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"newPassword\",\n type: \"password\",\n value: newPassword,\n onChange: handleNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"confirmNewPassword\",\n type: \"password\",\n value: confirmNewPassword,\n onChange: handleConfirmNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 126,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\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: \"Password has been changed\",\n bodyMessage: \"You can now sign in using your new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 132,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"IFh0de2or+oR0L9rclAKOf5gZnU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","MessageModal","config","ChangePassword","userInfo","authState","oktaAuth","accessToken","getAccessToken","submitOkMessageModalState","setSubmitOkMessageModalState","oldPassword","setOldPassword","newPassword","setNewPassword","confirmNewPassword","setConfirmNewPassword","handleOldPasswordChange","e","target","value","handleNewPasswordChange","handleConfirmNewPasswordChange","userInputData","JSON","stringify","email","ChangePasswordRequestOptions","method","headers","Authorization","body","handleChangePasswordFormSubmit","preventDefault","window","alert","length","fetch","serviceAPI","changePasswordURL","then","res","ok","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,8BAAzB;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,cAAc,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAkB;AAAA;;AACvC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAMQ,WAAW,GAAGD,QAAQ,CAACE,cAAT,EAApB;AACA,QAAM,CAACC,yBAAD,EAA4BC,4BAA5B,IAA4DZ,QAAQ,CAAC,KAAD,CAA1E;AAEA,QAAM,CAACa,WAAD,EAAcC,cAAd,IAAgCd,QAAQ,CAAC,IAAD,CAA9C;AACA,QAAM,CAACe,WAAD,EAAcC,cAAd,IAAgChB,QAAQ,CAAC,IAAD,CAA9C;AACA,QAAM,CAACiB,kBAAD,EAAqBC,qBAArB,IAA8ClB,QAAQ,CAAC,IAAD,CAA5D;;AAEA,QAAMmB,uBAAuB,GAAIC,CAAD,IAAO;AACrCN,IAAAA,cAAc,CAACM,CAAC,CAACC,MAAF,CAASC,KAAV,CAAd;AACD,GAFD;;AAIA,QAAMC,uBAAuB,GAAIH,CAAD,IAAO;AACrCJ,IAAAA,cAAc,CAACI,CAAC,CAACC,MAAF,CAASC,KAAV,CAAd;AACD,GAFD;;AAIA,QAAME,8BAA8B,GAAIJ,CAAD,IAAO;AAC5CF,IAAAA,qBAAqB,CAACE,CAAC,CAACC,MAAF,CAASC,KAAV,CAArB;AACD,GAFD;;AAIA,QAAMG,aAAa,GAAGC,IAAI,CAACC,SAAL,CAAe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A;AAAA;AAAA;AAAA,oBADF,eAIE;AACE,cAAA,EAAE,EAAC,oBADL;AAC0B,cAAA,IAAI,EAAC,UAD/B;AAEE,cAAA,KAAK,EAAEN,kBAFT;AAGE,cAAA,QAAQ,EAAEO;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAnBF,eA4BE;AAAK,YAAA,SAAS,EAAC,WAAf;AAAA,mCACE;AAAQ,cAAA,SAAS,EAAC,2BAAlB;AAA8C,cAAA,IAAI,EAAC,QAAnD;AAAA,oDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA5BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAbF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAwDE;AAAK,MAAA,SAAS,EAAG,SAAQb,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,2BAArF;AAAkH,QAAA,WAAW,EAAE;AAA/H;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAxDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA8DD,CAlID;;GAAMP,c;UAC4BJ,W;;;KAD5BI,c;AAoIN,eAAeA,cAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\nimport config from '../../config';\r\n\r\nconst ChangePassword = ({ userInfo }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const accessToken = oktaAuth.getAccessToken();\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n const [confirmNewPassword, setConfirmNewPassword] = useState(null)\r\n\r\n const handleOldPasswordChange = (e) => {\r\n setOldPassword(e.target.value)\r\n }\r\n\r\n const handleNewPasswordChange = (e) => {\r\n setNewPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmNewPasswordChange = (e) => {\r\n setConfirmNewPassword(e.target.value);\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${userInfo && userInfo.email}`,\r\n oldPassword: `${oldPassword}`,\r\n newPassword: `${newPassword}`\r\n })\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: userInputData\r\n }\r\n\r\n const handleChangePasswordFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!oldPassword || !newPassword || !confirmNewPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmNewPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(newPassword == confirmNewPassword)) {\r\n window.alert(\"Passwords do not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Old password is not correct\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n setSubmitOkMessageModalState(true)\r\n }\r\n })\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input\r\n id=\"oldPassword\" type=\"password\"\r\n value={oldPassword}\r\n onChange={handleOldPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input\r\n id=\"newPassword\" type=\"password\"\r\n value={newPassword}\r\n onChange={handleNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input\r\n id=\"confirmNewPassword\" type=\"password\"\r\n value={confirmNewPassword}\r\n onChange={handleConfirmNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Password has been changed\"} bodyMessage={\"You can now sign in using your new password\"} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\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\\\\account\\\\Account.jsx\";\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\nimport UserDataInfo from '../../components/updateUserData/UserDataInfo';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"page-content-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content-header\",\n children: /*#__PURE__*/_jsxDEV(\"h2\", {\n className: \"welcome-text\",\n children: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(UserDataInfo, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ChangePassword, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(RemoveAccount, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 5\n }, this);\n}\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.jsx"],"names":["React","useState","useEffect","ConfirmRemoveAccountModal","ChangePassword","RemoveAccount","UserDataInfo","Account"],"mappings":";AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,eAAP;AAEA,OAAOC,yBAAP,MAAsC,oFAAtC;AACA,OAAOC,cAAP,MAA2B,gDAA3B;AACA,OAAOC,aAAP,MAA0B,8CAA1B;AACA,OAAOC,YAAP,MAAyB,8CAAzB;;;AAEA,SAASC,OAAT,GAAmB;AACjB,sBACE;AAAK,IAAA,SAAS,EAAC,wBAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,gBAAf;AAAA,6BACE;AAAI,QAAA,SAAS,EAAC,cAAd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAIE;AAAK,MAAA,SAAS,EAAC,qBAAf;AAAA,8BAEE,QAAC,YAAD;AAAA;AAAA;AAAA;AAAA,cAFF,eAGE,QAAC,cAAD;AAAA;AAAA;AAAA;AAAA,cAHF,eAIE,QAAC,aAAD;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YAJF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAcD;;KAfQA,O;AAiBT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\n\r\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\r\nimport UserDataInfo from '../../components/updateUserData/UserDataInfo';\r\n\r\nfunction Account() {\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <UserDataInfo />\r\n <ChangePassword />\r\n <RemoveAccount />\r\n\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\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\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = ({\n accessToken,\n userInfo\n}) => {\n _s();\n\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`,\n oldPassword: `${oldPassword}`,\n newPassword: `${newPassword}`\n })\n };\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"1/P+Ubwx+q9Gj6fjtSw+3K6XSt4=\");\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","FontAwesomeIcon","MessageModal","ChangePassword","accessToken","userInfo","oldPassword","setOldPassword","newPassword","setNewPassword","ChangePasswordRequestOptions","method","headers","Authorization","body","JSON","stringify","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,8BAAzB;;;AAEA,MAAMC,cAAc,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA;AAAf,CAAD,KAA+B;AAAA;;AACpD,QAAM,CAACC,WAAD,EAAcC,cAAd,IAAgCP,QAAQ,CAAC,IAAD,CAA9C;AACA,QAAM,CAACQ,WAAD,EAAcC,cAAd,IAAgCT,QAAQ,CAAC,IAAD,CAA9C;AAEA,QA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A,oCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAIE;AAAO,cAAA,IAAI,EAAC;AAAZ;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAPF,eAaE;AAAK,YAAA,SAAS,EAAC,WAAf;AAAA,oCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAIE;AAAO,cAAA,IAAI,EAAC;AAAZ;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAbF,eAmBE;AAAK,YAAA,SAAS,EAAC,WAAf;AAAA,mCACE;AAAQ,cAAA,SAAS,EAAC,2BAAlB;AAA8C,cAAA,IAAI,EAAC,QAAnD;AAAA,oDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAnBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAbF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkDD,CApED;;GAAML,c;;KAAAA,c;AAsEN,eAAeA,cAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\n\r\nconst ChangePassword = ({ accessToken, userInfo }) => {\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n oldPassword: `${oldPassword}`,\r\n newPassword: `${newPassword}`\r\n }\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\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\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = ({\n accessToken,\n userInfo\n}) => {\n _s();\n\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`,\n oldPassword: `${oldPassword}`,\n newPassword: `${newPassword}`\n })\n };\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Old password + \", userInfo]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"1/P+Ubwx+q9Gj6fjtSw+3K6XSt4=\");\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","FontAwesomeIcon","MessageModal","ChangePassword","accessToken","userInfo","oldPassword","setOldPassword","newPassword","setNewPassword","ChangePasswordRequestOptions","method","headers","Authorization","body","JSON","stringify","email"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,8BAAzB;;;AAEA,MAAMC,cAAc,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA;AAAf,CAAD,KAA+B;AAAA;;AACpD,QAAM,CAACC,WAAD,EAAcC,cAAd,IAAgCP,QAAQ,CAAC,IAAD,CAA9C;AACA,QAAM,CAACQ,WAAD,EAAcC,cAAd,IAAgCT,QAAQ,CAAC,IAAD,CAA9C;AAEA,QAAMU,4BAA4B,GAAG;AACnCC,IAAAA,MAAM,EAAE,KAD2B;AAEnCC,IAAAA,OAAO,EAAE;AACPC,MAAAA,aAAa,EAAG,UAAST,WAAY;AAD9B,KAF0B;AAKnCU,IAAAA,IAAI,EAAEC,IAAI,CAACC,SAAL,CACJ;AACEC,MAAAA,KAAK,EAAG,GAAEZ,QAAQ,IAAIA,QAAQ,CAACY,KAAM,EADvC;AA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eAIE;AAAO,cAAA,IAAI,EAAC;AAAZ;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAbF,eAmBE;AAAK,YAAA,SAAS,EAAC,WAAf;AAAA,mCACE;AAAQ,cAAA,SAAS,EAAC,2BAAlB;AAA8C,cAAA,IAAI,EAAC,QAAnD;AAAA,oDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAnBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAbF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkDD,CApED;;GAAMF,c;;KAAAA,c;AAsEN,eAAeA,cAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\n\r\nconst ChangePassword = ({ accessToken, userInfo }) => {\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n oldPassword: `${oldPassword}`,\r\n newPassword: `${newPassword}`\r\n }\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password + {userInfo}\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\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\\\\updateUserData\\\\updateUserDataModal\\\\UpdateUserDataModal.js\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport \"./UpdateUserDataModal.css\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport config from '../../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst UpdateUserDataModal = ({\n removeModal\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setFirstname(userInfo.given_name);\n userInfo && setLastname(userInfo.family_name);\n userInfo && setUsername(userInfo.email);\n }, [userInfo]);\n const [firstname, setFirstname] = useState('');\n const [lastname, setLastname] = useState('');\n const [username, setUsername] = useState('');\n\n const handlefirstnameChange = e => {\n setFirstname(e.target.value);\n };\n\n const handlelastnameChange = e => {\n setLastname(e.target.value);\n };\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n email: `${username}`\n });\n const updateUserDataRequestOptions = {\n method: 'PUT',\n body: userInputData\n };\n\n const handleUpdateUserDataFormSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.updateUserDataURL, updateUserDataRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n removeModal();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"updateUserDataModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Update information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n userDataSubmitForm: true,\n children: /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleUpdateUserDataFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"firstname\",\n type: \"text\",\n value: firstname,\n onChange: handlefirstnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"lastname\",\n type: \"text\",\n value: lastname,\n onChange: handlelastnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 13\n }, this), /*#__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: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"Cancel\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n type: \"submit\",\n children: \"Update\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 5\n }, this);\n};\n\n_s(UpdateUserDataModal, \"AxzdzHC979Yq9E6/6HJDjeCl4CA=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = UpdateUserDataModal;\nexport default UpdateUserDataModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"UpdateUserDataModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/updateUserData/updateUserDataModal/UpdateUserDataModal.js"],"names":["React","useState","useEffect","useOktaAuth","config","UpdateUserDataModal","removeModal","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","setFirstname","given_name","setLastname","family_name","setUsername","email","firstname","lastname","username","handlefirstnameChange","target","value","handlelastnameChange","handleUsernameChange","userInputData","JSON","stringify","updateUserDataRequestOptions","method","body","handleUpdateUserDataFormSubmit","preventDefault","fetch","serviceAPI","updateUserDataURL","res","ok","window","alert","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,2BAAP;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAqB;AAAA;;AAC/C,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BL,WAAW,EAA3C;AACA,QAAM,CAACM,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMU,WAAW,GAAGH,QAAQ,CAACI,cAAT,EAApB;;AAEA,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIAb,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACK,SAAS,CAACS,eAAf,EAAgC;AAC9B;AACAN,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLF,MAAAA,QAAQ,CAACS,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BT,QAAAA,WAAW,CAACS,IAAD,CAAX;AACD,OAFD;AAGD;AACF,GATQ,EASN,CAACZ,SAAD,EAAYC,QAAZ,CATM,CAAT,CAT+C,CAkBpB;;AAE3BN,EAAAA,SAAS,CAAC,MAAM;AACdO,IAAAA,QAAQ,IACNW,YAAY,CAACX,QAA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,EAAEnB,CAAC,IAAIR,WAAW,EAAtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAIE;AAAQ,cAAA,SAAS,EAAC,WAAlB;AAA8B,cAAA,IAAI,EAAC,QAAnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAtBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAwCD,CArHD;;GAAMD,mB;UAC4BF,W;;;KAD5BE,mB;AAuHN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useEffect } from 'react'\r\nimport \"./UpdateUserDataModal.css\"\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport config from '../../../config';\r\n\r\nconst UpdateUserDataModal = ({ removeModal }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setFirstname(userInfo.given_name)\r\n )\r\n\r\n userInfo && (\r\n setLastname(userInfo.family_name)\r\n )\r\n\r\n userInfo && (\r\n setUsername(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n const [firstname, setFirstname] = useState('')\r\n const [lastname, setLastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n\r\n const handlefirstnameChange = (e) => {\r\n setFirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setLastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`\r\n })\r\n\r\n const updateUserDataRequestOptions = {\r\n method: 'PUT',\r\n body: userInputData\r\n };\r\n\r\n const handleUpdateUserDataFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.updateUserDataURL, updateUserDataRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n removeModal()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"updateUserDataModal\">\r\n <h2>Update information</h2>\r\n <div userDataSubmitForm>\r\n <form onSubmit={handleUpdateUserDataFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\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 <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n Cancel\r\n </button>\r\n <button className=\"yesButton\" type=\"submit\">\r\n Update\r\n </button>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default UpdateUserDataModal\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\\\\account\\\\Account.js\",\n _s = $RefreshSig$();\n\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./Account.css\";\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\nimport UserDataInfo from '../../components/updateUserData/UserDataInfo';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"page-content-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content-header\",\n children: /*#__PURE__*/_jsxDEV(\"h2\", {\n className: \"welcome-text\",\n children: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(UserDataInfo, {\n useAuthState: authState,\n useOktaAuth: oktaAuth,\n userInfo: userInfo,\n accessToken: accessToken\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ChangePassword, {\n accessToken: accessToken,\n userInfo: userInfo\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(RemoveAccount, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 5\n }, this);\n}\n\n_s(Account, \"/7FunoA1ejJNU8uKGTy1GZFqU2I=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.js"],"names":["React","useState","useEffect","useOktaAuth","ConfirmRemoveAccountModal","ChangePassword","RemoveAccount","UserDataInfo","Account","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","isAuthenticated","getUser","then","info"],"mappings":";;;AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,eAAP;AAEA,OAAOC,yBAAP,MAAsC,oFAAtC;AACA,OAAOC,cAAP,MAA2B,gDAA3B;AACA,OAAOC,aAAP,MAA0B,8CAA1B;AACA,OAAOC,YAAP,MAAyB,8CAAzB;;;AAEA,SAASC,OAAT,GAAmB;AAAA;;AACjB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAM,CAACQ,QAAD,EAAWC,WAAX,IAA0BX,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMY,WAAW,GAAGH,QAAQ,CAACI,cAAT,EAApB;AAEAZ,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACO,SAAS,CAACM,eAAf,EAAgC;AAC9B;AACAH,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLF,MAAAA,QAAQ,CAACM,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BN,QAAAA,WAAW,CAACM,IAAD,CAAX;AACD,OAFD;AAGD;AACF,GATQ,EASN,CAACT,SAAD,EAAYC,QAAZ,CATM,CAAT,CALiB,CAcU;;AAE3B,sBACE;AAAK,IAAA,SAAS,EAAC,wBAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,gBAAf;AAAA,6BACE;AAAI,QAAA,SAAS,EAAC,cAAd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAIE;AAAK,MAAA,SAAS,EAAC,qBAAf;AAAA,8BAEE,QAAC,YAAD;AAAc,QAAA,YAAY,EAAED,SAA5B;AAAuC,QAAA,WAAW,EAAEC,QAApD;AAA8D,QAAA,QAAQ,EAAEC,QAAxE;AAAkF,QAAA,WAAW,EAAEE;AAA/F;AAAA;AAAA;AAAA;AAAA,cAFF,eAGE,QAAC,cAAD;AAAgB,QAAA,WAAW,EAAEA,WAA7B;AAA0C,QAAA,QAAQ,EAAEF;AAApD;AAAA;AAAA;AAAA;AAAA,cAHF,eAIE,QAAC,aAAD;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YAJF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAcD;;GA9BQH,O;UACyBL,W;;;KADzBK,O;AAgCT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Account.css\"\r\n\r\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\r\nimport UserDataInfo from '../../components/updateUserData/UserDataInfo';\r\n\r\nfunction Account() {\r\n const { authState, oktaAuth } = useOktaAuth()\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken()\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <UserDataInfo useAuthState={authState} useOktaAuth={oktaAuth} userInfo={userInfo} accessToken={accessToken} />\r\n <ChangePassword accessToken={accessToken} userInfo={userInfo} />\r\n <RemoveAccount />\r\n\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\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\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = ({\n userInfo\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const accessToken = oktaAuth.getAccessToken();\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const [confirmNewPassword, setConfirmNewPassword] = useState(null);\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`,\n oldPassword: `${oldPassword}`,\n newPassword: `${newPassword}`\n })\n };\n\n const handleOldPasswordChange = e => {\n setOldPassword(e.target.value);\n };\n\n const handleNewPasswordChange = e => {\n setNewPassword(e.target.value);\n };\n\n const handleConfirmNewPasswordChange = e => {\n setConfirmNewPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"oldPassword\",\n type: \"password\",\n value: oldPassword,\n onChange: handleOldPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"newPassword\",\n type: \"password\",\n value: newPassword,\n onChange: handleNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"confirmNewPassword\",\n type: \"password\",\n value: confirmNewPassword,\n onChange: handleConfirmNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"0FTOpqqPETEY2KV7VaQF4QlgLu8=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","MessageModal","ChangePassword","userInfo","authState","oktaAuth","accessToken","getAccessToken","oldPassword","setOldPassword","newPassword","setNewPassword","confirmNewPassword","setConfirmNewPassword","ChangePasswordRequestOptions","method","headers","Authorization","body","JSON","stringify","email","handleOldPasswordChange","e","target","value","handleNewPasswordChange","handleConfirmNewPasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,8BAAzB;;;AAEA,MAAMC,cAAc,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAkB;AAAA;;AACvC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BN,WAAW,EAA3C;AACA,QAAMO,WAAW,GAAGD,QAAQ,CAACE,cAAT,EAApB;AAEA,QAAM,CAACC,WAAD,EAAcC,cAAd,IAAgCX,QAAQ,CAAC,IAAD,CAA9C;AACA,Q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AAA,IAAI,EAAC,QAAnD;AAAA,oDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA5BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAbF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA2DD,CA7FD;;GAAMzB,c;UAC4BH,W;;;KAD5BG,c;AA+FN,eAAeA,cAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\n\r\nconst ChangePassword = ({ userInfo }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n const [confirmNewPassword, setConfirmNewPassword] = useState(null)\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n oldPassword: `${oldPassword}`,\r\n newPassword: `${newPassword}`\r\n }\r\n )\r\n }\r\n\r\n const handleOldPasswordChange = (e) => {\r\n setOldPassword(e.target.value)\r\n }\r\n\r\n const handleNewPasswordChange = (e) => {\r\n setNewPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmNewPasswordChange = (e) => {\r\n setConfirmNewPassword(e.target.value);\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input\r\n id=\"oldPassword\" type=\"password\"\r\n value={oldPassword}\r\n onChange={handleOldPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input\r\n id=\"newPassword\" type=\"password\"\r\n value={newPassword}\r\n onChange={handleNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input\r\n id=\"confirmNewPassword\" type=\"password\"\r\n value={confirmNewPassword}\r\n onChange={handleConfirmNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\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\\\\navbar\\\\navLinks\\\\NavLinks.js\";\nimport React from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport \"./NavLinks.css\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst NavLinks = () => {\n return /*#__PURE__*/_jsxDEV(\"ul\", {\n className: \"left-unstyled-navbar\",\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n className: \"report-bug-navbutton-container\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/reportissue\",\n activeClassName: \"activeUnderlined\",\n children: \"Report issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 9,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 8,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n className: \"manage-projects-navbutton-container\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/projects\",\n activeClassName: \"activeUnderlined\",\n children: \"Projects\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n className: \"manage-team-navbutton-container\",\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/teams\",\n activeClassName: \"activeUnderlined\",\n children: \"Teams\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 15,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 7,\n columnNumber: 5\n }, this);\n};\n\n_c = NavLinks;\nexport default NavLinks;\n\nvar _c;\n\n$RefreshReg$(_c, \"NavLinks\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/navLinks/NavLinks.js"],"names":["React","NavLink","NavLinks"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAO,gBAAP;;;AAEA,MAAMC,QAAQ,GAAG,MAAM;AACrB,sBACE;AAAI,IAAA,SAAS,EAAC,sBAAd;AAAA,4BACE;AAAI,MAAA,SAAS,EAAC,gCAAd;AAAA,6BACE,QAAC,OAAD;AAAS,QAAA,EAAE,EAAC,cAAZ;AAA2B,QAAA,eAAe,EAAC,kBAA3C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAIE;AAAI,MAAA,SAAS,EAAC,qCAAd;AAAA,6BACE,QAAC,OAAD;AAAS,QAAA,EAAE,EAAC,WAAZ;AAAwB,QAAA,eAAe,EAAC,kBAAxC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAJF,eAOE;AAAI,MAAA,SAAS,EAAC,iCAAd;AAAA,6BACE,QAAC,OAAD;AAAS,QAAA,EAAE,EAAC,QAAZ;AAAqB,QAAA,eAAe,EAAC,kBAArC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAaD,CAdD;;KAAMA,Q;AAgBN,eAAeA,QAAf","sourcesContent":["import React from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport \"./NavLinks.css\"\r\n\r\nconst NavLinks = () => {\r\n return (\r\n <ul className=\"left-unstyled-navbar\">\r\n <li className=\"report-bug-navbutton-container\">\r\n <NavLink to=\"/reportissue\" activeClassName=\"activeUnderlined\">Report issues</NavLink>\r\n </li>\r\n <li className=\"manage-projects-navbutton-container\">\r\n <NavLink to=\"/projects\" activeClassName=\"activeUnderlined\">Projects</NavLink>\r\n </li>\r\n <li className=\"manage-team-navbutton-container\">\r\n <NavLink to=\"/teams\" activeClassName=\"activeUnderlined\">Teams</NavLink>\r\n </li>\r\n </ul>\r\n )\r\n}\r\n\r\nexport default NavLinks"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\updateUserData\\\\updateUserDataModal\\\\UpdateUserDataModal.js\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport \"./UpdateUserDataModal.css\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport config from '../../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst UpdateUserDataModal = ({\n removeModal\n}) => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [userInfo, setUserInfo] = useState(null);\n const accessToken = oktaAuth.getAccessToken();\n\n const stopProp = e => {\n e.stopPropagation();\n };\n\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n useEffect(() => {\n userInfo && setFirstname(userInfo.given_name);\n userInfo && setLastname(userInfo.family_name);\n userInfo && setUsername(userInfo.email);\n }, [userInfo]);\n const [firstname, setFirstname] = useState('');\n const [lastname, setLastname] = useState('');\n const [username, setUsername] = useState('');\n\n const handleFirstnameChange = e => {\n setFirstname(e.target.value);\n };\n\n const handleLastnameChange = e => {\n setLastname(e.target.value);\n };\n\n const handleUsernameChange = e => {\n setUsername(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n firstname: `${firstname}`,\n lastname: `${lastname}`,\n email: `${username}`\n });\n const updateUserDataRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: userInputData\n };\n\n const handleUpdateUserDataFormSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.updateUserDataURL, updateUserDataRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n removeModal();\n }\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"updateUserDataModal\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Update information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n userDataSubmitForm: true,\n children: /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleUpdateUserDataFormSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"firstname\",\n type: \"text\",\n value: firstname,\n onChange: handleFirstnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"lastname\",\n type: \"text\",\n value: lastname,\n onChange: handleLastnameChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 13\n }, this), /*#__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: 108,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttonContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"noButton\",\n onClick: e => removeModal(),\n children: \"Cancel\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"yesButton\",\n type: \"submit\",\n children: \"Update\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 5\n }, this);\n};\n\n_s(UpdateUserDataModal, \"AxzdzHC979Yq9E6/6HJDjeCl4CA=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = UpdateUserDataModal;\nexport default UpdateUserDataModal;\n\nvar _c;\n\n$RefreshReg$(_c, \"UpdateUserDataModal\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/updateUserData/updateUserDataModal/UpdateUserDataModal.js"],"names":["React","useState","useEffect","useOktaAuth","config","UpdateUserDataModal","removeModal","authState","oktaAuth","userInfo","setUserInfo","accessToken","getAccessToken","stopProp","e","stopPropagation","isAuthenticated","getUser","then","info","setFirstname","given_name","setLastname","family_name","setUsername","email","firstname","lastname","username","handleFirstnameChange","target","value","handleLastnameChange","handleUsernameChange","userInputData","JSON","stringify","updateUserDataRequestOptions","method","headers","Authorization","body","handleUpdateUserDataFormSubmit","preventDefault","fetch","serviceAPI","updateUserDataURL","res","ok","window","alert","Promise","reject"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,2BAAP;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAqB;AAAA;;AAC/C,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BL,WAAW,EAA3C;AACA,QAAM,CAACM,QAAD,EAAWC,WAAX,IAA0BT,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAMU,WAAW,GAAGH,QAAQ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EG;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAQE;AAAA,kDAEE;AACE,cAAA,EAAE,EAAC,UADL;AACgB,cAAA,IAAI,EAAC,MADrB;AAEE,cAAA,KAAK,EAAEF,QAFT;AAGE,cAAA,QAAQ,EAAEK;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBARF,eAeE;AAAA,8CAEE;AACE,cAAA,EAAE,EAAC,OADL;AACa,cAAA,IAAI,EAAC,MADlB;AAEE,cAAA,KAAK,EAAEJ,QAFT;AAGE,cAAA,QAAQ,EAAEK;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAfF,eAsBE;AAAK,YAAA,SAAS,EAAC,iBAAf;AAAA,oCACE;AAAQ,cAAA,SAAS,EAAC,UAAlB;AAA6B,cAAA,OAAO,EAAEnB,CAAC,IAAIR,WAAW,EAAtD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAIE;AAAQ,cAAA,SAAS,EAAC,WAAlB;AAA8B,cAAA,IAAI,EAAC,QAAnC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAtBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAwCD,CAxHD;;GAAMD,mB;UAC4BF,W;;;KAD5BE,mB;AA0HN,eAAeA,mBAAf","sourcesContent":["import React, { useState, useEffect } from 'react'\r\nimport \"./UpdateUserDataModal.css\"\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport config from '../../../config';\r\n\r\nconst UpdateUserDataModal = ({ removeModal }) => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [userInfo, setUserInfo] = useState(null);\r\n const accessToken = oktaAuth.getAccessToken();\r\n\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n useEffect(() => {\r\n userInfo && (\r\n setFirstname(userInfo.given_name)\r\n )\r\n\r\n userInfo && (\r\n setLastname(userInfo.family_name)\r\n )\r\n\r\n userInfo && (\r\n setUsername(userInfo.email)\r\n )\r\n }, [userInfo])\r\n\r\n const [firstname, setFirstname] = useState('')\r\n const [lastname, setLastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n\r\n const handleFirstnameChange = (e) => {\r\n setFirstname(e.target.value)\r\n }\r\n\r\n const handleLastnameChange = (e) => {\r\n setLastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`\r\n })\r\n\r\n const updateUserDataRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: userInputData\r\n };\r\n\r\n const handleUpdateUserDataFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.updateUserDataURL, updateUserDataRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n removeModal()\r\n }\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\">\r\n <div className=\"updateUserDataModal\">\r\n <h2>Update information</h2>\r\n <div userDataSubmitForm>\r\n <form onSubmit={handleUpdateUserDataFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handleFirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handleLastnameChange} />\r\n </label>\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 <div className=\"buttonContainer\">\r\n <button className=\"noButton\" onClick={e => removeModal()}>\r\n Cancel\r\n </button>\r\n <button className=\"yesButton\" type=\"submit\">\r\n Update\r\n </button>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default UpdateUserDataModal\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.js\",\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'; // TODO : Clean up and make more like the message modal component\n\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 fetch(config.serviceAPI.forgotPasswordURL, ForgotPasswordRequestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error: something went wrong\");\n console.log(res);\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n toggleForgotPasswordFormVisible();\n setSubmitOkMessageModalState(true);\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: 71,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\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: 79,\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: 83,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\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: 88,\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: 93,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\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: 100,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 68,\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.js"],"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","fetch","serviceAPI","forgotPasswordURL","then","res","ok","alert","console","log","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;AACA,OAAOC,YAAP,MAAyB,+CAAzB,C,CAGA;;;;AACA,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,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;;AAEA,QAAMe,oBAAoB,GAAIC,CAAD,IAAO;AAClCF,IAAAA,W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Ac,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,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CAhGD;;GAAMN,mB;;KAAAA,mB;AAkGN,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\n\r\n// TODO : Clean up and make more like the message modal component\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\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 fetch(config.serviceAPI.forgotPasswordURL, ForgotPasswordRequestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error: something went wrong\")\r\n console.log(res)\r\n Promise.reject(\"\")\r\n return\r\n }\r\n if (res.ok) {\r\n toggleForgotPasswordFormVisible()\r\n setSubmitOkMessageModalState(true)\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 <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\\\\components\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport config from '../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const accessToken = oktaAuth.getAccessToken();\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [userInfo, setUserInfo] = useState(null);\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const [confirmNewPassword, setConfirmNewPassword] = useState(null);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const handleOldPasswordChange = e => {\n setOldPassword(e.target.value);\n };\n\n const handleNewPasswordChange = e => {\n setNewPassword(e.target.value);\n };\n\n const handleConfirmNewPasswordChange = e => {\n setConfirmNewPassword(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${userInfo.email}`,\n newPassword: `${newPassword}`\n });\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: userInputData\n };\n\n const handleChangePasswordFormSubmit = e => {\n e.preventDefault();\n\n if (!oldPassword || !newPassword || !confirmNewPassword) {\n window.alert(\"A password field is blank\");\n return;\n }\n\n if (!(confirmNewPassword.length >= 7)) {\n window.alert(\"Password must consist of 8 characters or more\");\n return;\n }\n\n if (!(newPassword == confirmNewPassword)) {\n window.alert(\"Passwords do not match\");\n return;\n } else {\n window.alert(userInfo.email); // fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Old password is not correct\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // setSubmitOkMessageModalState(true)\n // setOldPassword('')\n // setNewPassword('')\n // setConfirmNewPassword('')\n // }\n // })\n }\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters \"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleChangePasswordFormSubmit,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"oldPassword\",\n type: \"password\",\n value: oldPassword,\n onChange: handleOldPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"newPassword\",\n type: \"password\",\n value: newPassword,\n onChange: handleNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 120,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 130,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"confirmNewPassword\",\n type: \"password\",\n value: confirmNewPassword,\n onChange: handleConfirmNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 129,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 141,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 139,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 138,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\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: \"Password has been changed\",\n bodyMessage: \"You can now sign in using your new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 148,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 147,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"Xnl+NTauGVDCVlSJN6leYUI37T8=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","MessageModal","config","ChangePassword","authState","oktaAuth","accessToken","getAccessToken","submitOkMessageModalState","setSubmitOkMessageModalState","userInfo","setUserInfo","oldPassword","setOldPassword","newPassword","setNewPassword","confirmNewPassword","setConfirmNewPassword","useEffect","isAuthenticated","getUser","then","info","handleOldPasswordChange","e","target","value","handleNewPasswordChange","handleConfirmNewPasswordChange","userInputData","JSON","stringify","email","ChangePasswordRequestOptions","method","headers","Authorization","body","handleChangePasswordFormSubmit","preventDefault","window","alert","length"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,8BAAzB;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,cAAc,GAAG,MAAM;AAAA;;AAC3B,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BN,WAAW,EAA3C;AACA,QAAMO,WAAW,GAAGD,QAAQ,CAACE,cAAT,EAApB;AACA,QAAM,CAACC,yBAAD,EAA4BC,4BAA5B,IAA4DX,QAAQ,CAAC,KAAD,CAA1E;AAEA,QAAM,CAACY,QAAD,EAAWC,WAAX,IAA0Bb,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAM,CAACc,WAAD,EAAcC,cAAd,IAAgCf,QAAQ,CAAC,IAAD,CAA9C;AACA,QAAM,CAACgB,WAAD,EAAcC,cAAd,IAAgCjB,QAAQ,CAAC,IAAD,CAA9C;AACA,QAAM,CAACkB,kBAAD,EAAqBC,qBAArB,IAA8CnB,QAAQ,CAAC,IAAD,CAA5D;AAEAoB,EAAAA,SAAS,CAAC,MAAM;AACd,QAAI,CAACd,SAAS,CAACe,eAAf,EAAgC;AAC9B;AACAR,MAAAA,WAAW,CAAC,IAAD,CAAX;AACD,KAHD,MAGO;AACLN,MAAAA,QAAQ,CAACe,OAAT,GAAmBC,IAAnB,CAAwBC,IAAI,IAAI;AAC9BX,QAAAA,WAAW,CAACW,IAAD,CAAX;AACD,OAFD;AAGD;AACF,GATQ,EASN,CAAClB,SAAD,EAAYC,QAAZ,CATM,CAAT,CAV2B,CAmBA;;AAE3B,QAAMkB,uBAAuB,GAAIC,CAAD,IAAO;A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;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAVF,eAmBE;AAAK,YAAA,SAAS,EAAC,WAAf;AAAA,oCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAIE;AACE,cAAA,EAAE,EAAC,oBADL;AAC0B,cAAA,IAAI,EAAC,UAD/B;AAEE,cAAA,KAAK,EAAEX,kBAFT;AAGE,cAAA,QAAQ,EAAEY;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAJF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAnBF,eA4BE;AAAK,YAAA,SAAS,EAAC,WAAf;AAAA,mCACE;AAAQ,cAAA,SAAS,EAAC,2BAAlB;AAA8C,cAAA,IAAI,EAAC,QAAnD;AAAA,oDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA5BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAbF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAwDE;AAAK,MAAA,SAAS,EAAG,SAAQpB,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,2BAArF;AAAkH,QAAA,WAAW,EAAE;AAA/H;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAxDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA8DD,CAjJD;;GAAMN,c;UAC4BJ,W;;;KAD5BI,c;AAmJN,eAAeA,cAAf","sourcesContent":["import React, { useState } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\nimport config from '../../config';\r\n\r\nconst ChangePassword = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const accessToken = oktaAuth.getAccessToken();\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [userInfo, setUserInfo] = useState(null);\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n const [confirmNewPassword, setConfirmNewPassword] = useState(null)\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const handleOldPasswordChange = (e) => {\r\n setOldPassword(e.target.value)\r\n }\r\n\r\n const handleNewPasswordChange = (e) => {\r\n setNewPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmNewPasswordChange = (e) => {\r\n setConfirmNewPassword(e.target.value);\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${userInfo.email}`,\r\n newPassword: `${newPassword}`\r\n })\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: userInputData\r\n }\r\n\r\n const handleChangePasswordFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!oldPassword || !newPassword || !confirmNewPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmNewPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(newPassword == confirmNewPassword)) {\r\n window.alert(\"Passwords do not match\")\r\n return\r\n }\r\n\r\n else {\r\n window.alert(userInfo.email)\r\n // fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Old password is not correct\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // setSubmitOkMessageModalState(true)\r\n // setOldPassword('')\r\n // setNewPassword('')\r\n // setConfirmNewPassword('')\r\n // }\r\n // })\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters { }\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form onSubmit={handleChangePasswordFormSubmit}>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input\r\n id=\"oldPassword\" type=\"password\"\r\n value={oldPassword}\r\n onChange={handleOldPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input\r\n id=\"newPassword\" type=\"password\"\r\n value={newPassword}\r\n onChange={handleNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input\r\n id=\"confirmNewPassword\" type=\"password\"\r\n value={confirmNewPassword}\r\n onChange={handleConfirmNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Password has been changed\"} bodyMessage={\"You can now sign in using your new password\"} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\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\\\\project\\\\projectInfo\\\\ProjectInfo.js\";\nimport React from 'react';\nimport \"./ProjectInfo.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport ActivityChart from './activityChart/ActivityChart';\nimport ActivitiesDisplay from './activitiesDisplay/ActivitiesDisplay';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ProjectInfo = () => {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"page-content-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"projectInformationPage-content-header\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"header-text\",\n children: /*#__PURE__*/_jsxDEV(\"h2\", {\n className: \"projectInformationPage-title\",\n children: \"ReactApp > Activity Dashboard\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"header-project-buttons\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"users\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 17,\n columnNumber: 13\n }, this), \"\\xA0Members\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"cog\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 13\n }, this), \"\\xA0Settings\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 21,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 15,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 11,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"dashboard-activity-container\",\n children: [/*#__PURE__*/_jsxDEV(ActivityChart, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ActivitiesDisplay, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 28,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 10,\n columnNumber: 5\n }, this);\n};\n\n_c = ProjectInfo;\nexport default ProjectInfo;\n\nvar _c;\n\n$RefreshReg$(_c, \"ProjectInfo\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/project/projectInfo/ProjectInfo.js"],"names":["React","FontAwesomeIcon","ActivityChart","ActivitiesDisplay","ProjectInfo"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,OAAO,mBAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,aAAP,MAA0B,+BAA1B;AACA,OAAOC,iBAAP,MAA8B,uCAA9B;;;AAGA,MAAMC,WAAW,GAAG,MAAM;AACxB,sBACE;AAAK,IAAA,SAAS,EAAC,wBAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,uCAAf;AAAA,8BACE;AAAK,QAAA,SAAS,EAAC,aAAf;AAAA,+BACE;AAAI,UAAA,SAAS,EAAC,8BAAd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cADF,eAIE;AAAK,QAAA,SAAS,EAAC,wBAAf;AAAA,gCACE;AAAA,kCACE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAME;AAAA,kCACE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA,gBANF;AAAA;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF,eAkBE;AAAK,MAAA,SAAS,EAAC,8BAAf;AAAA,8BACE,QAAC,aAAD;AAAA;AAAA;AAAA;AAAA,cADF,eAEE,QAAC,iBAAD;AAAA;AAAA;AAAA;AAAA,cAFF;AAAA;AAAA;AAAA;AAAA;AAAA,YAlBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAyBD,CA1BD;;KAAMA,W;AA4BN,eAAeA,WAAf","sourcesContent":["import React from 'react'\r\nimport \"./ProjectInfo.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport ActivityChart from './activityChart/ActivityChart'\r\nimport ActivitiesDisplay from './activitiesDisplay/ActivitiesDisplay'\r\n\r\n\r\nconst ProjectInfo = () => {\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"projectInformationPage-content-header\">\r\n <div className=\"header-text\">\r\n <h2 className=\"projectInformationPage-title\">ReactApp > Activity Dashboard</h2>\r\n </div>\r\n <div className=\"header-project-buttons\">\r\n <button>\r\n <FontAwesomeIcon icon=\"users\"></FontAwesomeIcon>\r\n &nbsp;Members\r\n\r\n </button>\r\n <button>\r\n <FontAwesomeIcon icon=\"cog\"></FontAwesomeIcon>\r\n &nbsp;Settings\r\n\r\n </button>\r\n </div>\r\n </div>\r\n <div className=\"dashboard-activity-container\">\r\n <ActivityChart />\r\n <ActivitiesDisplay />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ProjectInfo"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\pages\\\\account\\\\Account.js\";\n// rfce\nimport React, { useState, useEffect } from 'react';\nimport \"./Account.css\";\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\";\nimport ChangePassword from '../../components/changePassword/ChangePassword';\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\nimport UserDataInfo from '../../components/updateUserData/UserDataInfo';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nfunction Account() {\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"page-content-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content-header\",\n children: /*#__PURE__*/_jsxDEV(\"h2\", {\n className: \"welcome-text\",\n children: \"Account information\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 14,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 13,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"accountpage-content\",\n children: [/*#__PURE__*/_jsxDEV(UserDataInfo, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 18,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(ChangePassword, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(RemoveAccount, {}, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 16,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 12,\n columnNumber: 5\n }, this);\n}\n\n_c = Account;\nexport default Account;\n\nvar _c;\n\n$RefreshReg$(_c, \"Account\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/account/Account.js"],"names":["React","useState","useEffect","ConfirmRemoveAccountModal","ChangePassword","RemoveAccount","UserDataInfo","Account"],"mappings":";AAAA;AACA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,eAAP;AAEA,OAAOC,yBAAP,MAAsC,oFAAtC;AACA,OAAOC,cAAP,MAA2B,gDAA3B;AACA,OAAOC,aAAP,MAA0B,8CAA1B;AACA,OAAOC,YAAP,MAAyB,8CAAzB;;;AAEA,SAASC,OAAT,GAAmB;AACjB,sBACE;AAAK,IAAA,SAAS,EAAC,wBAAf;AAAA,4BACE;AAAK,MAAA,SAAS,EAAC,gBAAf;AAAA,6BACE;AAAI,QAAA,SAAS,EAAC,cAAd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YADF,eAIE;AAAK,MAAA,SAAS,EAAC,qBAAf;AAAA,8BAEE,QAAC,YAAD;AAAA;AAAA;AAAA;AAAA,cAFF,eAGE,QAAC,cAAD;AAAA;AAAA;AAAA;AAAA,cAHF,eAIE,QAAC,aAAD;AAAA;AAAA;AAAA;AAAA,cAJF;AAAA;AAAA;AAAA;AAAA;AAAA,YAJF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAcD;;KAfQA,O;AAiBT,eAAeA,OAAf","sourcesContent":["// rfce\r\nimport React, { useState, useEffect } from 'react'\r\nimport \"./Account.css\"\r\n\r\nimport ConfirmRemoveAccountModal from \"../../components/removeAccount/confirmRemoveAccountModal/ConfirmRemoveAccountModal\"\r\nimport ChangePassword from '../../components/changePassword/ChangePassword';\r\nimport RemoveAccount from '../../components/removeAccount/RemoveAccount';\r\nimport UserDataInfo from '../../components/updateUserData/UserDataInfo';\r\n\r\nfunction Account() {\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"welcome-text\">Account information</h2>\r\n </div>\r\n <div className=\"accountpage-content\">\r\n\r\n <UserDataInfo />\r\n <ChangePassword />\r\n <RemoveAccount />\r\n\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Account\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\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = ({\n accessToken,\n userInfo\n}) => {\n _s();\n\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: JSON.stringify({\n email: `${userInfo && userInfo.email}`,\n oldPassword: `${oldPassword}`,\n newPassword: `${newPassword}`\n })\n };\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 27,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 25,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 30,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 38,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Old password + \", userInfo.name]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 29,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 24,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"1/P+Ubwx+q9Gj6fjtSw+3K6XSt4=\");\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","FontAwesomeIcon","MessageModal","ChangePassword","accessToken","userInfo","oldPassword","setOldPassword","newPassword","setNewPassword","ChangePasswordRequestOptions","method","headers","Authorization","body","JSON","stringify","email","name"],"mappings":";;;AAAA,OAAOA,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omeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\n\r\nconst ChangePassword = ({ accessToken, userInfo }) => {\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: JSON.stringify(\r\n {\r\n email: `${userInfo && userInfo.email}`,\r\n oldPassword: `${oldPassword}`,\r\n newPassword: `${newPassword}`\r\n }\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password + {userInfo.name}\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input type=\"password\"></input>\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\r\n"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"export default {\n oidc: {\n clientId: '0oa1f4zfeiiZPB6DF5d7',\n issuer: 'https://dev-91882654.okta.com/oauth2/default',\n redirectUri: window.location.origin + '/login/callback',\n scopes: ['openid', 'profile', 'email'],\n pkce: true\n },\n serviceAPI: {\n messagesURL: 'http://localhost:3030/api/messages',\n createNewUserURL: 'http://localhost:3030/api/create-user',\n forgotPasswordURL: 'http://localhost:3030/api/recover-user-password',\n removeAccountURL: 'http://localhost:3030/api/remove-user',\n updateUserDataURL: 'http://localhost:3030/api/update-user-data',\n changePasswordURL: 'http://localhost:3030/api/change-password'\n }\n};","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/config.js"],"names":["oidc","clientId","issuer","redirectUri","window","location","origin","scopes","pkce","serviceAPI","messagesURL","createNewUserURL","forgotPasswordURL","removeAccountURL","updateUserDataURL","changePasswordURL"],"mappings":"AAAA,eAAe;AACbA,EAAAA,IAAI,EAAE;AACJC,IAAAA,QAAQ,EAAE,sBADN;AAEJC,IAAAA,MAAM,EAAE,8CAFJ;AAGJC,IAAAA,WAAW,EAAEC,MAAM,CAACC,QAAP,CAAgBC,MAAhB,GAAyB,iBAHlC;AAIJC,IAAAA,MAAM,EAAE,CAAC,QAAD,EAAW,SAAX,EAAsB,OAAtB,CAJJ;AAKJC,IAAAA,IAAI,EAAE;AALF,GADO;AAQbC,EAAAA,UAAU,EAAE;AACVC,IAAAA,WAAW,EAAE,oCADH;AAEVC,IAAAA,gBAAgB,EAAE,uCAFR;AAGVC,IAAAA,iBAAiB,EAAE,iDAHT;AAIVC,IAAAA,gBAAgB,EAAE,uCAJR;AAKVC,IAAAA,iBAAiB,EAAE,4CALT;AAMVC,IAAAA,iBAAiB,EAAE;AANT;AARC,CAAf","sourcesContent":["export default {\r\n oidc: {\r\n clientId: '0oa1f4zfeiiZPB6DF5d7',\r\n issuer: 'https://dev-91882654.okta.com/oauth2/default',\r\n redirectUri: window.location.origin + '/login/callback',\r\n scopes: ['openid', 'profile', 'email'],\r\n pkce: true\r\n },\r\n serviceAPI: {\r\n messagesURL: 'http://localhost:3030/api/messages',\r\n createNewUserURL: 'http://localhost:3030/api/create-user',\r\n forgotPasswordURL: 'http://localhost:3030/api/recover-user-password',\r\n removeAccountURL: 'http://localhost:3030/api/remove-user',\r\n updateUserDataURL: 'http://localhost:3030/api/update-user-data',\r\n changePasswordURL: 'http://localhost:3030/api/change-password'\r\n }\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\\\\team\\\\teamOverview\\\\TeamOverview.js\";\nimport React from 'react';\nimport { NavLink } from 'react-router-dom';\nimport \"./TeamOverview.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst TeamOverview = () => {\n const personalProjects = [{\n id: \"MyApp\",\n type: \"personal\"\n }, {\n id: \"MyOtherApp\",\n type: \"personal\"\n }];\n const sharedProjects = [{\n id: \"ReactApp\",\n type: \"shared\",\n teams: [{\n name: \"Henriks Meme Machine\"\n }, {\n name: \"Teskeholdet\"\n }]\n }, {\n id: \"Very big ReactApp\",\n type: \"shared\",\n teams: [{\n name: \"Aubergine\"\n }]\n }];\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"page-content-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content-header\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n className: \"teamlist-title\",\n children: \"Teams\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 21,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"buttons-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: \"join-team-button\",\n children: \"Join Team\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 23,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"create-new-team-button\",\n children: \"New team\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 26,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 22,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 20,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"teamlist\",\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"team-entry\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"image-team-name\",\n children: [/*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/HenriksMemeMachine\",\n className: \"team-image-container\",\n children: /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"team-icon\",\n icon: \"dice-d6\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 37,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 36,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/HenriksMemeMachine\",\n children: [\"Henriks meme machine - ReactApp\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"icon\",\n icon: \"chevron-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 35,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"team-status-info-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"new-messages-info\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"icon\",\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: \"0\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n className: \"tooltip-text\",\n children: \"New messages\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"projects-maintained-info\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"icon\",\n icon: \"project-diagram\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: \"0\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n className: \"tooltip-text\",\n children: \"Projects maintained\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"team-members-info\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"icon\",\n icon: \"users\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: \"0\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 19\n }, this), /*#__PURE__*/_jsxDEV(\"span\", {\n className: \"tooltip-text\",\n children: \"Team members\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 19\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 17\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"last-updated-info\",\n children: /*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Date created: \\xA021/ 07/ 2021\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 19\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 34,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 33,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 32,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 31,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 19,\n columnNumber: 5\n }, this);\n};\n\n_c = TeamOverview;\nexport default TeamOverview;\n\nvar _c;\n\n$RefreshReg$(_c, \"TeamOverview\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/team/teamOverview/TeamOverview.js"],"names":["React","NavLink","FontAwesomeIcon","TeamOverview","personalProjects","id","type","sharedProjects","teams","name"],"mappings":";AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAO,oBAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAEA,MAAMC,YAAY,GAAG,MAAM;AAEzB,QAAMC,gBAAgB,GAAG,CACvB;AAAEC,IAAAA,EAAE,EAAE,OAAN;AAAeC,IAAAA,IAAI,EAAE;AAArB,GADuB,EAEvB;AAAED,IAAAA,EAAE,EAAE,YAAN;AAAoBC,IAAAA,IAAI,EAAE;AAA1B,GAFuB,CAAzB;AAKA,QAAMC,cAAc,GAAG,CACrB;AAAEF,IAAAA,EAAE,EAAE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K,gBAAA,SAAS,EAAC,mBAAf;AAAA,uCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,sBAhBF;AAAA;AAAA;AAAA;AAAA;AAAA,oBATF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAZF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAmDD,CA/DD;;KAAMN,Y;AAiEN,eAAeA,YAAf","sourcesContent":["import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./TeamOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst TeamOverview = () => {\r\n\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"teamlist-title\">Teams</h2>\r\n <div className=\"buttons-container\">\r\n <button className=\"join-team-button\">\r\n Join Team\r\n </button>\r\n <button className=\"create-new-team-button\">\r\n New team\r\n </button>\r\n </div>\r\n </div>\r\n <div className=\"teamlist\">\r\n <ul>\r\n <li>\r\n <div className=\"team-entry\">\r\n <div className=\"image-team-name\">\r\n <NavLink to=\"/HenriksMemeMachine\" className=\"team-image-container\">\r\n <FontAwesomeIcon className=\"team-icon\" icon=\"dice-d6\"></FontAwesomeIcon>\r\n </NavLink>\r\n <NavLink to=\"/HenriksMemeMachine\">Henriks meme machine - ReactApp&nbsp;\r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"team-status-info-container\">\r\n <div className=\"new-messages-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"envelope\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">New messages</span>\r\n </div>\r\n <div className=\"projects-maintained-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"project-diagram\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Projects maintained</span>\r\n </div>\r\n <div className=\"team-members-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"users\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Team members</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Date created: &nbsp;21/ 07/ 2021</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default TeamOverview"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\changePassword\\\\ChangePassword.js\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport MessageModal from '../messageModal/MessageModal';\nimport config from '../../config';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst ChangePassword = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const accessToken = oktaAuth.getAccessToken();\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\n const [userInfo, setUserInfo] = useState(null);\n const [oldPassword, setOldPassword] = useState(null);\n const [newPassword, setNewPassword] = useState(null);\n const [confirmNewPassword, setConfirmNewPassword] = useState(null);\n useEffect(() => {\n if (!authState.isAuthenticated) {\n // When user isn't authenticated, forget any user info\n setUserInfo(null);\n } else {\n oktaAuth.getUser().then(info => {\n setUserInfo(info);\n });\n }\n }, [authState, oktaAuth]); // Update if authState changes\n\n const handleOldPasswordChange = e => {\n setOldPassword(e.target.value);\n };\n\n const handleNewPasswordChange = e => {\n setNewPassword(e.target.value);\n };\n\n const handleConfirmNewPasswordChange = e => {\n setConfirmNewPassword(e.target.value);\n };\n\n const userInputData = JSON.stringify({\n email: `${userInfo && userInfo.email}`,\n newPassword: `${newPassword}`\n });\n const ChangePasswordRequestOptions = {\n method: 'PUT',\n headers: {\n Authorization: `Bearer ${accessToken}`\n },\n body: userInputData\n };\n\n const handleChangePasswordFormSubmit = e => {\n e.preventDefault();\n\n if (!oldPassword || !newPassword || !confirmNewPassword) {\n window.alert(\"A password field is blank\");\n return;\n }\n\n if (!(confirmNewPassword.length >= 7)) {\n window.alert(\"Password must consist of 8 characters or more\");\n return;\n }\n\n if (!(newPassword == confirmNewPassword)) {\n window.alert(\"Passwords do not match\");\n return;\n } else {\n window.alert(userInfo.email); // fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions)\n // .then((res) => {\n // if (!res.ok) {\n // window.alert(\"Old password is not correct\")\n // Promise.reject(\"\")\n // return\n // }\n // if (res.ok) {\n // setSubmitOkMessageModalState(true)\n // setOldPassword('')\n // setNewPassword('')\n // setConfirmNewPassword('')\n // }\n // })\n }\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"change-password-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"container-header\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"lock\",\n className: \"lock-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Change password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Password requirements:\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: \"At least 8 characters \"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"No parts of username may be included\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: \"Your password cannot be any of the last 4 passwords\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleChangePasswordFormSubmit,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"reset-password-form-container\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Old password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"oldPassword\",\n type: \"password\",\n value: oldPassword,\n onChange: handleOldPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"New password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"newPassword\",\n type: \"password\",\n value: newPassword,\n onChange: handleNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 120,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: \"Confirm new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 130,\n columnNumber: 15\n }, this), /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"confirmNewPassword\",\n type: \"password\",\n value: confirmNewPassword,\n onChange: handleConfirmNewPasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 129,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"form-item\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"passwordResetSubmitButton\",\n type: \"submit\",\n children: [\"Submit\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"arrow-right\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 141,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 139,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 138,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 96,\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: \"Password has been changed\",\n bodyMessage: \"You can now sign in using your new password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 148,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 147,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 5\n }, this);\n};\n\n_s(ChangePassword, \"Xnl+NTauGVDCVlSJN6leYUI37T8=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = ChangePassword;\nexport default ChangePassword;\n\nvar _c;\n\n$RefreshReg$(_c, \"ChangePassword\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/changePassword/ChangePassword.js"],"names":["React","useState","useEffect","useOktaAuth","FontAwesomeIcon","MessageModal","config","ChangePassword","authState","oktaAuth","accessToken","getAccessToken","submitOkMessageModalState","setSubmitOkMessageModalState","userInfo","setUserInfo","oldPassword","setOldPassword","newPassword","setNewPassword","confirmNewPassword","setConfirmNewPassword","isAuthenticated","getUser","then","info","handleOldPasswordChange","e","target","value","handleNewPasswordChange","handleConfirmNewPasswordChange","userInputData","JSON","stringify","email","ChangePasswordRequestOptions","method","headers","Authorization","body","handleChangePasswordFormSubmit","preventDefault","window","alert","length"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAOC,YAAP,MAAyB,8BAAzB;AACA,OAAOC,MAAP,MAAmB,cAAnB;;;AAEA,MAAMC,cAAc,GAAG,MAAM;AAAA;;AAC3B,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BN,WAAW,EAA3C;AACA,QAAMO,WAAW,G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,IAAI,EAAC,QAAnD;AAAA,oDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBA5BF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAbF;AAAA;AAAA;AAAA;AAAA;AAAA,YALF,eAwDE;AAAK,MAAA,SAAS,EAAG,SAAQnB,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,2BAArF;AAAkH,QAAA,WAAW,EAAE;AAA/H;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAxDF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA8DD,CAjJD;;GAAMN,c;UAC4BJ,W;;;KAD5BI,c;AAmJN,eAAeA,cAAf","sourcesContent":["import React, { useState, useEffect } from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport MessageModal from '../messageModal/MessageModal'\r\nimport config from '../../config';\r\n\r\nconst ChangePassword = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const accessToken = oktaAuth.getAccessToken();\r\n const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);\r\n\r\n const [userInfo, setUserInfo] = useState(null);\r\n const [oldPassword, setOldPassword] = useState(null)\r\n const [newPassword, setNewPassword] = useState(null)\r\n const [confirmNewPassword, setConfirmNewPassword] = useState(null)\r\n\r\n useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const handleOldPasswordChange = (e) => {\r\n setOldPassword(e.target.value)\r\n }\r\n\r\n const handleNewPasswordChange = (e) => {\r\n setNewPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmNewPasswordChange = (e) => {\r\n setConfirmNewPassword(e.target.value);\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${userInfo && userInfo.email}`,\r\n newPassword: `${newPassword}`\r\n })\r\n\r\n const ChangePasswordRequestOptions = {\r\n method: 'PUT',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n body: userInputData\r\n }\r\n\r\n const handleChangePasswordFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!oldPassword || !newPassword || !confirmNewPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmNewPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(newPassword == confirmNewPassword)) {\r\n window.alert(\"Passwords do not match\")\r\n return\r\n }\r\n\r\n else {\r\n window.alert(userInfo.email)\r\n // fetch(config.serviceAPI.changePasswordURL, ChangePasswordRequestOptions)\r\n // .then((res) => {\r\n // if (!res.ok) {\r\n // window.alert(\"Old password is not correct\")\r\n // Promise.reject(\"\")\r\n // return\r\n // }\r\n // if (res.ok) {\r\n // setSubmitOkMessageModalState(true)\r\n // setOldPassword('')\r\n // setNewPassword('')\r\n // setConfirmNewPassword('')\r\n // }\r\n // })\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"change-password-container\">\r\n <div className=\"container-header\">\r\n <FontAwesomeIcon icon=\"lock\" className=\"lock-icon\"></FontAwesomeIcon>\r\n <h5>Change password</h5>\r\n </div>\r\n <div className=\"content\">\r\n <p>Password requirements:</p>\r\n <ul>\r\n <li>\r\n At least 8 characters { }\r\n </li>\r\n <li>\r\n No parts of username may be included\r\n </li>\r\n <li>\r\n Your password cannot be any of the last 4 passwords\r\n </li>\r\n </ul>\r\n <form onSubmit={handleChangePasswordFormSubmit}>\r\n <div className=\"reset-password-form-container\">\r\n <div className=\"form-item\">\r\n <label>\r\n Old password\r\n </label>\r\n <input\r\n id=\"oldPassword\" type=\"password\"\r\n value={oldPassword}\r\n onChange={handleOldPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n New password\r\n </label>\r\n <input\r\n id=\"newPassword\" type=\"password\"\r\n value={newPassword}\r\n onChange={handleNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <label>\r\n Confirm new password\r\n </label>\r\n <input\r\n id=\"confirmNewPassword\" type=\"password\"\r\n value={confirmNewPassword}\r\n onChange={handleConfirmNewPasswordChange} />\r\n </div>\r\n <div className=\"form-item\">\r\n <button className=\"passwordResetSubmitButton\" type=\"submit\">\r\n Submit&nbsp;\r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </div>\r\n </form>\r\n </div>\r\n <div className={`modal ${submitOkMessageModalState ? \"active\" : \"inactive\"}`}>\r\n <MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={\"Password has been changed\"} bodyMessage={\"You can now sign in using your new password\"} />\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ChangePassword\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