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

added redirect to sign-in page modal box after sign up

parent 6c88edc5
This diff is collapsed.
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useInput } from '../../../util/useInput';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\");\n return Promise.reject();\n }\n\n return res.json();\n }).then(() => {\n oktaAuth.signInWithCredentials({\n email,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n });\n };\n\n const handleFirstNameChange = e => {\n setFirstName(e.target.value);\n };\n\n const handleLastNameChange = e => {\n setLastName(e.target.value);\n };\n\n const handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\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: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\"\n }, void 0, false, {\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), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 97,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 107,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"8+72sMg80FVNhxNijJ4F05o0QkM=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useOktaAuth","FontAwesomeIcon","useInput","NavLink","config","SignUp","authState","oktaAuth","sessionToken","setSessionToken","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","json","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,QAAT,QAAyB,wBAAzB;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BP,WAAW,EAA3C;AACA,QAAM,CAACQ,YAAD,EAAeC,eAAf,IAAkCX,QAAQ,EAAhD;AACA,QAAM,CAACY,SAAD,EAAYC,YAAZ,IAA4Bb,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACc,QAAD,EAAWC,WAAX,IAA0Bf,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAAC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ALF,eAUE;AAAA,4CAEE;AACE,YAAA,IAAI,EAAC;AADP;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAVF,eAeE;AAAA,+CAEE;AACE,YAAA,IAAI,EAAC;AADP;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF,eAoBE;AAAO,UAAA,SAAS,EAAC,uBAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBApBF,eAuBE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAvBF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eA8BE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cA9BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgDD,CA1GD;;GAAMtB,M;UAC4BL,W;;;KAD5BK,M;AA4GN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useInput } from '../../../util/useInput'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\")\r\n return Promise.reject();\r\n }\r\n return res.json();\r\n }).then(() => {\r\n oktaAuth.signInWithCredentials({ email, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n })\r\n }\r\n\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\r\n <label>\r\n First name:\r\n <input type=\"text\" />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n type=\"text\" />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n type=\"text\" />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n type=\"password\" />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useInput } from '../../../util/useInput';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n value: firstName,\n bind: bindFirstName,\n reset: resetFirstName\n } = useInput('');\n const {\n value: lastName,\n bind: bindLastName,\n reset: resetLastName\n } = useInput('');\n const {\n value: email,\n bind: bindEmail,\n reset: resetEmail\n } = useInput('');\n const {\n value: password,\n bind: bindPassword,\n reset: resetPassword\n } = useInput('');\n\n const handleSubmit = e => {\n e.preventDefault(); //alert(`Submitting user ${firstName} ${lastName} ${email} ${password}`);\n\n fetch(config.serviceAPI.createNewUserURL, {\n method: 'POST',\n body: {\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n }\n }).then(response => {\n if (!response.ok) {\n return Promise.reject();\n }\n\n return response.json();\n });\n resetFirstName();\n resetLastName();\n resetEmail();\n resetPassword();\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Fist name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindFirstName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindLastName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindEmail\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\",\n ...bindPassword\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\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: 39,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"qBcPMosoFn1+k0tawoNFrCnYMDg=\", false, function () {\n return [useInput, useInput, useInput, useInput];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useInput","NavLink","config","SignUp","value","firstName","bind","bindFirstName","reset","resetFirstName","lastName","bindLastName","resetLastName","email","bindEmail","resetEmail","password","bindPassword","resetPassword","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","method","body","FirstName","LastName","Email","then","response","ok","Promise","reject","json"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,QAAT,QAAyB,wBAAzB;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,KAAK,EAAEC,SAAT;AAAoBC,IAAAA,IAAI,EAAEC,aAA1B;AAAyCC,IAAAA,KAAK,EAAEC;AAAhD,MAAmET,QAAQ,CAAC,EAAD,CAAjF;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAEM,QAAT;AAAmBJ,IAAAA,IAAI,EAAEK,YAAzB;AAAuCH,IAAAA,KAAK,EAAEI;AAA9C,MAAgEZ,QAAQ,CAAC,EAAD,CAA9E;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAES,KAAT;AAAgBP,IAAAA,IAAI,EAAEQ,SAAtB;AAAiCN,IAAAA,KAAK,EAAEO;AAAxC,MAAuDf,QAAQ,CAAC,EAAD,CAArE;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAEY,QAAT;AAAmBV,IAAAA,IAAI,EAAEW,YAAzB;AAAuCT,IAAAA,KAAK,EAAEU;AAA9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AA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAKE;AAAA,gDAEE;AACE,YAAA,IAAI,EAAC,MADP;AAAA,eACkBI;AADlB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF,eAUE;AAAA,4CAEE;AACE,YAAA,IAAI,EAAC,MADP;AAAA,eACkBG;AADlB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAVF,eAeE;AAAA,+CAEE;AACE,YAAA,IAAI,EAAC,UADP;AAAA,eACsBG;AADtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF,eAoBE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBApBF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eA2BE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cA3BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA6CD,CA3ED;;GAAMd,M;UACqEH,Q,EACHA,Q,EACTA,Q,EACSA,Q;;;KAJlEG,M;AA6EN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect } from 'react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useInput } from '../../../util/useInput'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { value: firstName, bind: bindFirstName, reset: resetFirstName } = useInput('')\r\n const { value: lastName, bind: bindLastName, reset: resetLastName } = useInput('')\r\n const { value: email, bind: bindEmail, reset: resetEmail } = useInput('')\r\n const { value: password, bind: bindPassword, reset: resetPassword } = useInput('')\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n //alert(`Submitting user ${firstName} ${lastName} ${email} ${password}`);\r\n fetch(config.serviceAPI.createNewUserURL, {\r\n method: 'POST',\r\n body: {\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n },\r\n })\r\n .then((response) => {\r\n if (!response.ok) {\r\n return Promise.reject();\r\n }\r\n return response.json();\r\n })\r\n resetFirstName()\r\n resetLastName()\r\n resetEmail()\r\n resetPassword()\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\r\n <label>\r\n Fist name:\r\n <input type=\"text\" {...bindFirstName} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n type=\"text\" {...bindLastName} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n type=\"text\" {...bindEmail} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n type=\"password\" {...bindPassword} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useInput } from '../../../util/useInput';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n value: firstName,\n bind: bindFirstName,\n reset: resetFirstName\n } = useInput('');\n const {\n value: lastName,\n bind: bindLastName,\n reset: resetLastName\n } = useInput('');\n const {\n value: email,\n bind: bindEmail,\n reset: resetEmail\n } = useInput('');\n const {\n value: password,\n bind: bindPassword,\n reset: resetPassword\n } = useInput('');\n const user = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: user\n }).then(response => {\n if (!response.ok) {\n return Promise.reject();\n }\n\n return response.json();\n });\n alert(`Submitting user `);\n resetFirstName();\n resetLastName();\n resetEmail();\n resetPassword();\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Fist name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindFirstName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindLastName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindEmail\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\",\n ...bindPassword\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"qBcPMosoFn1+k0tawoNFrCnYMDg=\", false, function () {\n return [useInput, useInput, useInput, useInput];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","FontAwesomeIcon","useInput","NavLink","config","SignUp","value","firstName","bind","bindFirstName","reset","resetFirstName","lastName","bindLastName","resetLastName","email","bindEmail","resetEmail","password","bindPassword","resetPassword","user","JSON","stringify","FirstName","LastName","Email","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","method","headers","body","then","response","ok","Promise","reject","json","alert"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,QAAT,QAAyB,wBAAzB;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,KAAK,EAAEC,SAAT;AAAoBC,IAAAA,IAAI,EAAEC,aAA1B;AAAyCC,IAAAA,KAAK,EAAEC;AAAhD,MAAmET,QAAQ,CAAC,EAAD,CAAjF;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAEM,QAAT;AAAmBJ,IAAAA,IAAI,EAAEK,YAAzB;AAAuCH,IAAAA,KAAK,EAAEI;AAA9C,MAAgEZ,QAAQ,CAAC,EAAD,CAA9E;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAES,KAAT;AAAgBP,IAAAA,IAAI,EAAEQ,SAAtB;AAAiCN,IAAAA,KAAK,EAAEO;AAAxC,MAAuDf,QAAQ,CAAC,EAAD,CAArE;AACA,QAAM;AAAEI,IAAAA,KAAK,EAAEY,QAAT;AAAmBV,IAAAA,IAAI,EAAEW,YAAzB;AAAuCT,IAAAA,KAAK,EAAEU;AAA9C,MAAgElB,QAAQ,CAAC,EAAD,CAA9E;AAEA,QAAMmB,IAAI,GAAGC,IAAI,CAACC,SAAL,CAAe;AAC1BC,IAAAA,SAAS,EAAG,GAAEjB,SAAU,EADE;AAE1BkB,IAAAA,QAAQ,EAAG,GAAEb,QAAS,EAFI;AAG1Bc,IAAAA,KAAK,EAAG,GAAEX,KAAM,EAHU;AAI1B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AA,IAAI,EAAC,MADP;AAAA,eACkBI;AADlB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF,eAUE;AAAA,4CAEE;AACE,YAAA,IAAI,EAAC,MADP;AAAA,eACkBG;AADlB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAVF,eAeE;AAAA,+CAEE;AACE,YAAA,IAAI,EAAC,UADP;AAAA,eACsBG;AADtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF,eAoBE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBApBF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eA2BE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cA3BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA6CD,CA9ED;;GAAMd,M;UACqEH,Q,EACHA,Q,EACTA,Q,EACSA,Q;;;KAJlEG,M;AAgFN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect } from 'react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useInput } from '../../../util/useInput'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { value: firstName, bind: bindFirstName, reset: resetFirstName } = useInput('')\r\n const { value: lastName, bind: bindLastName, reset: resetLastName } = useInput('')\r\n const { value: email, bind: bindEmail, reset: resetEmail } = useInput('')\r\n const { value: password, bind: bindPassword, reset: resetPassword } = useInput('')\r\n\r\n const user = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n fetch(config.serviceAPI.createNewUserURL, {\r\n method: 'POST',\r\n headers: { 'Content-Type': 'application/json' },\r\n body: user,\r\n })\r\n .then((response) => {\r\n if (!response.ok) {\r\n return Promise.reject();\r\n }\r\n return response.json();\r\n })\r\n alert(`Submitting user `);\r\n resetFirstName()\r\n resetLastName()\r\n resetEmail()\r\n resetPassword()\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\r\n <label>\r\n Fist name:\r\n <input type=\"text\" {...bindFirstName} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n type=\"text\" {...bindLastName} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n type=\"text\" {...bindEmail} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n type=\"password\" {...bindPassword} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [modalState, showModal] = useState('false');\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n const setModalVisible = () => {\n showModal(true);\n };\n\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n window.alert(\"Success! User created. Please log in\");\n });\n };\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 handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n id: \"myModal\",\n className: `modal ${modalState ? \"active\" : null}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: [/*#__PURE__*/_jsxDEV(\"span\", {\n className: \"close\",\n children: \"\\xD7\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Some text in the Modal..\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\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: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 87,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 11\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: 94,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"+og3Wwp2PmWA33zjre1FujAOrLU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","modalState","showModal","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","setModalVisible","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AA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hCF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAuCE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAvCF;AAAA;AAAA;AAAA;AAAA;AAAA,YAjBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAmED,CA3HD;;GAAM1C,M;UACiBJ,W;;;KADjBI,M;AA6HN,eAAeA,MAAf","sourcesContent":["import React, { useState } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n const [modalState, showModal] = useState('false')\r\n\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const setModalVisible = () => {\r\n showModal(true)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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 window.alert(\"Success! User created. Please log in\")\r\n })\r\n }\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div id=\"myModal\" className={`modal ${modalState ? \"active\" : null}`}>\r\n\r\n {/* Modal content */}\r\n <div className=\"modal-content\">\r\n <span className=\"close\">&times;</span>\r\n <p>Some text in the Modal..</p>\r\n </div>\r\n\r\n </div>\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [modalState, showModal] = useState(false);\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n const setModalVisible = () => {\n showModal(!modalState);\n };\n\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n if (res.ok) {\n setModalVisible();\n }\n });\n };\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 handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${modalState ? \"active\" : null}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: [\"Account successfully created\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"check-icon\",\n icon: \"check\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signin\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n children: [\"Sign in\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-in-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 72,\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: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 97,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 11\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: 104,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 123,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 128,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 126,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 133,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 132,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 131,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"bJFRYNtgUPA8mKGuzi/D2Xd2R8U=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","modalState","showModal","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","setModalVisible","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA;AAAF,MAAeL,WAAW,EAAhC;AACA,QAAM,CAACM,YAAD,EAAeC,eAAf,IAAkCR,QAAQ,EAAhD;AACA,QAAM,CAACS,UAAD,EAAaC,SAAb,IAA0BV,QAAQ,CAAC,KAAD,CAAxC;AAEA,QAAM,CAACW,SAAD,EAAYC,YAAZ,IAA4BZ,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACe,KAAD,EAAQC,QAAR,IAAoBhB,QAAQ,CAAC,EAAD,CAAlC;AACA,QAAM,CAACiB,QAAD,EAAWC,WAAX,IAA0BlB,QAAQ,CAAC,EAAD,CAAxC;;AAEA,QAAMmB,eAAe,GAAG,MAAM;AAC5BT,IAAAA,SAAS,CAAC,CAACD,UAAF,CAAT;AACD,GAFD;;AAIA,QAAMW,aAAa,GAAGC,IAAI,CAACC,SAAL,CAAe;AACnCC,IAAAA,SAAS,EAAG,GAAEZ,SAAU,EADW;AAEnCa,IAAAA,QAAQ,EAAG,GAAEX,QAAS,EAFa;AAGnCY,IAAAA,KAAK,EAAG,GAAEV,KAAM,EAHmB;AAInCE,IAAAA,QAAQ,EAAG,GAAEA,QAAS;AAJa,GAAf,CAAtB;AAOA,QAAMS,cAAc,GAAG;AACrBC,IAAAA,MAAM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AI,EAAC,MADlB;AAEE,YAAA,KAAK,EAAE9B,KAFT;AAGE,YAAA,QAAQ,EAAE+B;AAHZ;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAfF,eAsBE;AAAA,+CAEE;AACE,YAAA,EAAE,EAAC,UADL;AACgB,YAAA,IAAI,EAAC,UADrB;AAEE,YAAA,KAAK,EAAE7B,QAFT;AAGE,YAAA,QAAQ,EAAE8B;AAHZ;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAtBF,eA6BE;AAAO,UAAA,SAAS,EAAC,uBAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBA7BF,eAgCE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAhCF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAuCE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAvCF;AAAA;AAAA;AAAA;AAAA;AAAA,YAzBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA2ED,CArID;;GAAM1C,M;UACiBJ,W;;;KADjBI,M;AAuIN,eAAeA,MAAf","sourcesContent":["import React, { useState } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n const [modalState, showModal] = useState(false)\r\n\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const setModalVisible = () => {\r\n showModal(!modalState)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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 setModalVisible()\r\n }\r\n })\r\n }\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div className={`modal ${modalState ? \"active\" : null}`}>\r\n\r\n {/* Modal content */}\r\n <div className=\"modal-content\">\r\n <p>\r\n Account successfully created&nbsp;\r\n <FontAwesomeIcon className=\"check-icon\" icon=\"check\"></FontAwesomeIcon>\r\n </p>\r\n <NavLink to=\"/signin\">\r\n <button className=\"formSubmitButton\">\r\n Sign in&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"sign-in-alt\"></FontAwesomeIcon>\r\n </button>\r\n </NavLink>\r\n </div>\r\n\r\n </div>\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\");\n return Promise.reject();\n }\n\n return res.json();\n }).then(() => {\n oktaAuth.signInWithCredentials({\n email,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n });\n };\n\n const handleFirstNameChange = e => {\n setFirstName(e.target.value);\n };\n\n const handleLastNameChange = e => {\n setLastName(e.target.value);\n };\n\n const handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 81,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 99,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 106,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 104,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"8+72sMg80FVNhxNijJ4F05o0QkM=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","authState","oktaAuth","sessionToken","setSessionToken","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","json","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BN,WAAW,EAA3C;AACA,QAAM,CAACO,YAAD,EAAeC,eAAf,IAAkCV,QAAQ,EAAhD;AACA,QAAM,CAACW,SAAD,EAAYC,YAAZ,IAA4BZ,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACe,KAAD,EAAQC,QAAR,IAAoBhB,QAAQ,CAAC,EAAD,CAAlC;AACA,QAAM,CAACiB,QAAD,EAAWC,WAAX,IAA0BlB,QAAQ,CAAC,EAAD,CAAxC;AAEA,QAAMmB,aAAa,GAAGC,IAAI,CAACC,SAAL,CAAe;AACnCC,IAAAA,SAAS,EAAG,GAAEX,SAAU,EADW;AAEnCY,IAAAA,QAAQ,EAAG,GAAEV,QAAS,EAFa;AAGnCW,IAAAA,KAAK,EAAG,GAAET,KAAM,EAHmB;AAInCE,IAAAA,QAAQ,EAAG,GAAEA,QAAS;AAJa,GAAf,CAAtB;AAOA,QAAMQ,cAAc,GAAG;AACrBC,IAAAA,MAAM,EAAE,MADa;AAErBC,IAAAA,IAAI,EAAER;AAFe,GAAvB;;AAKA,QAAMS,YAAY,GAAIC,CAAD,IAAO;AAC1BA,IAAAA,CAAC,CAACC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,cAFF,eA8BE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cA9BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgDD,CA1GD;;GAAMtB,M;UAC4BJ,W;;;KAD5BI,M;AA4GN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\")\r\n return Promise.reject();\r\n }\r\n return res.json();\r\n }).then(() => {\r\n oktaAuth.signInWithCredentials({ email, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n })\r\n }\r\n\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\r\n <label>\r\n First name:\r\n <input type=\"text\" />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n type=\"text\" />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n type=\"text\" />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n type=\"password\" />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n window.alert(\"Success! User created. Please log in\");\n });\n };\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 handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n id: \"myModal\",\n class: \"modal\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n class: \"modal-content\",\n children: [/*#__PURE__*/_jsxDEV(\"span\", {\n class: \"close\",\n children: \"\\xD7\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"p\", {\n children: \"Some text in the Modal..\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 82,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 11\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: 89,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"lcehhjU7t8J+ac9BclotCfGLhRY=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA;AAAF,MAAeL,WAAW,EAAhC;AACA,QAAM,CAACM,YAAD,EAAeC,eAAf,IAAkCR,QAAQ,EAAhD;AAEA,QAAM,CAACS,SAAD,EAAYC,YAAZ,IAA4BV,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACW,QAAD,EAAWC,WAAX,IAA0BZ,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACa,KAAD,EAAQC,QAAR,IAAoBd,QAAQ,CAAC,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Icon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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 window.alert(\"Success! User created. Please log in\")\r\n })\r\n }\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div id=\"myModal\" class=\"modal\">\r\n\r\n {/* Modal content */}\r\n <div class=\"modal-content\">\r\n <span class=\"close\">&times;</span>\r\n <p>Some text in the Modal..</p>\r\n </div>\r\n\r\n </div>\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"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\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n\n const logout = () => {\n sessionStorage.clear;\n oktaAuth.signOut();\n };\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n href: \"./\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Account\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n href: \"./\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sliders-h\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Preferences\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 47,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 46,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 40,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 39,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"K/H+pngTJ7UqSrk/MkDOYkpAmdU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","logout","sessionStorage","clear","signOut"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YAAY,GAAG,MAAM;AAAA;;AACzB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AAEA,QAAMK,WAAW,GAAGT,MAAM,CAAC,IAAD,CAA1B;AACA,QAAM,CAACU,QAAD,EAAWC,WAAX,IAA0BV,QAAQ,CAAC,KAAD,CAAxC;;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AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CApED;;GAAMf,Y;UAC4BF,W;;;KAD5BE,Y;AAsEN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\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 }, [isActive]);\r\n\r\n const logout = () => {\r\n sessionStorage.clear\r\n oktaAuth.signOut()\r\n }\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon>&nbsp;&nbsp;Account\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n return Promise.reject();\n }\n\n return res.json();\n }).then(e => {\n e.preventDefault();\n oktaAuth.signInWithCredentials({\n email,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n });\n };\n\n const handleFirstNameChange = e => {\n setFirstName(e.target.value);\n };\n\n const handleLastNameChange = e => {\n setLastName(e.target.value);\n };\n\n const handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 82,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 11\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: 89,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 96,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 103,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 101,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 111,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 118,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"lcehhjU7t8J+ac9BclotCfGLhRY=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","json","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";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AAA;AAAA,gBA7BF,eAgCE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAhCF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAuCE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAvCF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAyDD,CAtHD;;GAAM/C,M;UACiBJ,W;;;KADjBI,M;AAwHN,eAAeA,MAAf","sourcesContent":["import React, { useState } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n return Promise.reject();\r\n }\r\n return res.json()\r\n }).then((e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ email, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n })\r\n }\r\n\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _s = $RefreshSig$();\n\nimport { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport config from \"../config\";\n\nconst useMessages = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [messages, setMessages] = useState(null);\n const [messageFetchFailed, setMessageFetchFailed] = useState(false); // fetch messages\n\n useEffect(() => {\n if (authState && authState.isAuthenticated) {\n const accessToken = oktaAuth.getAccessToken();\n fetch(config.serviceAPI.messagesURL, {\n method: 'GET',\n headers: {\n Authorization: `Bearer ${accessToken}`\n }\n }).then(response => {\n if (!response.ok) {\n return Promise.reject();\n }\n\n return response.json();\n }).then(data => {\n let index = 0;\n const formattedMessages = data.messages.map(message => {\n const date = new Date(message.date);\n const day = date.toLocaleDateString();\n const time = date.toLocaleTimeString();\n index += 1;\n return {\n date: `${day} ${time}`,\n sender: message.sender,\n text: message.text,\n id: `message-${index}`\n };\n });\n setMessages(formattedMessages);\n setMessageFetchFailed(false);\n }).catch(err => {\n setMessageFetchFailed(true);\n /* eslint-disable no-console */\n\n console.error(err);\n });\n }\n }, [authState]);\n return messages;\n};\n\n_s(useMessages, \"U3xiPl25FsmufxeRxpFVBz8Cguw=\", false, function () {\n return [useOktaAuth];\n});\n\nexport default useMessages;","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/util/useMessages.jsx"],"names":["useState","useEffect","useOktaAuth","config","useMessages","authState","oktaAuth","messages","setMessages","messageFetchFailed","setMessageFetchFailed","isAuthenticated","accessToken","getAccessToken","fetch","serviceAPI","messagesURL","method","headers","Authorization","then","response","ok","Promise","reject","json","data","index","formattedMessages","map","message","date","Date","day","toLocaleDateString","time","toLocaleTimeString","sender","text","id","catch","err","console","error"],"mappings":";;AAAA,SAASA,QAAT,EAAmBC,SAAnB,QAAoC,OAApC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AAEA,OAAOC,MAAP,MAAmB,WAAnB;;AAEA,MAAMC,WAAW,GAAG,MAAM;AAAA;;AACxB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BJ,WAAW,EAA3C;AACA,QAAM,CAACK,QAAD,EAAWC,WAAX,IAA0BR,QAAQ,CAAC,IAAD,CAAxC;AACA,QAAM,CAACS,kBAAD,EAAqBC,qBAArB,IAA8CV,QAAQ,CAAC,KAAD,CAA5D,CAHwB,CAKxB;;AACAC,EAAAA,SAAS,CAAC,MAAM;AACd,QAAII,SAAS,IAAIA,SAAS,CAACM,eAA3B,EAA4C;AAC1C,YAAMC,WAAW,GAAGN,QAAQ,CAACO,cAAT,EAApB;AACAC,MAAAA,KAAK,CAACX,MAAM,CAACY,UAAP,CAAkBC,WAAnB,EAAgC;AACnCC,QAAAA,MAAM,EAAE,KAD2B;AAEnCC,QAAAA,OAAO,EAAE;AACPC,UAAAA,aAAa,EAAG,UAASP,WAAY;AAD9B;AAF0B,OAAhC,CAAL,CAMGQ,IANH,CAMSC,QAAD,IAAc;AAClB,YAAI,CAACA,QAAQ,CAACC,EAAd,EAAkB;AAChB,iBAAOC,OAAO,CAACC,MAAR,EAAP;AACD;;AACD,eAAOH,QAAQ,CAACI,IAAT,EAAP;AACD,OAXH,EAYGL,IAZH,CAYSM,IAAD,IAAU;AACd,YAAIC,KAAK,GAAG,CAAZ;AACA,cAAMC,iBAAiB,GAAGF,IAAI,CAACnB,QAAL,CAAcsB,GAAd,CAAmBC,OAAD,IAAa;AACvD,gBAAMC,IAAI,GAAG,IAAIC,IAAJ,CAASF,OAAO,CAACC,IAAjB,CAAb;AACA,gBAAME,GAAG,GAAGF,IAAI,CAACG,kBAAL,EAAZ;AACA,gBAAMC,IAAI,GAAGJ,IAAI,CAACK,kBAAL,EAAb;AACAT,UAAAA,KAAK,IAAI,CAAT;AACA,iBAAO;AACLI,YAAAA,IAAI,EAAG,GAAEE,GAAI,IAAGE,IAAK,EADhB;AAELE,YAAAA,MAAM,EAAEP,OAAO,CAACO,MAFX;AAGLC,YAAAA,IAAI,EAAER,OAAO,CAACQ,IAHT;AAILC,YAAAA,EAAE,EAAG,WAAUZ,KAAM;AAJhB,WAAP;AAMD,SAXyB,CAA1B;AAYAnB,QAAAA,WAAW,CAACoB,iBAAD,CAAX;AACAlB,QAAAA,qBAAqB,CAAC,KAAD,CAArB;AACD,OA5BH,EA6BG8B,KA7BH,CA6BUC,GAAD,IAAS;AACd/B,QAAAA,qBAAqB,CAAC,IAAD,CAArB;AACA;;AACAgC,QAAAA,OAAO,CAACC,KAAR,CAAcF,GAAd;AACD,OAjCH;AAkCD;AACF,GAtCQ,EAsCN,CAACpC,SAAD,CAtCM,CAAT;AAwCA,SAAOE,QAAP;AACD,CA/CD;;GAAMH,W;UAC4BF,W;;;AAgDlC,eAAeE,WAAf","sourcesContent":["import { useState, useEffect } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\n\r\nimport config from \"../config\"\r\n\r\nconst useMessages = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [messages, setMessages] = useState(null);\r\n const [messageFetchFailed, setMessageFetchFailed] = useState(false);\r\n\r\n // fetch messages\r\n useEffect(() => {\r\n if (authState && authState.isAuthenticated) {\r\n const accessToken = oktaAuth.getAccessToken();\r\n fetch(config.serviceAPI.messagesURL, {\r\n method: 'GET',\r\n headers: {\r\n Authorization: `Bearer ${accessToken}`,\r\n },\r\n })\r\n .then((response) => {\r\n if (!response.ok) {\r\n return Promise.reject();\r\n }\r\n return response.json();\r\n })\r\n .then((data) => {\r\n let index = 0;\r\n const formattedMessages = data.messages.map((message) => {\r\n const date = new Date(message.date);\r\n const day = date.toLocaleDateString();\r\n const time = date.toLocaleTimeString();\r\n index += 1;\r\n return {\r\n date: `${day} ${time}`,\r\n sender: message.sender,\r\n text: message.text,\r\n id: `message-${index}`,\r\n };\r\n });\r\n setMessages(formattedMessages);\r\n setMessageFetchFailed(false);\r\n })\r\n .catch((err) => {\r\n setMessageFetchFailed(true);\r\n /* eslint-disable no-console */\r\n console.error(err);\r\n });\r\n }\r\n }, [authState]);\r\n\r\n return messages\r\n}\r\n\r\nexport default useMessages"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [modalState, showModal] = useState(true);\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n const setModalVisible = () => {\n showModal(!modalState);\n };\n\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n window.alert(\"Success! User created. Please log in\");\n });\n };\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 handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${modalState ? \"active\" : null}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: [\"Account successfully created\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"check-icon\",\n icon: \"check\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n children: [\"Go to Log in\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-in-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 83,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 89,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 93,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 11\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: 100,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 107,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 119,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 122,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 129,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 128,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 127,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"awMUcgjuCGnZ6O4+yIi8W29h+BY=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","modalState","showModal","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","setModalVisible","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA;AAAF,MAAeL,WAAW,EAAhC;AACA,QAAM,CAACM,YAAD,EAAeC,eAAf,IAAkCR,QAAQ,EAAhD;AACA,QAAM,CAACS,UAAD,EAAaC,SAAb,IAA0BV,QAAQ,CAAC,IAAD,CAAxC;AAEA,QAAM,CAACW,SAAD,EAAYC,YAAZ,IAA4BZ,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACe,KAAD,EAAQC,QAAR,IAAoBhB,QAAQ,CAAC,EAAD,CAAlC;AACA,QAAM,CAACiB,QAAD,EAAWC,WAAX,IAA0BlB,QAAQ,CAAC,EAAD,CAAxC;;AAEA,QAAMmB,eAAe,GAAG,MAAM;AAC5BT,IAAAA,SAAS,CAAC,CAACD,UAAF,CAAT;AACD,GAFD;;AAIA,QAAMW,aAAa,GAAGC,IAAI,CAACC,SAAL,CAAe;AACnCC,IAAAA,SAAS,EAAG,GAAEZ,SAAU,EADW;AAEnCa,IAAAA,QAAQ,EAAG,GA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on } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n const [modalState, showModal] = useState(true)\r\n\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const setModalVisible = () => {\r\n showModal(!modalState)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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 window.alert(\"Success! User created. Please log in\")\r\n })\r\n }\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div className={`modal ${modalState ? \"active\" : null}`}>\r\n\r\n {/* Modal content */}\r\n <div className=\"modal-content\">\r\n <p>\r\n Account successfully created&nbsp;\r\n <FontAwesomeIcon className=\"check-icon\" icon=\"check\"></FontAwesomeIcon>\r\n </p>\r\n <button className=\"formSubmitButton\">\r\n Go to Log in&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"sign-in-alt\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n\r\n </div>\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"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\\\\dropdownMenu\\\\NavbarDropdownMenu.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useRef, useState, useEffect } from 'react';\nimport { NavLink } from \"react-router-dom\";\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./NavbarDropdownMenu.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst DropdownMenu = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const dropdownRef = useRef(null);\n const [isActive, setIsActive] = useState(false);\n\n const onClick = () => setIsActive(!isActive);\n\n useEffect(() => {\n const pageClickEvent = e => {\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\n setIsActive(!isActive);\n }\n }; // If the item is active (ie open) then listen for clicks\n\n\n if (isActive) {\n window.addEventListener('click', pageClickEvent);\n }\n\n return () => {\n window.removeEventListener('click', pageClickEvent);\n };\n }, [isActive]);\n\n const logout = () => {\n sessionStorage.clear;\n }; //oktaAuth.signOut()\n\n\n return /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"navbar-user-dropdown-container\",\n children: [/*#__PURE__*/_jsxDEV(\"button\", {\n className: `user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`,\n onClick: onClick,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"user-icon\",\n icon: \"user-circle\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 44,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"down-arrow\",\n icon: \"angle-down\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 45,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 43,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n ref: dropdownRef,\n className: `user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`,\n children: /*#__PURE__*/_jsxDEV(\"ul\", {\n children: [/*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n href: \"./\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 52,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Account\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 51,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 50,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/messages\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"envelope\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Messages\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 17\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 13\n }, this), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n href: \"./\",\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sliders-h\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Preferences\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"chevron-right\",\n className: \"arrow-right-icon\"\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), /*#__PURE__*/_jsxDEV(\"li\", {\n children: /*#__PURE__*/_jsxDEV(\"a\", {\n onClick: logout,\n children: [/*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-out-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 17\n }, this), \"\\xA0\\xA0Log out\"]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 15\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 49,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 48,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 42,\n columnNumber: 7\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 41,\n columnNumber: 5\n }, this);\n};\n\n_s(DropdownMenu, \"K/H+pngTJ7UqSrk/MkDOYkpAmdU=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = DropdownMenu;\nexport default DropdownMenu;\n\nvar _c;\n\n$RefreshReg$(_c, \"DropdownMenu\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/navbar/dropdownMenu/NavbarDropdownMenu.jsx"],"names":["React","useRef","useState","useEffect","NavLink","useOktaAuth","FontAwesomeIcon","DropdownMenu","authState","oktaAuth","dropdownRef","isActive","setIsActive","onClick","pageClickEvent","e","current","contains","target","window","addEventListener","removeEventListener","logout","sessionStorage","clear"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,MAAhB,EAAwBC,QAAxB,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,0BAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;;;AAGA,MAAMC,YA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OAAO,EAAEW,MAAZ;AAAA,sCACE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,kBAnBF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cANF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CAtED;;GAAMf,Y;UAC4BF,W;;;KAD5BE,Y;AAwEN,eAAeA,YAAf","sourcesContent":["import React, { useRef, useState, useEffect } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./NavbarDropdownMenu.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\n\r\nconst DropdownMenu = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n const dropdownRef = useRef(null);\r\n const [isActive, setIsActive] = useState(false);\r\n const onClick = () => setIsActive(!isActive);\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (dropdownRef.current !== null && !dropdownRef.current.contains(e.target)) {\r\n setIsActive(!isActive);\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (isActive) {\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 }, [isActive]);\r\n\r\n const logout = () => {\r\n sessionStorage.clear\r\n }\r\n\r\n\r\n //oktaAuth.signOut()\r\n\r\n return (\r\n <li>\r\n <div className=\"navbar-user-dropdown-container\">\r\n <button className={`user-dropdown-menu-toggle-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"user-icon\" icon=\"user-circle\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n {/* show submenu?*/}\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon>&nbsp;&nbsp;Account\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\">\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>&nbsp;&nbsp;Messages\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <a href=\"./\">\r\n <FontAwesomeIcon icon=\"sliders-h\"></FontAwesomeIcon>&nbsp;&nbsp;Preferences\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n <li>\r\n <a onClick={logout}>\r\n <FontAwesomeIcon icon=\"sign-out-alt\"></FontAwesomeIcon>&nbsp;&nbsp;Log out\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n </li >\r\n )\r\n}\r\n\r\nexport default DropdownMenu"]},"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 }\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"],"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;AAFR;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 }\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\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useInput } from '../../../util/useInput';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const {\n value: firstName,\n bind: bindFirstName,\n reset: resetFirstName\n } = useInput('');\n const {\n value: lastName,\n bind: bindLastName,\n reset: resetLastName\n } = useInput('');\n const {\n value: email,\n bind: bindEmail,\n reset: resetEmail\n } = useInput('');\n const {\n value: password,\n bind: bindPassword,\n reset: resetPassword\n } = useInput('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error: password requirements not met\");\n resetPassword();\n return Promise.reject();\n } //return res.json();\n\n\n signIn();\n });\n };\n\n const signIn = () => {\n oktaAuth.signInWithCredentials({\n email,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 59,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 60,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 58,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 64,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindFirstName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 66,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindLastName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindEmail\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\",\n ...bindPassword\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 80,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 88,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 94,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"YX/VVurzDITDKg0+LpqBEsDZtmE=\", false, function () {\n return [useOktaAuth, useInput, useInput, useInput, useInput];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useOktaAuth","FontAwesomeIcon","useInput","NavLink","config","SignUp","authState","oktaAuth","sessionToken","setSessionToken","value","firstName","bind","bindFirstName","reset","resetFirstName","lastName","bindLastName","resetLastName","email","bindEmail","resetEmail","password","bindPassword","resetPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","signIn","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log"],"mappings":";;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;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cA9BF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAgDD,CA9FD;;GAAMlB,M;UAC4BL,W,EAEyCE,Q,EACHA,Q,EACTA,Q,EACSA,Q;;;KANlEG,M;AAgGN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useInput } from '../../../util/useInput'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n const { value: firstName, bind: bindFirstName, reset: resetFirstName } = useInput('')\r\n const { value: lastName, bind: bindLastName, reset: resetLastName } = useInput('')\r\n const { value: email, bind: bindEmail, reset: resetEmail } = useInput('')\r\n const { value: password, bind: bindPassword, reset: resetPassword } = useInput('')\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error: password requirements not met\")\r\n resetPassword()\r\n return Promise.reject();\r\n }\r\n //return res.json();\r\n signIn()\r\n })\r\n }\r\n\r\n const signIn = () => {\r\n oktaAuth.signInWithCredentials({ email, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\r\n <label>\r\n First name:\r\n <input type=\"text\" {...bindFirstName} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n type=\"text\" {...bindLastName} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n type=\"text\" {...bindEmail} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n type=\"password\" {...bindPassword} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n return Promise.reject();\n }\n }).then(e => {\n e.preventDefault();\n oktaAuth.signInWithCredentials({\n email,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n });\n };\n\n const handleFirstNameChange = e => {\n setFirstName(e.target.value);\n };\n\n const handleLastNameChange = e => {\n setLastName(e.target.value);\n };\n\n const handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 81,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 11\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: 88,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 95,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 102,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 107,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 112,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 117,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"lcehhjU7t8J+ac9BclotCfGLhRY=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA;AAAF,MAAeL,WAAW,EAAhC;AACA,QAAM,CAACM,YAAD,EAAeC,eAAf,IAAkCR,QAAQ,EAAhD;AAEA,QAAM,CAACS,SAAD,EAAYC,YAAZ,IAA4BV,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACW,QAAD,EAAWC,WAAX,IAA0BZ,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACa,KAAD,EAAQC,QAAR,IAAoBd,QAAQ,CAAC,EAAD,CAAlC;AACA,QAAM,CAACe,QAAD,EAAWC,WAAX,IAA0BhB,QAAQ,CAAC,EAAD,CAAxC;AAEA,QAAMiB,aAAa,GAAGC,IAAI,CAACC,SAAL,CAAe;AACnCC,IAAAA,SAAS,EAAG,GAAEX,SAAU,EADW;AAEnCY,IAAAA,QAAQ,EAAG,GAAEV,QAAS,EAFa;AAGnCW,IAAAA,KAAK,EAAG,GAAET,KAAM,EAHmB;AAInCE,IAAAA,QAAQ,EAAG,GAAEA,QAAS;AAJa,GAAf,CAAtB;AAOA,QAAMQ,cAAc,GAAG;AACrBC,IAAAA,MAAM,EAAE,MADa;AAErBC,IAAAA,IAAI,EAAER;AAFe,GAAvB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AEE,YAAA,KAAK,EAAEnC,QAFT;AAGE,YAAA,QAAQ,EAAEoC;AAHZ;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAtBF,eA6BE;AAAO,UAAA,SAAS,EAAC,uBAAjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBA7BF,eAgCE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,IAAI,EAAC,QAA1C;AAAA,qDAEE,QAAC,eAAD;AAAiB,YAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAhCF;AAAA;AAAA;AAAA;AAAA;AAAA,cAFF,eAuCE;AAAK,QAAA,SAAS,EAAC,gBAAf;AAAA,+BACE;AAAA,kEACE,QAAC,OAAD;AAAS,YAAA,EAAE,EAAC,SAAZ;AAAsB,YAAA,SAAS,EAAC,YAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAvCF;AAAA;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAyDD,CArHD;;GAAM9C,M;UACiBJ,W;;;KADjBI,M;AAuHN,eAAeA,MAAf","sourcesContent":["import React, { useState } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Error\")\r\n return Promise.reject();\r\n }\r\n }).then((e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ email, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n })\r\n }\r\n\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [modalState, showModal] = useState(false);\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n\n const setModalVisible = () => {\n showModal(!modalState);\n };\n\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Error\");\n Promise.reject(\"\");\n return;\n }\n\n window.alert(\"Success! User created. Please log in\");\n });\n };\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 handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: `modal ${modalState ? \"active\" : null}`,\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"modal-content\",\n children: [/*#__PURE__*/_jsxDEV(\"p\", {\n children: [\"Account successfully created\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n className: \"check-icon\",\n icon: \"check\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 73,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/login\",\n children: /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n children: [\"Sign in\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"sign-in-alt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 78,\n columnNumber: 15\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 13\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 86,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 95,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 11\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: 102,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 109,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 107,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 116,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 121,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 126,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 124,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 92,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 131,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 130,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 129,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 90,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"bJFRYNtgUPA8mKGuzi/D2Xd2R8U=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","oktaAuth","sessionToken","setSessionToken","modalState","showModal","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","setModalVisible","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,QAAgC,OAAhC;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA;AAAF,MAAeL,WAAW,EAAhC;AACA,QAAM,CAACM,YAAD,EAAeC,eAAf,IAAkCR,QAAQ,EAAhD;AACA,QAAM,CAACS,UAAD,EAAaC,SAAb,IAA0BV,QAAQ,CAAC,KAAD,CAAxC;AAEA,QAAM,CAACW,SAAD,EAAYC,YAAZ,IAA4BZ,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACe,KAAD,EAAQC,QAAR,IAAoBhB,QAAQ,CAAC,EAAD,CAAlC;AACA,QAAM,CAACiB,QAAD,EAAWC,WAAX,IAA0BlB,QAAQ,CAAC,EAAD,CAAxC;;AAEA,QAAMmB,eAAe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AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,cAvCF;AAAA;AAAA;AAAA;AAAA;AAAA,YAzBF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA2ED,CAnID;;GAAM1C,M;UACiBJ,W;;;KADjBI,M;AAqIN,eAAeA,MAAf","sourcesContent":["import React, { useState } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n const [modalState, showModal] = useState(false)\r\n\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const setModalVisible = () => {\r\n showModal(!modalState)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\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 window.alert(\"Success! User created. Please log in\")\r\n })\r\n }\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n {/* The Modal */}\r\n <div className={`modal ${modalState ? \"active\" : null}`}>\r\n\r\n {/* Modal content */}\r\n <div className=\"modal-content\">\r\n <p>\r\n Account successfully created&nbsp;\r\n <FontAwesomeIcon className=\"check-icon\" icon=\"check\"></FontAwesomeIcon>\r\n </p>\r\n <NavLink to=\"/login\">\r\n <button className=\"formSubmitButton\">\r\n Sign in&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"sign-in-alt\"></FontAwesomeIcon>\r\n </button>\r\n </NavLink>\r\n </div>\r\n\r\n </div>\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\");\n return Promise.reject();\n }\n\n return res.json();\n }).then(() => {\n oktaAuth.signInWithCredentials({\n email,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n });\n };\n\n const handleFirstNameChange = e => {\n setFirstName(e.target.value);\n };\n\n const handleLastNameChange = e => {\n setLastName(e.target.value);\n };\n\n const handleEmailChange = e => {\n setEmail(e.target.value);\n };\n\n const handlePasswordChange = e => {\n setPassword(e.target.value);\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 70,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 71,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 68,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 75,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\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: 79,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 11\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: 86,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 84,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"email\",\n type: \"text\",\n value: email,\n onChange: handleEmailChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 93,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 91,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n id: \"password\",\n type: \"password\",\n value: password,\n onChange: handlePasswordChange\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 100,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 98,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 105,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 110,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 108,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 76,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 115,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 114,\n columnNumber: 11\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 113,\n columnNumber: 9\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"8+72sMg80FVNhxNijJ4F05o0QkM=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useOktaAuth","FontAwesomeIcon","NavLink","config","SignUp","authState","oktaAuth","sessionToken","setSessionToken","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","Promise","reject","json","signInWithCredentials","signInWithRedirect","originalUri","catch","err","console","log","handleFirstNameChange","target","value","handleLastNameChange","handleEmailChange","handlePasswordChange"],"mappings":";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,QAA2C,OAA3C;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,cAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;;;AAEA,MAAMC,MAAM,GAAG,MAAM;AAAA;;AACnB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BN,WAAW,EAA3C;AACA,QAAM,CAACO,YAAD,EAAeC,eAAf,IAAkCV,QAAQ,EAAhD;AACA,QAAM,CAACW,SAAD,EAAYC,YAAZ,IAA4BZ,QAAQ,CAAC,EAAD,CAA1C;AACA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACe,KAAD,EAAQC,QAAR,IAAoBhB,QAAQ,CAAC,EAAD,CAAlC;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BJ,W;;;KAD5BI,M;AAqHN,eAAeA,MAAf","sourcesContent":["import React, { useState, useEffect } from 'react';\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\")\r\n return Promise.reject();\r\n }\r\n return res.json();\r\n }).then(() => {\r\n oktaAuth.signInWithCredentials({ email, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n })\r\n }\r\n\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 handleEmailChange = (e) => {\r\n setEmail(e.target.value)\r\n }\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\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={email}\r\n onChange={handleEmailChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"metadata":{},"sourceType":"module"}
\ No newline at end of file
{"ast":null,"code":"var _jsxFileName = \"C:\\\\Users\\\\Bruger\\\\Desktop\\\\Web-projects\\\\pipit\\\\client\\\\src\\\\components\\\\login\\\\signUp\\\\SignUp.jsx\",\n _s = $RefreshSig$();\n\nimport React, { useState, useEffect } from 'react';\nimport { useOktaAuth } from '@okta/okta-react';\nimport \"./SignUp.css\";\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\nimport { useInput } from '../../../util/useInput';\nimport { NavLink } from 'react-router-dom';\nimport config from \"../../../config\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\n\nconst SignUp = () => {\n _s();\n\n const {\n authState,\n oktaAuth\n } = useOktaAuth();\n const [sessionToken, setSessionToken] = useState();\n const [firstName, setFirstName] = useState('');\n const [lastName, setLastName] = useState('');\n const [email, setEmail] = useState('');\n const [password, setPassword] = useState('');\n const userInputData = JSON.stringify({\n FirstName: `${firstName}`,\n LastName: `${lastName}`,\n Email: `${email}`,\n password: `${password}`\n });\n const requestOptions = {\n method: 'POST',\n body: userInputData\n };\n\n const handleSubmit = e => {\n e.preventDefault();\n fetch(config.serviceAPI.createNewUserURL, requestOptions).then(res => {\n if (!res.ok) {\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\");\n resetPassword();\n return Promise.reject();\n }\n\n return res.json();\n }).then(() => {\n oktaAuth.signInWithCredentials({\n email,\n password\n }).then(res => {\n const sessionToken = res.sessionToken;\n setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once\n\n oktaAuth.signInWithRedirect({\n sessionToken,\n originalUri: '/home'\n });\n }).catch(err => console.log('Found an error', err));\n });\n };\n\n return /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"pageContainer\",\n children: [/*#__PURE__*/_jsxDEV(\"div\", {\n className: \"spacer\",\n children: /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"text-container\",\n children: [/*#__PURE__*/_jsxDEV(\"h1\", {\n children: \"Get started with PipIt\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 56,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"h5\", {\n children: \"Track bugs and usabilty issues\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 57,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 55,\n columnNumber: 9\n }, this)\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 54,\n columnNumber: 7\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"signUpForm\",\n children: [/*#__PURE__*/_jsxDEV(\"h2\", {\n children: \"Sign Up\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 61,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"form\", {\n onSubmit: handleSubmit,\n children: [/*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"First name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindFirstName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 65,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 63,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Last Name:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindLastName\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 69,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 67,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Email:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"text\",\n ...bindEmail\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 74,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 72,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n children: [\"Password:\", /*#__PURE__*/_jsxDEV(\"input\", {\n type: \"password\",\n ...bindPassword\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 79,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 77,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"label\", {\n className: \"password-requirements\",\n children: \"Requirements: At least 8 characters, no parts of your username\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 82,\n columnNumber: 11\n }, this), /*#__PURE__*/_jsxDEV(\"button\", {\n className: \"formSubmitButton\",\n type: \"submit\",\n children: [\"Sign Up\\xA0\\xA0\", /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {\n icon: \"user-plus\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 87,\n columnNumber: 13\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 85,\n columnNumber: 11\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 62,\n columnNumber: 9\n }, this), /*#__PURE__*/_jsxDEV(\"div\", {\n className: \"sign-up-prompt\",\n children: /*#__PURE__*/_jsxDEV(\"span\", {\n children: [\"Already have an account?\\xA0\", /*#__PURE__*/_jsxDEV(NavLink, {\n to: \"/signIn\",\n className: \"signInLink\",\n children: \"Sign in\"\n }, void 0, false, {\n fileName: _jsxFileName,\n lineNumber: 92,\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: 60,\n columnNumber: 7\n }, this)]\n }, void 0, true, {\n fileName: _jsxFileName,\n lineNumber: 53,\n columnNumber: 5\n }, this);\n};\n\n_s(SignUp, \"8+72sMg80FVNhxNijJ4F05o0QkM=\", false, function () {\n return [useOktaAuth];\n});\n\n_c = SignUp;\nexport default SignUp;\n\nvar _c;\n\n$RefreshReg$(_c, \"SignUp\");","map":{"version":3,"sources":["C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/login/signUp/SignUp.jsx"],"names":["React","useState","useEffect","useOktaAuth","FontAwesomeIcon","useInput","NavLink","config","SignUp","authState","oktaAuth","sessionToken","setSessionToken","firstName","setFirstName","lastName","setLastName","email","setEmail","password","setPassword","userInputData","JSON","stringify","FirstName","LastName","Email","requestOptions","method","body","handleSubmit","e","preventDefault","fetch","serviceAPI","createNewUserURL","then","res","ok","window","alert","resetPassword","Promise","reject","json","signInWithCredentials","signInWithRedirect","originalUri","catch","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OktaAuth } from '@okta/okta-react';\r\nimport \"./SignUp.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { useInput } from '../../../util/useInput'\r\nimport { NavLink } from 'react-router-dom';\r\nimport config from \"../../../config\"\r\n\r\nconst SignUp = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState();\r\n const [firstName, setFirstName] = useState('')\r\n const [lastName, setLastName] = useState('')\r\n const [email, setEmail] = useState('')\r\n const [password, setPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n FirstName: `${firstName}`,\r\n LastName: `${lastName}`,\r\n Email: `${email}`,\r\n password: `${password}`\r\n })\r\n\r\n const requestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n fetch(config.serviceAPI.createNewUserURL, requestOptions)\r\n .then((res) => {\r\n if (!res.ok) {\r\n window.alert(\"Password requirements not met. Password must be at least 8 characters and have no parts of your username\")\r\n resetPassword()\r\n return Promise.reject();\r\n }\r\n return res.json();\r\n }).then(() => {\r\n oktaAuth.signInWithCredentials({ email, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n })\r\n }\r\n\r\n return (\r\n <div className=\"pageContainer\">\r\n <div className=\"spacer\">\r\n <div className=\"text-container\">\r\n <h1>Get started with PipIt</h1>\r\n <h5>Track bugs and usabilty issues</h5>\r\n </div>\r\n </div>\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSubmit}>\r\n <label>\r\n First name:\r\n <input type=\"text\" {...bindFirstName} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n type=\"text\" {...bindLastName} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n type=\"text\" {...bindEmail} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n type=\"password\" {...bindPassword} />\r\n </label>\r\n <label className=\"password-requirements\">\r\n Requirements: At least 8 characters, no parts of your username\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign Up&nbsp;&nbsp;\r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <div className=\"sign-up-prompt\">\r\n <span>Already have an account?&nbsp;\r\n <NavLink to=\"/signIn\" className=\"signInLink\">\r\n Sign in\r\n </NavLink>\r\n </span>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default SignUp"]},"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