Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Mathias Engelbrecht Pilegård
Pipit
Commits
a26e7d3e
Commit
a26e7d3e
authored
Aug 30, 2021
by
Mathias Engelbrecht Pilegård
Browse files
fixed forgot password modal popup flow
parent
5690006f
Changes
209
Hide whitespace changes
Inline
Side-by-side
client/node_modules/.cache/.eslintcache
View file @
a26e7d3e
[{"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js":"1","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx":"2","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js":"3","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx":"4","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx":"5","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx":"6","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx":"7","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx":"8","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx":"9","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx":"10","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx":"11","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx":"12","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx":"13","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx":"14","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx":"15","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx":"16","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx":"17","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx":"18","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx":"19","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx":"20","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx":"21","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx":"22","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx":"23","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx":"24"},{"size":285,"mtime":1628516023915,"results":"25","hashOfConfig":"26"},{"size":2100,"mtime":1630074941213,"results":"27","hashOfConfig":"26"},{"size":473,"mtime":1629901058454,"results":"28","hashOfConfig":"26"},{"size":1489,"mtime":1629790769379,"results":"29","hashOfConfig":"26"},{"size":324,"mtime":1629371594261,"results":"30","hashOfConfig":"26"},{"size":3379,"mtime":1630094426455,"results":"31","hashOfConfig":"26"},{"size":626,"mtime":1628697746462,"results":"32","hashOfConfig":"26"},{"size":3967,"mtime":1628695632288,"results":"33","hashOfConfig":"26"},{"size":1279,"mtime":1630089091700,"results":"34","hashOfConfig":"26"},{"size":1068,"mtime":1628696051327,"results":"35","hashOfConfig":"26"},{"size":3660,"mtime":1629794572456,"results":"36","hashOfConfig":"26"},{"size":2374,"mtime":1628696187694,"results":"37","hashOfConfig":"26"},{"size":2694,"mtime":1628696113184,"results":"38","hashOfConfig":"26"},{"size":3264,"mtime":1628535700010,"results":"39","hashOfConfig":"26"},{"size":2334,"mtime":1630060568411,"results":"40","hashOfConfig":"26"},{"size":2096,"mtime":1628430812599,"results":"41","hashOfConfig":"26"},{"size":3570,"mtime":1628430832688,"results":"42","hashOfConfig":"26"},{"size":906,"mtime":1630073002522,"results":"43","hashOfConfig":"26"},{"size":548,"mtime":1628421916010,"results":"44","hashOfConfig":"26"},{"size":697,"mtime":1628430740299,"results":"45","hashOfConfig":"26"},{"size":470,"mtime":1628430752153,"results":"46","hashOfConfig":"26"},{"size":3533,"mtime":1630069281308,"results":"47","hashOfConfig":"26"},{"size":4009,"mtime":1630090234456,"results":"48","hashOfConfig":"26"},{"size":4940,"mtime":1630094755661,"results":"49","hashOfConfig":"26"},{"filePath":"50","messages":"51","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},"iyhzrm",{"filePath":"53","messages":"54","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"55","messages":"56","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"57","usedDeprecatedRules":"52"},{"filePath":"58","messages":"59","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"60","usedDeprecatedRules":"52"},{"filePath":"61","messages":"62","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"63"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":7,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"66","messages":"67","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"68","messages":"69","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"70","usedDeprecatedRules":"52"},{"filePath":"71","messages":"72","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"73","messages":"74","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"75","messages":"76","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"77","usedDeprecatedRules":"52"},{"filePath":"78","messages":"79","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"80","usedDeprecatedRules":"52"},{"filePath":"81","messages":"82","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"83","usedDeprecatedRules":"52"},{"filePath":"84","messages":"85","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"86","usedDeprecatedRules":"52"},{"filePath":"87","messages":"88","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"89","usedDeprecatedRules":"52"},{"filePath":"90","messages":"91","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"92","usedDeprecatedRules":"52"},{"filePath":"93","messages":"94","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"95","messages":"96","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"97","usedDeprecatedRules":"52"},{"filePath":"98","messages":"99","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"100","usedDeprecatedRules":"52"},{"filePath":"101","messages":"102","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"103","messages":"104","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"107","usedDeprecatedRules":"52"},{"filePath":"108","messages":"109","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"52"},{"filePath":"110","messages":"111","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js",[],["112","113"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js",["114"],"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 resetPasswordURL: 'http://localhost:3030/api/reset-user-password'\r\n }\r\n};","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx",["115"],"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\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 })\r\n .catch((err) => {\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","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx",[],["116","117"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx",["118","119","120","121","122","123","124"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx",["125"],"import React, { useState } from 'react'\r\nimport \"./ReportForm.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport Assign from './assign/Assign'\r\n\r\nconst ReportForm = () => {\r\n return (\r\n <div className=\"page-content-container\">\r\n <h2 className=\"reportissuePageText\">Report an issue</h2>\r\n <form action=\"/reportFormData\">\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueType\">Type of issue</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueType\" className=\"issueType\">\r\n <option value=\"bug\">Bug</option>\r\n <option value=\"usabilityissue\">Usability error</option>\r\n <option value=\"other\">Other</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueLocation\">Where did you encounter the issue?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <input type=\"text\" id=\"fissueLocation\" className=\"issueLocation\" ></input>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueDescription\">Describe the issue</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueDescription\" className=\"issueDescription\"></textarea>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueStepsToTeproduce\">What steps did you take before the issue happened?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueStepsToTeproduce\" className=\"issueStepsToReproduce\"\r\n placeholder=\"List the steps that occurred before the issue happened:\r\n1.\r\n2.\r\n3.\r\nExpected Result:\r\nActual Result:\">\r\n </textarea>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueSeverity\">Severity level</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueSeverity\">\r\n <option value=\"cosmetic\">Cosmetic - should be corrected when time permits</option>\r\n <option value=\"serious\">Serious - should be corrected in the next release</option>\r\n <option value=\"critical\">Critical - should be corrected as soon as possible</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueTimeToCorrect\">Time to Correct</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueTimeToCorrect\">\r\n <option value=\"lessThanTwoHours\">Less than 2 minutes</option>\r\n <option value=\"lessThanOneToTwoDays\">Less than 1 or 2 days</option>\r\n <option value=\"lessThanOneToTwoWeeks\">Less than 1 or 2 weeks</option>\r\n <option value=\"atLeastTwoWeeks\">More than 2 weeks</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueAssignToProject\">Assign to</label>\r\n </div>\r\n <div className=\"col-75\">\r\n {/*\r\n <select id=\"fissueAssignToProject\" className=\"issueAssignToProject\">\r\n <option value=\"lessThanTwoHours\">Henriks meme machine - ReactApp</option>\r\n </select>\r\n */}\r\n <Assign />\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row\">\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit \r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </form>\r\n </div >\r\n )\r\n}\r\n\r\nexport default ReportForm","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx",["126","127"],"import React, { useState } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport \"./ProjectOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst ProjectOverview = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n const [sharedProjectsButtonState, setSharedProjectsButtonState] = useState(true);\r\n const [personalProjectsButtonState, setPersonalProjectsButtonState] = useState(false);\r\n\r\n const SharedProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(true);\r\n setPersonalProjectsButtonState(false);\r\n };\r\n\r\n const PersonalProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(false);\r\n setPersonalProjectsButtonState(true);\r\n };\r\n\r\n const ProjectsDisplay = (projects) => {\r\n return (\r\n <div className=\"projectlist\">\r\n <ul>\r\n {projects.map((elements, index) => (\r\n <li>\r\n <div className=\"project-entry\">\r\n <div className=\"project-team-name\">\r\n <NavLink to={`/${projects[index].id}`}>{projects[index].id} \r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"project-status-info-container\">\r\n <div className=\"new-issues-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"bug\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Total issues</span>\r\n </div>\r\n <div className=\"issues-solved-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"check\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Issues solved</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Last updated: 1 day ago</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"projectlist-title\">Your Projects</h2>\r\n <button className=\"create-new-project-button\">\r\n New Project\r\n </button>\r\n </div>\r\n <div className=\"project-sort-menu-container\">\r\n <div className=\"personal-shared-projects-container\">\r\n <a className={sharedProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={SharedProjectsButtonActive}>Shared Projects</a>\r\n <a className={personalProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={PersonalProjectsButtonActive}>Personal Projects</a>\r\n </div>\r\n <div className=\"project-sort-select-container\">\r\n <p>Sort by:</p>\r\n <select>\r\n <option>Last updated</option>\r\n <option>Last created</option>\r\n <option>Name</option>\r\n <option>Name descending</option>\r\n <option>Oldest created</option>\r\n <option>Oldest updated</option>\r\n </select>\r\n </div>\r\n </div>\r\n {sharedProjectsButtonState ? ProjectsDisplay(sharedProjects) : ProjectsDisplay(personalProjects)}\r\n </div >\r\n )\r\n}\r\n\r\nexport default ProjectOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx",["128"],"import React, { useRef, useState, useEffect } from 'react'\r\nimport \"./TeamInfo.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nconst TeamInfo = () => {\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 return (\r\n <div className=\"page-content-container\">\r\n <div className=\"teamInformationPage-content-header\">\r\n <div className=\"header-text\">\r\n <h2 className=\"teamInformationPage-title\">Henriks Meme machine > overview</h2>\r\n </div>\r\n <div className=\"header-notification-select-settings-button-container\">\r\n <div className=\"notification-button-container\">\r\n <button className={`notification-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"bell-icon\" icon=\"bell\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <a>\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon> Account\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n <div className=\"settings-button-container\">\r\n <button>\r\n <FontAwesomeIcon icon=\"cog\"></FontAwesomeIcon>\r\n Settings\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"teamInformationPage-content-container\">\r\n {/*TODO: components goes here */}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default TeamInfo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx",["129","130"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./TeamOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst TeamOverview = () => {\r\n\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"teamlist-title\">Teams</h2>\r\n <div className=\"buttons-container\">\r\n <button className=\"join-team-button\">\r\n Join Team\r\n </button>\r\n <button className=\"create-new-team-button\">\r\n New team\r\n </button>\r\n </div>\r\n </div>\r\n <div className=\"teamlist\">\r\n <ul>\r\n <li>\r\n <div className=\"team-entry\">\r\n <div className=\"image-team-name\">\r\n <NavLink to=\"/HenriksMemeMachine\" className=\"team-image-container\">\r\n <FontAwesomeIcon className=\"team-icon\" icon=\"dice-d6\"></FontAwesomeIcon>\r\n </NavLink>\r\n <NavLink to=\"/HenriksMemeMachine\">Henriks meme machine - ReactApp \r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"team-status-info-container\">\r\n <div className=\"new-messages-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"envelope\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">New messages</span>\r\n </div>\r\n <div className=\"projects-maintained-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"project-diagram\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Projects maintained</span>\r\n </div>\r\n <div className=\"team-members-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"users\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Team members</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Date created: 21/ 07/ 2021</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default TeamOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx",["131","132","133","134","135","136"],"import React, { useState } from 'react'\r\nimport \"./Assign.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst Assign = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n\r\n const rootDirectoryObjects = [\r\n { id: \"Personal projects\" },\r\n { id: \"Shared projects\" }\r\n ]\r\n\r\n const DirectoryItems = () => {\r\n return (\r\n <div className=\"multi-level\">\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"A\" />\r\n <label for=\"A\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a> {rootDirectoryObjects[0].id} </a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {personalProjects.map((elements, index) => (\r\n <li className=\"personalProjectsItem\">\r\n <input type=\"checkbox\" id={`A-${index}`} />\r\n <label for={`A-${index}`}>\r\n <FontAwesomeIcon icon=\"angle-right\" className=\"project-icon\"></FontAwesomeIcon>\r\n <a> {personalProjects[index].id} </a>\r\n </label>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"B\" />\r\n <label for=\"B\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a> {rootDirectoryObjects[1].id} </a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects.map((elements, index) => (\r\n <li><div className=\"sub-item\">\r\n <input type=\"checkbox\" id={`B-${index}`} />\r\n <label for={`B-${index}`}>\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a> {sharedProjects[index].id} </a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects[index].teams.map(team => (\r\n <li><div className=\"team-item\">\r\n <input type=\"checkbox\" id={`team-${team.name}`} />\r\n <label for={`team-${team.name}`}>\r\n <FontAwesomeIcon icon=\"users\" className=\"users-icon\"></FontAwesomeIcon>\r\n <a> {team.name} </a>\r\n </label>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"assignSelectContainer\">\r\n <DirectoryItems />\r\n </div >\r\n )\r\n}\r\n\r\nexport default Assign","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx",["137","138","139","140"],"import React from 'react'\r\nimport \"./Updates.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport useMessages from '../../../util/useMessages'\r\n\r\nconst Updates = () => {\r\n const messages = useMessages()\r\n\r\n return (\r\n <div className=\"project-updates-new-messages-container\">\r\n\r\n <div className=\"project-updates-display-container\">\r\n <div className=\"project-updates-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"exclamation\"></FontAwesomeIcon>\r\n New project updates\r\n </p>\r\n </div>\r\n <div className=\"project-updates-display-content\">\r\n <div className=\"project-update-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [project] [new issues] [issues fixed]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"new-messages-display-container\">\r\n <div className=\"new-messages-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>\r\n New messages\r\n </p>\r\n </div>\r\n {messages ? messages.map((message) => (\r\n <div className=\"new-messages-display-content\">\r\n <div className=\"new-message-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [{message.sender}] [{message.id}]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [{message.date}]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n )) : \"Loading messages\"}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Updates","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx",["141","142","143","144"],"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport React from 'react'\r\nimport \"./ActivitiesDisplay.css\"\r\n\r\nconst ActivitiesDisplay = () => {\r\n return (\r\n <div className=\"activity-new-issues-display-container\">\r\n\r\n <div className=\"new-issues-display-container\">\r\n <div className=\"new-issues-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"inbox\"></FontAwesomeIcon>\r\n New issue reports\r\n </p>\r\n </div>\r\n <div className=\"new-issues-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Severity] [type]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"activity-display-container\">\r\n <div className=\"activity-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"sticky-note\"></FontAwesomeIcon>\r\n Recent Team activities\r\n </p>\r\n </div>\r\n <div className=\"activity-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Name] [action]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ActivitiesDisplay","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx",["145"],"import React from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Navbar.css\"\r\nimport Logo from './logo/Logo'\r\nimport NavLinks from './navLinks/NavLinks'\r\nimport Searchbar from './searchbar/Searchbar'\r\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu'\r\n\r\nconst Navbar = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"navbar\" >\r\n <div className=\"header-content\">\r\n <div className=\"title-navigation-links-container\">\r\n <Logo />\r\n <NavLinks />\r\n </div>\r\n <div className=\"searchbar-profile-container\">\r\n <ul className=\"right-unstyled-navbar\">\r\n <Searchbar />\r\n <NavbarDropdownMenu />\r\n </ul>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default Navbar","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx",["146","147"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./Logo.css\"\r\nimport logo_picture from \"../../../images/bird-logo.jpg\"\r\nimport logo_text from \"../../../images/logo-text.jpg\"\r\n\r\nconst Logo = () => {\r\n return (\r\n <h1 className=\"title\">\r\n <span className=\"title-icon\">\r\n <NavLink to=\"/home\" id=\"logo\">\r\n <img src={logo_picture} width=\"24\" height=\"24\"></img>\r\n <img src={logo_text} width=\"48\" height=\"24\"></img>\r\n </NavLink>\r\n </span>\r\n </h1>\r\n )\r\n}\r\n\r\nexport default Logo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx",["148"],"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 const [userInfo, setUserInfo] = useState(null);\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 useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\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 <NavLink to=\"/account\" onClick={onClick} className=\"top-item\">\r\n <div>\r\n <FontAwesomeIcon icon=\"user\" className=\"item-icon-top\"></FontAwesomeIcon> \r\n </div>\r\n <div className=\"item-top-text\">\r\n <span>\r\n <p className=\"top-row\">Account</p>\r\n <p className=\"bottom-row\">{userInfo ? userInfo.email : \"...\"}</p>\r\n </span>\r\n </div>\r\n <div className=\"item-last-flex-item\">\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"item-icon-top\"></FontAwesomeIcon>\r\n </div>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\" onClick={onClick}>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon> 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> 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> 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","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx",["149","150"],{"ruleId":"151","replacedBy":"152"},{"ruleId":"153","replacedBy":"154"},{"ruleId":"155","severity":1,"message":"156","line":1,"column":1,"nodeType":"157","endLine":14,"endColumn":3},{"ruleId":"158","severity":1,"message":"159","line":47,"column":6,"nodeType":"160","endLine":47,"endColumn":17,"suggestions":"161"},{"ruleId":"151","replacedBy":"162"},{"ruleId":"153","replacedBy":"163"},{"ruleId":"164","severity":1,"message":"165","line":1,"column":27,"nodeType":"166","messageId":"167","endLine":1,"endColumn":36},{"ruleId":"164","severity":1,"message":"168","line":1,"column":38,"nodeType":"166","messageId":"167","endLine":1,"endColumn":44},{"ruleId":"164","severity":1,"message":"169","line":6,"column":10,"nodeType":"166","messageId":"167","endLine":6,"endColumn":17},{"ruleId":"164","severity":1,"message":"170","line":7,"column":8,"nodeType":"166","messageId":"167","endLine":7,"endColumn":14},{"ruleId":"164","severity":1,"message":"171","line":31,"column":9,"nodeType":"166","messageId":"167","endLine":31,"endColumn":28},{"ruleId":"172","severity":1,"message":"173","line":60,"column":19,"nodeType":"174","messageId":"175","endLine":60,"endColumn":21},{"ruleId":"176","severity":1,"message":"177","line":107,"column":15,"nodeType":"178","endLine":107,"endColumn":48},{"ruleId":"164","severity":1,"message":"179","line":1,"column":17,"nodeType":"166","messageId":"167","endLine":1,"endColumn":25},{"ruleId":"176","severity":1,"message":"177","line":75,"column":11,"nodeType":"178","endLine":75,"endColumn":123},{"ruleId":"176","severity":1,"message":"177","line":76,"column":11,"nodeType":"178","endLine":76,"endColumn":127},{"ruleId":"176","severity":1,"message":"177","line":43,"column":19,"nodeType":"178","endLine":43,"endColumn":22},{"ruleId":"164","severity":1,"message":"180","line":8,"column":9,"nodeType":"166","messageId":"167","endLine":8,"endColumn":25},{"ruleId":"164","severity":1,"message":"181","line":13,"column":9,"nodeType":"166","messageId":"167","endLine":13,"endColumn":23},{"ruleId":"164","severity":1,"message":"179","line":1,"column":17,"nodeType":"166","messageId":"167","endLine":1,"endColumn":25},{"ruleId":"176","severity":1,"message":"177","line":29,"column":13,"nodeType":"178","endLine":29,"endColumn":16},{"ruleId":"176","severity":1,"message":"177","line":39,"column":19,"nodeType":"178","endLine":39,"endColumn":22},{"ruleId":"176","severity":1,"message":"177","line":50,"column":13,"nodeType":"178","endLine":50,"endColumn":16},{"ruleId":"176","severity":1,"message":"177","line":60,"column":19,"nodeType":"178","endLine":60,"endColumn":22},{"ruleId":"176","severity":1,"message":"177","line":70,"column":25,"nodeType":"178","endLine":70,"endColumn":28},{"ruleId":"176","severity":1,"message":"177","line":23,"column":17,"nodeType":"178","endLine":23,"endColumn":20},{"ruleId":"176","severity":1,"message":"177","line":28,"column":17,"nodeType":"178","endLine":28,"endColumn":20},{"ruleId":"176","severity":1,"message":"177","line":52,"column":19,"nodeType":"178","endLine":52,"endColumn":22},{"ruleId":"176","severity":1,"message":"177","line":57,"column":19,"nodeType":"178","endLine":57,"endColumn":22},{"ruleId":"176","severity":1,"message":"177","line":20,"column":17,"nodeType":"178","endLine":20,"endColumn":20},{"ruleId":"176","severity":1,"message":"177","line":25,"column":17,"nodeType":"178","endLine":25,"endColumn":20},{"ruleId":"176","severity":1,"message":"177","line":48,"column":17,"nodeType":"178","endLine":48,"endColumn":20},{"ruleId":"176","severity":1,"message":"177","line":53,"column":17,"nodeType":"178","endLine":53,"endColumn":20},{"ruleId":"164","severity":1,"message":"182","line":10,"column":22,"nodeType":"166","messageId":"167","endLine":10,"endColumn":30},{"ruleId":"183","severity":1,"message":"184","line":12,"column":11,"nodeType":"178","endLine":12,"endColumn":58},{"ruleId":"183","severity":1,"message":"184","line":13,"column":11,"nodeType":"178","endLine":13,"endColumn":55},{"ruleId":"176","severity":1,"message":"177","line":88,"column":15,"nodeType":"178","endLine":88,"endColumn":35},{"ruleId":"158","severity":1,"message":"185","line":27,"column":6,"nodeType":"160","endLine":27,"endColumn":33,"suggestions":"186"},{"ruleId":"172","severity":1,"message":"173","line":80,"column":20,"nodeType":"174","messageId":"175","endLine":80,"endColumn":22},"no-native-reassign",["187"],"no-negated-in-lhs",["188"],"import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'oktaAuth'. Either include it or remove the dependency array.","ArrayExpression",["189"],["187"],["188"],"no-unused-vars","'useEffect' is defined but never used.","Identifier","unusedVar","'useRef' is defined but never used.","'NavLink' is defined but never used.","'signUp' is defined but never used.","'loginRequestOptions' is assigned a value but never used.","eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","jsx-a11y/anchor-is-valid","The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","'useState' is defined but never used.","'personalProjects' is assigned a value but never used.","'sharedProjects' is assigned a value but never used.","'oktaAuth' is assigned a value but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","React Hook useEffect has a missing dependency: 'toggleSignUpFormVisible'. Either include it or remove the dependency array.",["190"],"no-global-assign","no-unsafe-negation",{"desc":"191","fix":"192"},{"desc":"193","fix":"194"},"Update the dependencies array to be: [authState, oktaAuth]",{"range":"195","text":"196"},"Update the dependencies array to be: [signUpFormVisibilityState, toggleSignUpFormVisible]",{"range":"197","text":"198"},[1422,1433],"[authState, oktaAuth]",[873,900],"[signUpFormVisibilityState, toggleSignUpFormVisible]"]
\ No newline at end of file
[{"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js":"1","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx":"2","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js":"3","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx":"4","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx":"5","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx":"6","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx":"7","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx":"8","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx":"9","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx":"10","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx":"11","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx":"12","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx":"13","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx":"14","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx":"15","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx":"16","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx":"17","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx":"18","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx":"19","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx":"20","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx":"21","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx":"22","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx":"23","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx":"24","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\passwordReset\\PasswordForgotModal.jsx":"25","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\messageModal\\MessageModal.jsx":"26"},{"size":285,"mtime":1628516023915,"results":"27","hashOfConfig":"28"},{"size":2100,"mtime":1630074941213,"results":"29","hashOfConfig":"28"},{"size":538,"mtime":1630351419891,"results":"30","hashOfConfig":"28"},{"size":1489,"mtime":1629790769379,"results":"31","hashOfConfig":"28"},{"size":324,"mtime":1629371594261,"results":"32","hashOfConfig":"28"},{"size":2713,"mtime":1630270705373,"results":"33","hashOfConfig":"28"},{"size":626,"mtime":1628697746462,"results":"34","hashOfConfig":"28"},{"size":3967,"mtime":1628695632288,"results":"35","hashOfConfig":"28"},{"size":1279,"mtime":1630089091700,"results":"36","hashOfConfig":"28"},{"size":1068,"mtime":1628696051327,"results":"37","hashOfConfig":"28"},{"size":3660,"mtime":1629794572456,"results":"38","hashOfConfig":"28"},{"size":2374,"mtime":1628696187694,"results":"39","hashOfConfig":"28"},{"size":2694,"mtime":1628696113184,"results":"40","hashOfConfig":"28"},{"size":3264,"mtime":1628535700010,"results":"41","hashOfConfig":"28"},{"size":2334,"mtime":1630060568411,"results":"42","hashOfConfig":"28"},{"size":2096,"mtime":1628430812599,"results":"43","hashOfConfig":"28"},{"size":3570,"mtime":1628430832688,"results":"44","hashOfConfig":"28"},{"size":906,"mtime":1630073002522,"results":"45","hashOfConfig":"28"},{"size":548,"mtime":1628421916010,"results":"46","hashOfConfig":"28"},{"size":697,"mtime":1628430740299,"results":"47","hashOfConfig":"28"},{"size":470,"mtime":1628430752153,"results":"48","hashOfConfig":"28"},{"size":3533,"mtime":1630069281308,"results":"49","hashOfConfig":"28"},{"size":4009,"mtime":1630090234456,"results":"50","hashOfConfig":"28"},{"size":4940,"mtime":1630212726060,"results":"51","hashOfConfig":"28"},{"size":3623,"mtime":1630351298170,"results":"52","hashOfConfig":"28"},{"size":579,"mtime":1630268546848,"results":"53","hashOfConfig":"28"},{"filePath":"54","messages":"55","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},"iyhzrm",{"filePath":"57","messages":"58","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"59","messages":"60","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"61","messages":"62","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"63","usedDeprecatedRules":"56"},{"filePath":"64","messages":"65","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"66"},{"filePath":"67","messages":"68","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"69","usedDeprecatedRules":"56"},{"filePath":"70","messages":"71","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"72","messages":"73","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"74","usedDeprecatedRules":"56"},{"filePath":"75","messages":"76","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"77","messages":"78","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"79","messages":"80","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"81","usedDeprecatedRules":"56"},{"filePath":"82","messages":"83","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"84","usedDeprecatedRules":"56"},{"filePath":"85","messages":"86","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"87","usedDeprecatedRules":"56"},{"filePath":"88","messages":"89","errorCount":0,"warningCount":6,"fixableErrorCount":0,"fixableWarningCount":0,"source":"90","usedDeprecatedRules":"56"},{"filePath":"91","messages":"92","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"93","usedDeprecatedRules":"56"},{"filePath":"94","messages":"95","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"96","usedDeprecatedRules":"56"},{"filePath":"97","messages":"98","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"99","messages":"100","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"101","usedDeprecatedRules":"56"},{"filePath":"102","messages":"103","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"104","usedDeprecatedRules":"56"},{"filePath":"105","messages":"106","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"107","messages":"108","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"109","messages":"110","errorCount":0,"warningCount":1,"fixableErrorCount":0,"fixableWarningCount":0,"source":"111","usedDeprecatedRules":"56"},{"filePath":"112","messages":"113","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0,"usedDeprecatedRules":"56"},{"filePath":"114","messages":"115","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":"116","usedDeprecatedRules":"56"},{"filePath":"117","messages":"118","errorCount":0,"warningCount":2,"fixableErrorCount":0,"fixableWarningCount":0,"source":null},{"filePath":"119","messages":"120","errorCount":0,"warningCount":4,"fixableErrorCount":0,"fixableWarningCount":0,"source":"121","usedDeprecatedRules":"56"},"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\index.js",[],["122","123"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\App.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\config.js",["124"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useMessages.jsx",["125"],"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\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 })\r\n .catch((err) => {\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","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\util\\useInput.jsx",[],["126","127"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\Login.jsx",["128","129","130","131","132","133"],"import React, { useState, useEffect, useRef } from 'react';\r\nimport { Redirect } from 'react-router-dom'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Login.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport { NavLink } from 'react-router-dom';\r\nimport signUp from './signUp/SignUp';\r\nimport config from '../../config';\r\nimport SignUp from './signUp/SignUp';\r\nimport PasswordForgotModal from './passwordReset/PasswordForgotModal';\r\n\r\nconst Login = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n const [sessionToken, setSessionToken] = useState()\r\n\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const userInputData = JSON.stringify({\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handleSignInFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n oktaAuth.signInWithCredentials({ username, password })\r\n .then(res => {\r\n const sessionToken = res.sessionToken;\r\n setSessionToken(sessionToken);\r\n // sessionToken is a one-use token, so make sure this is only called once\r\n oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });\r\n })\r\n .catch(err => console.log('Found an error', err));\r\n };\r\n\r\n if (sessionToken) {\r\n // Hide form while sessionToken is converted into id/access tokens\r\n return null;\r\n }\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return (\r\n <div className=\"pageContainer\">\r\n <SignUp />\r\n\r\n <div className=\"signInForm\">\r\n <h2>Sign in to PipIt</h2>\r\n <form onSubmit={handleSignInFormSubmit}>\r\n <label>\r\n Email:\r\n <input\r\n id=\"username\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <label>\r\n Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={password}\r\n onChange={handlePasswordChange} />\r\n </label>\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Sign in \r\n <FontAwesomeIcon icon=\"sign-in-alt\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n <PasswordForgotModal />\r\n </div>\r\n </div>\r\n )\r\n } else {\r\n return <Redirect to=\"/home\" />\r\n }\r\n}\r\n\r\nexport default Login","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\Messages\\Messages.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\ReportForm.jsx",["134"],"import React, { useState } from 'react'\r\nimport \"./ReportForm.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport Assign from './assign/Assign'\r\n\r\nconst ReportForm = () => {\r\n return (\r\n <div className=\"page-content-container\">\r\n <h2 className=\"reportissuePageText\">Report an issue</h2>\r\n <form action=\"/reportFormData\">\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueType\">Type of issue</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueType\" className=\"issueType\">\r\n <option value=\"bug\">Bug</option>\r\n <option value=\"usabilityissue\">Usability error</option>\r\n <option value=\"other\">Other</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueLocation\">Where did you encounter the issue?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <input type=\"text\" id=\"fissueLocation\" className=\"issueLocation\" ></input>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueDescription\">Describe the issue</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueDescription\" className=\"issueDescription\"></textarea>\r\n </div>\r\n </div>\r\n\r\n <div class=\"row\">\r\n <div class=\"col-25\">\r\n <label for=\"fissueStepsToTeproduce\">What steps did you take before the issue happened?</label>\r\n </div>\r\n <div class=\"col-75\">\r\n <textarea id=\"fissueStepsToTeproduce\" className=\"issueStepsToReproduce\"\r\n placeholder=\"List the steps that occurred before the issue happened:\r\n1.\r\n2.\r\n3.\r\nExpected Result:\r\nActual Result:\">\r\n </textarea>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueSeverity\">Severity level</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueSeverity\">\r\n <option value=\"cosmetic\">Cosmetic - should be corrected when time permits</option>\r\n <option value=\"serious\">Serious - should be corrected in the next release</option>\r\n <option value=\"critical\">Critical - should be corrected as soon as possible</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueTimeToCorrect\">Time to Correct</label>\r\n </div>\r\n <div className=\"col-75\">\r\n <select id=\"fissueSeverity\" className=\"issueTimeToCorrect\">\r\n <option value=\"lessThanTwoHours\">Less than 2 minutes</option>\r\n <option value=\"lessThanOneToTwoDays\">Less than 1 or 2 days</option>\r\n <option value=\"lessThanOneToTwoWeeks\">Less than 1 or 2 weeks</option>\r\n <option value=\"atLeastTwoWeeks\">More than 2 weeks</option>\r\n </select>\r\n </div>\r\n </div>\r\n\r\n <div className=\"row\">\r\n <div className=\"col-25\">\r\n <label for=\"fissueAssignToProject\">Assign to</label>\r\n </div>\r\n <div className=\"col-75\">\r\n {/*\r\n <select id=\"fissueAssignToProject\" className=\"issueAssignToProject\">\r\n <option value=\"lessThanTwoHours\">Henriks meme machine - ReactApp</option>\r\n </select>\r\n */}\r\n <Assign />\r\n </div>\r\n </div>\r\n\r\n\r\n <div class=\"row\">\r\n <button className=\"formSubmitButton\" type=\"submit\">\r\n Submit \r\n <FontAwesomeIcon icon=\"arrow-right\"></FontAwesomeIcon>\r\n </button>\r\n </div>\r\n </form>\r\n </div >\r\n )\r\n}\r\n\r\nexport default ReportForm","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\Home.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\ProjectInfo.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectOverview\\ProjectOverview.jsx",["135","136"],"import React, { useState } from 'react'\r\nimport { NavLink } from \"react-router-dom\";\r\nimport \"./ProjectOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst ProjectOverview = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n const [sharedProjectsButtonState, setSharedProjectsButtonState] = useState(true);\r\n const [personalProjectsButtonState, setPersonalProjectsButtonState] = useState(false);\r\n\r\n const SharedProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(true);\r\n setPersonalProjectsButtonState(false);\r\n };\r\n\r\n const PersonalProjectsButtonActive = () => {\r\n setSharedProjectsButtonState(false);\r\n setPersonalProjectsButtonState(true);\r\n };\r\n\r\n const ProjectsDisplay = (projects) => {\r\n return (\r\n <div className=\"projectlist\">\r\n <ul>\r\n {projects.map((elements, index) => (\r\n <li>\r\n <div className=\"project-entry\">\r\n <div className=\"project-team-name\">\r\n <NavLink to={`/${projects[index].id}`}>{projects[index].id} \r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"project-status-info-container\">\r\n <div className=\"new-issues-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"bug\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Total issues</span>\r\n </div>\r\n <div className=\"issues-solved-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"check\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Issues solved</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Last updated: 1 day ago</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"projectlist-title\">Your Projects</h2>\r\n <button className=\"create-new-project-button\">\r\n New Project\r\n </button>\r\n </div>\r\n <div className=\"project-sort-menu-container\">\r\n <div className=\"personal-shared-projects-container\">\r\n <a className={sharedProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={SharedProjectsButtonActive}>Shared Projects</a>\r\n <a className={personalProjectsButtonState ? \"activeUnderlined\" : \"inactive\"} onClick={PersonalProjectsButtonActive}>Personal Projects</a>\r\n </div>\r\n <div className=\"project-sort-select-container\">\r\n <p>Sort by:</p>\r\n <select>\r\n <option>Last updated</option>\r\n <option>Last created</option>\r\n <option>Name</option>\r\n <option>Name descending</option>\r\n <option>Oldest created</option>\r\n <option>Oldest updated</option>\r\n </select>\r\n </div>\r\n </div>\r\n {sharedProjectsButtonState ? ProjectsDisplay(sharedProjects) : ProjectsDisplay(personalProjects)}\r\n </div >\r\n )\r\n}\r\n\r\nexport default ProjectOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamInfo\\TeamInfo.jsx",["137"],"import React, { useRef, useState, useEffect } from 'react'\r\nimport \"./TeamInfo.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome';\r\n\r\nconst TeamInfo = () => {\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 return (\r\n <div className=\"page-content-container\">\r\n <div className=\"teamInformationPage-content-header\">\r\n <div className=\"header-text\">\r\n <h2 className=\"teamInformationPage-title\">Henriks Meme machine > overview</h2>\r\n </div>\r\n <div className=\"header-notification-select-settings-button-container\">\r\n <div className=\"notification-button-container\">\r\n <button className={`notification-button ${isActive ? 'active' : 'inactive'}`} onClick={onClick} >\r\n <FontAwesomeIcon className=\"bell-icon\" icon=\"bell\"></FontAwesomeIcon>\r\n <FontAwesomeIcon className=\"down-arrow\" icon=\"angle-down\"></FontAwesomeIcon>\r\n </button>\r\n <div ref={dropdownRef} className={`user-dropDown-menu-content ${isActive ? 'active' : 'inactive'}`}>\r\n <ul>\r\n <li>\r\n <a>\r\n <FontAwesomeIcon icon=\"user\"></FontAwesomeIcon> Account\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </a>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n <div className=\"settings-button-container\">\r\n <button>\r\n <FontAwesomeIcon icon=\"cog\"></FontAwesomeIcon>\r\n Settings\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n <div className=\"teamInformationPage-content-container\">\r\n {/*TODO: components goes here */}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default TeamInfo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\team\\teamOverview\\TeamOverview.jsx",["138","139"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./TeamOverview.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst TeamOverview = () => {\r\n\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n return (\r\n <div className=\"page-content-container\">\r\n <div className=\"content-header\">\r\n <h2 className=\"teamlist-title\">Teams</h2>\r\n <div className=\"buttons-container\">\r\n <button className=\"join-team-button\">\r\n Join Team\r\n </button>\r\n <button className=\"create-new-team-button\">\r\n New team\r\n </button>\r\n </div>\r\n </div>\r\n <div className=\"teamlist\">\r\n <ul>\r\n <li>\r\n <div className=\"team-entry\">\r\n <div className=\"image-team-name\">\r\n <NavLink to=\"/HenriksMemeMachine\" className=\"team-image-container\">\r\n <FontAwesomeIcon className=\"team-icon\" icon=\"dice-d6\"></FontAwesomeIcon>\r\n </NavLink>\r\n <NavLink to=\"/HenriksMemeMachine\">Henriks meme machine - ReactApp \r\n <FontAwesomeIcon className=\"icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </NavLink>\r\n </div>\r\n <div className=\"team-status-info-container\">\r\n <div className=\"new-messages-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"envelope\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">New messages</span>\r\n </div>\r\n <div className=\"projects-maintained-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"project-diagram\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Projects maintained</span>\r\n </div>\r\n <div className=\"team-members-info\">\r\n <FontAwesomeIcon className=\"icon\" icon=\"users\"></FontAwesomeIcon>\r\n <p>0</p>\r\n <span className=\"tooltip-text\">Team members</span>\r\n </div>\r\n <div className=\"last-updated-info\">\r\n <p>Date created: 21/ 07/ 2021</p>\r\n </div>\r\n </div>\r\n </div>\r\n </li>\r\n </ul>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default TeamOverview","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\reportForm\\assign\\Assign.jsx",["140","141","142","143","144","145"],"import React, { useState } from 'react'\r\nimport \"./Assign.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\n\r\nconst Assign = () => {\r\n const personalProjects = [\r\n { id: \"MyApp\", type: \"personal\" },\r\n { id: \"MyOtherApp\", type: \"personal\" }\r\n ]\r\n\r\n const sharedProjects = [\r\n { id: \"ReactApp\", type: \"shared\", teams: [{ name: \"Henriks Meme Machine\" }, { name: \"Teskeholdet\" }] },\r\n { id: \"Very big ReactApp\", type: \"shared\", teams: [{ name: \"Aubergine\" }] }\r\n ]\r\n\r\n\r\n const rootDirectoryObjects = [\r\n { id: \"Personal projects\" },\r\n { id: \"Shared projects\" }\r\n ]\r\n\r\n const DirectoryItems = () => {\r\n return (\r\n <div className=\"multi-level\">\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"A\" />\r\n <label for=\"A\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a> {rootDirectoryObjects[0].id} </a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {personalProjects.map((elements, index) => (\r\n <li className=\"personalProjectsItem\">\r\n <input type=\"checkbox\" id={`A-${index}`} />\r\n <label for={`A-${index}`}>\r\n <FontAwesomeIcon icon=\"angle-right\" className=\"project-icon\"></FontAwesomeIcon>\r\n <a> {personalProjects[index].id} </a>\r\n </label>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n\r\n <div className=\"item\">\r\n <input type=\"checkbox\" id=\"B\" />\r\n <label for=\"B\">\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a> {rootDirectoryObjects[1].id} </a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects.map((elements, index) => (\r\n <li><div className=\"sub-item\">\r\n <input type=\"checkbox\" id={`B-${index}`} />\r\n <label for={`B-${index}`}>\r\n <FontAwesomeIcon icon=\"folder\" className=\"folder-icon\"></FontAwesomeIcon>\r\n <a> {sharedProjects[index].id} </a>\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"arrow-right-icon\"></FontAwesomeIcon>\r\n </label>\r\n\r\n <ul>\r\n {sharedProjects[index].teams.map(team => (\r\n <li><div className=\"team-item\">\r\n <input type=\"checkbox\" id={`team-${team.name}`} />\r\n <label for={`team-${team.name}`}>\r\n <FontAwesomeIcon icon=\"users\" className=\"users-icon\"></FontAwesomeIcon>\r\n <a> {team.name} </a>\r\n </label>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </li>\r\n ))}\r\n </ul>\r\n </div>\r\n </div>\r\n\r\n )\r\n }\r\n\r\n return (\r\n <div className=\"assignSelectContainer\">\r\n <DirectoryItems />\r\n </div >\r\n )\r\n}\r\n\r\nexport default Assign","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\home\\updates\\Updates.jsx",["146","147","148","149"],"import React from 'react'\r\nimport \"./Updates.css\"\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport useMessages from '../../../util/useMessages'\r\n\r\nconst Updates = () => {\r\n const messages = useMessages()\r\n\r\n return (\r\n <div className=\"project-updates-new-messages-container\">\r\n\r\n <div className=\"project-updates-display-container\">\r\n <div className=\"project-updates-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"exclamation\"></FontAwesomeIcon>\r\n New project updates\r\n </p>\r\n </div>\r\n <div className=\"project-updates-display-content\">\r\n <div className=\"project-update-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [project] [new issues] [issues fixed]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"new-messages-display-container\">\r\n <div className=\"new-messages-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon>\r\n New messages\r\n </p>\r\n </div>\r\n {messages ? messages.map((message) => (\r\n <div className=\"new-messages-display-content\">\r\n <div className=\"new-message-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [{message.sender}] [{message.id}]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [team] [{message.date}]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n )) : \"Loading messages\"}\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default Updates","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activitiesDisplay\\ActivitiesDisplay.jsx",["150","151","152","153"],"import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport React from 'react'\r\nimport \"./ActivitiesDisplay.css\"\r\n\r\nconst ActivitiesDisplay = () => {\r\n return (\r\n <div className=\"activity-new-issues-display-container\">\r\n\r\n <div className=\"new-issues-display-container\">\r\n <div className=\"new-issues-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"inbox\"></FontAwesomeIcon>\r\n New issue reports\r\n </p>\r\n </div>\r\n <div className=\"new-issues-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Severity] [type]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <div className=\"activity-display-container\">\r\n <div className=\"activity-display-header\">\r\n <p>\r\n <FontAwesomeIcon icon=\"sticky-note\"></FontAwesomeIcon>\r\n Recent Team activities\r\n </p>\r\n </div>\r\n <div className=\"activity-display-content\">\r\n <div className=\"new-issue-report-entry\">\r\n <div className=\"entry-text\">\r\n <div className=\"upper-row\">\r\n <a>\r\n [Name] [action]\r\n </a>\r\n </div>\r\n <div className=\"bottom-row\">\r\n <a>\r\n [project] [time]\r\n </a>\r\n </div>\r\n </div>\r\n <div>\r\n <FontAwesomeIcon className=\"entry-icon\" icon=\"chevron-right\"></FontAwesomeIcon>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default ActivitiesDisplay","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\project\\projectInfo\\activityChart\\ActivityChart.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\Navbar.jsx",["154"],"import React from 'react'\r\nimport { useOktaAuth } from '@okta/okta-react';\r\nimport \"./Navbar.css\"\r\nimport Logo from './logo/Logo'\r\nimport NavLinks from './navLinks/NavLinks'\r\nimport Searchbar from './searchbar/Searchbar'\r\nimport NavbarDropdownMenu from './dropdownMenu/NavbarDropdownMenu'\r\n\r\nconst Navbar = () => {\r\n const { authState, oktaAuth } = useOktaAuth();\r\n\r\n if (!authState || !authState.isAuthenticated) {\r\n return null;\r\n }\r\n\r\n return (\r\n <div className=\"navbar\" >\r\n <div className=\"header-content\">\r\n <div className=\"title-navigation-links-container\">\r\n <Logo />\r\n <NavLinks />\r\n </div>\r\n <div className=\"searchbar-profile-container\">\r\n <ul className=\"right-unstyled-navbar\">\r\n <Searchbar />\r\n <NavbarDropdownMenu />\r\n </ul>\r\n </div>\r\n </div>\r\n </div >\r\n )\r\n}\r\n\r\nexport default Navbar","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\logo\\Logo.jsx",["155","156"],"import React from 'react'\r\nimport { NavLink } from 'react-router-dom'\r\nimport \"./Logo.css\"\r\nimport logo_picture from \"../../../images/bird-logo.jpg\"\r\nimport logo_text from \"../../../images/logo-text.jpg\"\r\n\r\nconst Logo = () => {\r\n return (\r\n <h1 className=\"title\">\r\n <span className=\"title-icon\">\r\n <NavLink to=\"/home\" id=\"logo\">\r\n <img src={logo_picture} width=\"24\" height=\"24\"></img>\r\n <img src={logo_text} width=\"48\" height=\"24\"></img>\r\n </NavLink>\r\n </span>\r\n </h1>\r\n )\r\n}\r\n\r\nexport default Logo","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\navLinks\\NavLinks.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\searchbar\\Searchbar.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\navbar\\dropdownMenu\\NavbarDropdownMenu.jsx",["157"],"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 const [userInfo, setUserInfo] = useState(null);\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 useEffect(() => {\r\n if (!authState.isAuthenticated) {\r\n // When user isn't authenticated, forget any user info\r\n setUserInfo(null);\r\n } else {\r\n oktaAuth.getUser().then(info => {\r\n setUserInfo(info);\r\n });\r\n }\r\n }, [authState, oktaAuth]); // Update if authState changes\r\n\r\n const logout = () => {\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 <NavLink to=\"/account\" onClick={onClick} className=\"top-item\">\r\n <div>\r\n <FontAwesomeIcon icon=\"user\" className=\"item-icon-top\"></FontAwesomeIcon> \r\n </div>\r\n <div className=\"item-top-text\">\r\n <span>\r\n <p className=\"top-row\">Account</p>\r\n <p className=\"bottom-row\">{userInfo ? userInfo.email : \"...\"}</p>\r\n </span>\r\n </div>\r\n <div className=\"item-last-flex-item\">\r\n <FontAwesomeIcon icon=\"chevron-right\" className=\"item-icon-top\"></FontAwesomeIcon>\r\n </div>\r\n </NavLink>\r\n </li>\r\n <li>\r\n <NavLink to=\"/messages\" onClick={onClick}>\r\n <FontAwesomeIcon icon=\"envelope\"></FontAwesomeIcon> 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> 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> 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","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\account\\Account.jsx",[],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\signUp\\SignUp.jsx",["158","159"],"import React, { useState, useEffect, useRef } from 'react'\r\nimport { FontAwesomeIcon } from '@fortawesome/react-fontawesome'\r\nimport config from '../../../config';\r\nimport \"./SignUp.css\"\r\n\r\nconst SignUp = () => {\r\n const [signUpFormVisibilityState, showSignUpForm] = useState(false)\r\n const signUpFormRef = useRef(null);\r\n const toggleSignUpFormVisible = () => showSignUpForm(!signUpFormVisibilityState)\r\n\r\n useEffect(() => {\r\n const pageClickEvent = (e) => {\r\n if (signUpFormRef.current !== null && !signUpFormRef.current.contains(e.target)) {\r\n toggleSignUpFormVisible()\r\n }\r\n };\r\n\r\n // If the item is active (ie open) then listen for clicks\r\n if (signUpFormVisibilityState) {\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 }, [signUpFormVisibilityState]);\r\n\r\n const [firstname, setfirstname] = useState('')\r\n const [lastname, setlastname] = useState('')\r\n const [username, setUsername] = useState('');\r\n const [password, setPassword] = useState('');\r\n const [confirmPassword, setConfirmPassword] = useState('');\r\n\r\n const userInputData = JSON.stringify({\r\n firstname: `${firstname}`,\r\n lastname: `${lastname}`,\r\n email: `${username}`,\r\n password: `${password}`\r\n })\r\n\r\n const loginRequestOptions = {\r\n method: 'POST',\r\n body: userInputData\r\n };\r\n\r\n const handlefirstnameChange = (e) => {\r\n setfirstname(e.target.value)\r\n }\r\n\r\n const handlelastnameChange = (e) => {\r\n setlastname(e.target.value)\r\n }\r\n\r\n const handleUsernameChange = (e) => {\r\n setUsername(e.target.value);\r\n };\r\n\r\n const handlePasswordChange = (e) => {\r\n setPassword(e.target.value)\r\n }\r\n\r\n const handleConfirmPasswordChange = (e) => {\r\n setConfirmPassword(e.target.value)\r\n }\r\n\r\n const handleSignUpFormSubmit = (e) => {\r\n e.preventDefault();\r\n\r\n if (!password || !confirmPassword) {\r\n window.alert(\"A password field is blank\")\r\n return\r\n }\r\n\r\n if (!(confirmPassword.length >= 7)) {\r\n window.alert(\"Password must consist of 8 characters or more\")\r\n return\r\n }\r\n\r\n if (!(password == confirmPassword)) {\r\n window.alert(\"Passwords fo not match\")\r\n return\r\n }\r\n\r\n else {\r\n fetch(config.serviceAPI.createNewUserURL, loginRequestOptions)\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 // handleSignInFormSubmit(e)\r\n }\r\n })\r\n }\r\n }\r\n\r\n return (\r\n <div className=\"signUpContainer\">\r\n <div className={`modal ${signUpFormVisibilityState ? \"active\" : \"inactive\"}`}>\r\n <div ref={signUpFormRef} className=\"modal-content\">\r\n <div className=\"signUpForm\">\r\n <h2>Sign Up</h2>\r\n <form onSubmit={handleSignUpFormSubmit}>\r\n <label>\r\n First name:\r\n <input\r\n id=\"firstname\" type=\"text\"\r\n value={firstname}\r\n onChange={handlefirstnameChange} />\r\n </label>\r\n <label>\r\n Last Name:\r\n <input\r\n id=\"lastname\" type=\"text\"\r\n value={lastname}\r\n onChange={handlelastnameChange} />\r\n </label>\r\n <label>\r\n Email:\r\n <input\r\n id=\"email\" type=\"text\"\r\n value={username}\r\n onChange={handleUsernameChange} />\r\n </label>\r\n <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>\r\n Confirm Password:\r\n <input\r\n id=\"password\" type=\"password\"\r\n value={confirmPassword}\r\n onChange={handleConfirmPasswordChange} />\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 \r\n <FontAwesomeIcon icon=\"user-plus\"></FontAwesomeIcon>\r\n </button>\r\n </form>\r\n </div>\r\n </div>\r\n </div>\r\n\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 <button className=\"signUpForm-show-button\" onClick={toggleSignUpFormVisible}>\r\n Sign up\r\n </button>\r\n </div>\r\n </div>\r\n </div>\r\n\r\n )\r\n}\r\n\r\nexport default SignUp\r\n","C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\pages\\login\\passwordReset\\PasswordForgotModal.jsx",["160","161"],"C:\\Users\\Bruger\\Desktop\\Web-projects\\pipit\\client\\src\\components\\messageModal\\MessageModal.jsx",["162","163","164","165"],"import React, { useState, useEffect, useRef } from 'react'\r\n\r\nconst MessageModal = ({ removeModal, headerMessage, bodyMessage }) => {\r\n const stopProp = e => {\r\n e.stopPropagation()\r\n }\r\n\r\n return (\r\n <div className=\"modal-content\" onClick={e => removeModal()}>\r\n <div className=\"submitOkModal\">\r\n <h2>{headerMessage}</h2>\r\n <label>\r\n {bodyMessage}\r\n </label>\r\n <button className=\"formSubmitButton\" onClick={e => removeModal()}>\r\n Ok\r\n </button>\r\n </div>\r\n </div>\r\n )\r\n}\r\n\r\nexport default MessageModal\r\n",{"ruleId":"166","replacedBy":"167"},{"ruleId":"168","replacedBy":"169"},{"ruleId":"170","severity":1,"message":"171","line":1,"column":1,"nodeType":"172","endLine":15,"endColumn":3},{"ruleId":"173","severity":1,"message":"174","line":47,"column":6,"nodeType":"175","endLine":47,"endColumn":17,"suggestions":"176"},{"ruleId":"166","replacedBy":"177"},{"ruleId":"168","replacedBy":"178"},{"ruleId":"179","severity":1,"message":"180","line":1,"column":27,"nodeType":"181","messageId":"182","endLine":1,"endColumn":36},{"ruleId":"179","severity":1,"message":"183","line":1,"column":38,"nodeType":"181","messageId":"182","endLine":1,"endColumn":44},{"ruleId":"179","severity":1,"message":"184","line":6,"column":10,"nodeType":"181","messageId":"182","endLine":6,"endColumn":17},{"ruleId":"179","severity":1,"message":"185","line":7,"column":8,"nodeType":"181","messageId":"182","endLine":7,"endColumn":14},{"ruleId":"179","severity":1,"message":"186","line":8,"column":8,"nodeType":"181","messageId":"182","endLine":8,"endColumn":14},{"ruleId":"179","severity":1,"message":"187","line":32,"column":9,"nodeType":"181","messageId":"182","endLine":32,"endColumn":28},{"ruleId":"179","severity":1,"message":"188","line":1,"column":17,"nodeType":"181","messageId":"182","endLine":1,"endColumn":25},{"ruleId":"189","severity":1,"message":"190","line":75,"column":11,"nodeType":"191","endLine":75,"endColumn":123},{"ruleId":"189","severity":1,"message":"190","line":76,"column":11,"nodeType":"191","endLine":76,"endColumn":127},{"ruleId":"189","severity":1,"message":"190","line":43,"column":19,"nodeType":"191","endLine":43,"endColumn":22},{"ruleId":"179","severity":1,"message":"192","line":8,"column":9,"nodeType":"181","messageId":"182","endLine":8,"endColumn":25},{"ruleId":"179","severity":1,"message":"193","line":13,"column":9,"nodeType":"181","messageId":"182","endLine":13,"endColumn":23},{"ruleId":"179","severity":1,"message":"188","line":1,"column":17,"nodeType":"181","messageId":"182","endLine":1,"endColumn":25},{"ruleId":"189","severity":1,"message":"190","line":29,"column":13,"nodeType":"191","endLine":29,"endColumn":16},{"ruleId":"189","severity":1,"message":"190","line":39,"column":19,"nodeType":"191","endLine":39,"endColumn":22},{"ruleId":"189","severity":1,"message":"190","line":50,"column":13,"nodeType":"191","endLine":50,"endColumn":16},{"ruleId":"189","severity":1,"message":"190","line":60,"column":19,"nodeType":"191","endLine":60,"endColumn":22},{"ruleId":"189","severity":1,"message":"190","line":70,"column":25,"nodeType":"191","endLine":70,"endColumn":28},{"ruleId":"189","severity":1,"message":"190","line":23,"column":17,"nodeType":"191","endLine":23,"endColumn":20},{"ruleId":"189","severity":1,"message":"190","line":28,"column":17,"nodeType":"191","endLine":28,"endColumn":20},{"ruleId":"189","severity":1,"message":"190","line":52,"column":19,"nodeType":"191","endLine":52,"endColumn":22},{"ruleId":"189","severity":1,"message":"190","line":57,"column":19,"nodeType":"191","endLine":57,"endColumn":22},{"ruleId":"189","severity":1,"message":"190","line":20,"column":17,"nodeType":"191","endLine":20,"endColumn":20},{"ruleId":"189","severity":1,"message":"190","line":25,"column":17,"nodeType":"191","endLine":25,"endColumn":20},{"ruleId":"189","severity":1,"message":"190","line":48,"column":17,"nodeType":"191","endLine":48,"endColumn":20},{"ruleId":"189","severity":1,"message":"190","line":53,"column":17,"nodeType":"191","endLine":53,"endColumn":20},{"ruleId":"179","severity":1,"message":"194","line":10,"column":22,"nodeType":"181","messageId":"182","endLine":10,"endColumn":30},{"ruleId":"195","severity":1,"message":"196","line":12,"column":11,"nodeType":"191","endLine":12,"endColumn":58},{"ruleId":"195","severity":1,"message":"196","line":13,"column":11,"nodeType":"191","endLine":13,"endColumn":55},{"ruleId":"189","severity":1,"message":"190","line":88,"column":15,"nodeType":"191","endLine":88,"endColumn":35},{"ruleId":"173","severity":1,"message":"197","line":27,"column":6,"nodeType":"175","endLine":27,"endColumn":33,"suggestions":"198"},{"ruleId":"199","severity":1,"message":"200","line":80,"column":20,"nodeType":"201","messageId":"202","endLine":80,"endColumn":22},{"ruleId":"173","severity":1,"message":"203","line":38,"column":6,"nodeType":"175","endLine":38,"endColumn":41,"suggestions":"204"},{"ruleId":"189","severity":1,"message":"190","line":71,"column":11,"nodeType":"191","endLine":71,"endColumn":56},{"ruleId":"179","severity":1,"message":"188","line":1,"column":17,"nodeType":"181","messageId":"182","endLine":1,"endColumn":25},{"ruleId":"179","severity":1,"message":"180","line":1,"column":27,"nodeType":"181","messageId":"182","endLine":1,"endColumn":36},{"ruleId":"179","severity":1,"message":"183","line":1,"column":38,"nodeType":"181","messageId":"182","endLine":1,"endColumn":44},{"ruleId":"179","severity":1,"message":"205","line":4,"column":9,"nodeType":"181","messageId":"182","endLine":4,"endColumn":17},"no-native-reassign",["206"],"no-negated-in-lhs",["207"],"import/no-anonymous-default-export","Assign object to a variable before exporting as module default","ExportDefaultDeclaration","react-hooks/exhaustive-deps","React Hook useEffect has a missing dependency: 'oktaAuth'. Either include it or remove the dependency array.","ArrayExpression",["208"],["206"],["207"],"no-unused-vars","'useEffect' is defined but never used.","Identifier","unusedVar","'useRef' is defined but never used.","'NavLink' is defined but never used.","'signUp' is defined but never used.","'config' is defined but never used.","'loginRequestOptions' is assigned a value but never used.","'useState' is defined but never used.","jsx-a11y/anchor-is-valid","The href attribute is required for an anchor to be keyboard accessible. Provide a valid, navigable address as the href value. If you cannot provide an href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md","JSXOpeningElement","'personalProjects' is assigned a value but never used.","'sharedProjects' is assigned a value but never used.","'oktaAuth' is assigned a value but never used.","jsx-a11y/alt-text","img elements must have an alt prop, either with meaningful text, or an empty string for decorative images.","React Hook useEffect has a missing dependency: 'toggleSignUpFormVisible'. Either include it or remove the dependency array.",["209"],"eqeqeq","Expected '===' and instead saw '=='.","BinaryExpression","unexpected","React Hook useEffect has a missing dependency: 'toggleForgotPasswordFormVisible'. Either include it or remove the dependency array.",["210"],"'stopProp' is assigned a value but never used.","no-global-assign","no-unsafe-negation",{"desc":"211","fix":"212"},{"desc":"213","fix":"214"},{"desc":"215","fix":"216"},"Update the dependencies array to be: [authState, oktaAuth]",{"range":"217","text":"218"},"Update the dependencies array to be: [signUpFormVisibilityState, toggleSignUpFormVisible]",{"range":"219","text":"220"},"Update the dependencies array to be: [forgotPasswordFormVisibilityState, toggleForgotPasswordFormVisible]",{"range":"221","text":"222"},[1422,1433],"[authState, oktaAuth]",[873,900],"[signUpFormVisibilityState, toggleSignUpFormVisible]",[1372,1407],"[forgotPasswordFormVisibilityState, toggleForgotPasswordFormVisible]"]
\ No newline at end of file
client/node_modules/.cache/babel-loader/00d916ec449316b41a399d99f3a51bd6.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState);
\n\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = e => {
\n
e.preventDefault();
\n
toggleForgotPasswordFormVisible();
\n
setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\n
// .then((res) => {
\n
// if (!res.ok) {
\n
// window.alert(
\"
Error: something went wrong
\"
)
\n
// Promise.reject(
\"\"
)
\n
// return
\n
// }
\n
// if (res.ok) {
\n
// toggleSubmitOkModalVisible()
\n
// }
\n
// })
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 68,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 67,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 66,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 76,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 80,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 78,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 85,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 90,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 75,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 74,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 73,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(MessageModal, {
\n
removeModal: () => setSubmitOkMessageModalState(false),
\n
headerMessage:
\"
Email submitted!
\"
,
\n
bodyMessage:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
g4WkMIawwrBahYMYonVecg/0JA0=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"forgotPasswordFormVisibilityState"
,
"setForgotPasswordFormVisibilityState"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"submitOkMessageModalState"
,
"setSubmitOkMessageModalState"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"preventDefault"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC,QAAM,CAACC,iCAAD,EAAoCC,oCAApC,IAA4ER,QAAQ,CAAC,KAAD,CAA1F;AACA,QAAMS,qBAAqB,GAAGR,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMS,+BAA+B,GAAG,MAAMF,oCAAoC,CAAC,CAACD,iCAAF,CAAlF;;AAEA,QAAM,CAACI,yBAAD,EAA4BC,4BAA5B,IAA4DZ,QAAQ,CAAC,KAAD,CAA1E;AAEA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;;AACA,QAAMe,oBAAoB,GAAIC,CAAD,IAAO;AAClCF,IAAAA,WAAW,CAACE,CA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A,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)
\r\n\r\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
toggleForgotPasswordFormVisible()
\r\n
setSubmitOkMessageModalState(true)
\r\n
// fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
// .then((res) => {
\r\n
// if (!res.ok) {
\r\n
// window.alert(
\"
Error: something went wrong
\"
)
\r\n
// Promise.reject(
\"\"
)
\r\n
// return
\r\n
// }
\r\n
// if (res.ok) {
\r\n
// toggleSubmitOkModalVisible()
\r\n
// }
\r\n
// })
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/02794e58757097962d70726e27df676c.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
// Submit ok modal
\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);
\n
const submitOkModalRef = useRef(null);
\n\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form
\n\n\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => {
\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState);
\n
};
\n\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (submitOkModalVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [submitOkModalVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = () => {
\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {
\n
if (!res.ok) {
\n
window.alert(
\"
Error: something went wrong
\"
);
\n
Promise.reject(
\"\"
);
\n
return;
\n
}
\n\n
if (res.ok) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
});
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 87,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 101,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 99,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 106,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 111,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 109,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 98,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 95,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 94,
\n
columnNumber: 7
\n
}, this), submitOkModalVisibilityState && /*#__PURE__*/_jsxDEV(MessageModal, {
\n
ref: submitOkModalRef,
\n
headerMessage:
\"
Email submitted!
\"
,
\n
bodyMessage:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 118,
\n
columnNumber: 9
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 86,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
JewdldMzKvoWUXPBjhAQ4J+HRI8=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"submitOkModalVisibilityState"
,
"showSubmitOkModal"
,
"submitOkModalRef"
,
"toggleSubmitOkModalVisible"
,
"forgotPasswordFormVisibilityState"
,
"showForgotPasswordForm"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"fetch"
,
"serviceAPI"
,
"ForgotPasswordURL"
,
"then"
,
"res"
,
"ok"
,
"alert"
,
"Promise"
,
"reject"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,O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Af"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
// Submit ok modal
\r\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)
\r\n
const submitOkModalRef = useRef(null)
\r\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)
\r\n\r\n
// Forgot password form
\r\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => {
\r\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState)
\r\n
}
\r\n\r\n
const [username, setUsername] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (submitOkModalVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [submitOkModalVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = () => {
\r\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
.then((res) => {
\r\n
if (!res.ok) {
\r\n
window.alert(
\"
Error: something went wrong
\"
)
\r\n
Promise.reject(
\"\"
)
\r\n
return
\r\n
}
\r\n
if (res.ok) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
})
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
{submitOkModalVisibilityState && (
\r\n
<MessageModal ref={submitOkModalRef} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
)}
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/02a59571b7b38629bfecf2c3bc8885d2.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
// Submit ok modal
\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);
\n
const submitOkModalRef = useRef(null);
\n\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form
\n\n\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => {
\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState);
\n
};
\n\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (submitOkModalVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [submitOkModalVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
firstname: '',
\n
lastname: '',
\n
email: `${username}`,
\n
password: ''
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = () => {
\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {
\n
if (!res.ok) {
\n
window.alert(
\"
Error: something went wrong
\"
);
\n
Promise.reject(
\"\"
);
\n
return;
\n
}
\n\n
if (res.ok) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
});
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 91,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 90,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 99,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 103,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 101,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 108,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 113,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 111,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\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)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${submitOkModalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: submitOkModalRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
submitOkModal
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Email submitted!
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 124,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 125,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children:
\"
Ok
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 128,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 123,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 122,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 121,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
JewdldMzKvoWUXPBjhAQ4J+HRI8=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"PasswordForgotModal"
,
"submitOkModalVisibilityState"
,
"showSubmitOkModal"
,
"submitOkModalRef"
,
"toggleSubmitOkModalVisible"
,
"forgotPasswordFormVisibilityState"
,
"showForgotPasswordForm"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"firstname"
,
"lastname"
,
"email"
,
"password"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"fetch"
,
"serviceAPI"
,
"ForgotPasswordURL"
,
"then"
,
"res"
,
"ok"
,
"alert"
,
"Promise"
,
"reject"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDP,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMQ,gBAAgB,GAAGP,MAAM,CAAC,IAAD,CAA/B;;AACA,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A;AAAA;AAAA;AAAA;AAAA,kBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAjCF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkDD,CAnID;;GAAMH,mB;;KAAAA,mB;AAqIN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n\r\n
const PasswordForgotModal = () => {
\r\n
// Submit ok modal
\r\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)
\r\n
const submitOkModalRef = useRef(null)
\r\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)
\r\n\r\n
// Forgot password form
\r\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => {
\r\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState)
\r\n
}
\r\n\r\n
const [username, setUsername] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (submitOkModalVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [submitOkModalVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
firstname: '',
\r\n
lastname: '',
\r\n
email: `${username}`,
\r\n
password: ''
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = () => {
\r\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
.then((res) => {
\r\n
if (!res.ok) {
\r\n
window.alert(
\"
Error: something went wrong
\"
)
\r\n
Promise.reject(
\"\"
)
\r\n
return
\r\n
}
\r\n
if (res.ok) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
})
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n\r\n
{/* SubmitOk modal */}
\r\n
<div className={`modal ${submitOkModalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={submitOkModalRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
submitOkModal
\"
>
\r\n
<h2>Email submitted!</h2>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Ok
\r\n
</button>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/04092ccca329ab6cbea0e2e17f39fa66.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState);
\n\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = e => {
\n
e.preventDefault();
\n
toggleForgotPasswordFormVisible();
\n
setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\n
// .then((res) => {
\n
// if (!res.ok) {
\n
// window.alert(
\"
Error: something went wrong
\"
)
\n
// Promise.reject(
\"\"
)
\n
// return
\n
// }
\n
// if (res.ok) {
\n
// toggleSubmitOkModalVisible()
\n
// }
\n
// })
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 68,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 67,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 66,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 76,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 80,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 78,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 85,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 90,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 75,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 74,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 73,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${submitOkMessageModalState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(MessageModal, {
\n
removeModal: () => setSubmitOkMessageModalState(false),
\n
headerMessage:
\"
Email submitted!
\"
,
\n
bodyMessage:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
g4WkMIawwrBahYMYonVecg/0JA0=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"forgotPasswordFormVisibilityState"
,
"setForgotPasswordFormVisibilityState"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"submitOkMessageModalState"
,
"setSubmitOkMessageModalState"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"preventDefault"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC,QAAM,CAACC,iCAAD,EAAoCC,oCAApC,IAA4ER,QAAQ,CAAC,KAAD,CAA1F;AACA,QAAMS,qBAAqB,GAAGR,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMS,+BAA+B,GAAG,MAAMF,oCAAoC,CAAC,CAACD,iCAAF,CAAlF;;AAEA,QAAM,CAACI,yBAAD,EAA4BC,4BAA5B,IAA4DZ,QAAQ,CAAC,KAAD,CAA1E;AAEA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;;AACA,QAAMe,oBAAoB,GAAIC,CAAD,IAAO;AAClCF,IAAAA,WAAW,CAACE,CAAC,CAACC,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIAhB,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMiB,cAAc,GAAIH,CAAD,IAAO;AAC5B,UAAIP,qBAAqB,CAACW,OAAtB,KAAkC,IAAlC,IAA0C,CAACX,qBAAqB,CAACW,OAAtB,CAA8BC,QAA9B,CAAuCL,CAAC,CA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A,QAAQ,EAAEuB,oBAAhB;AAAA,oCACE;AAAA,gDAEE;AACE,gBAAA,EAAE,EAAC,OADL;AACa,gBAAA,IAAI,EAAC,MADlB;AAEE,gBAAA,KAAK,EAAEnB,QAFT;AAGE,gBAAA,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAQE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eA+BE;AAAK,MAAA,SAAS,EAAG,SAAQJ,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,kBAArF;AAAyG,QAAA,WAAW,EAAE;AAAtH;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CA/FD;;GAAMN,mB;;KAAAA,mB;AAiGN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)
\r\n\r\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
toggleForgotPasswordFormVisible()
\r\n
setSubmitOkMessageModalState(true)
\r\n
// fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
// .then((res) => {
\r\n
// if (!res.ok) {
\r\n
// window.alert(
\"
Error: something went wrong
\"
)
\r\n
// Promise.reject(
\"\"
)
\r\n
// return
\r\n
// }
\r\n
// if (res.ok) {
\r\n
// toggleSubmitOkModalVisible()
\r\n
// }
\r\n
// })
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
<div className={`modal ${submitOkMessageModalState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/043d6bfcb9cf4ff57f3c575878ef299f.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = ({
\n
removeFormModal
\n
}) => {
\n
_s();
\n\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\n\n
const stopProp = e => {
\n
e.stopPropagation();
\n
};
\n\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = e => {
\n
e.preventDefault();
\n
removeFormModal();
\n
setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\n
// .then((res) => {
\n
// if (!res.ok) {
\n
// window.alert(
\"
Error: something went wrong
\"
)
\n
// Promise.reject(
\"\"
)
\n
// return
\n
// }
\n
// if (res.ok) {
\n
// toggleSubmitOkModalVisible()
\n
// }
\n
// })
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
modal-background
\"
,
\n
onClick: e => removeFormModal(),
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 50,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 54,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 52,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 61,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 59,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 51,
\n
columnNumber: 11
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 49,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 48,
\n
columnNumber: 7
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 47,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
ccs9TXv4Z39DCQsrqL8dXg2nBZI=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"removeFormModal"
,
"submitOkMessageModalState"
,
"setSubmitOkMessageModalState"
,
"stopProp"
,
"e"
,
"stopPropagation"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"target"
,
"value"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"preventDefault"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAAyB;AAAA;;AACnD,QAAM,CAACC,yBAAD,EAA4BC,4BAA5B,IAA4DT,QAAQ,CAAC,KAAD,CAA1E;;AAEA,QAAMU,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD;;AAIA,QAAM,CAACC,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;;AACA,QAAMe,oBAAoB,GAAIJ,CAAD,IAAO;AAClCG,IAAAA,WAAW,CAACH,CAAC,CAACK,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIA,QAAMC,aAAa,GAAGC,IAAI,CAACC,SAAL,CAAe;AACnCC,IAAAA,KAAK,EAAG,GAAER,QAAS;AADgB,GAAf,CAAtB;AAIA,QAAMS,4BAA4B,GAAG;AACnCC,IAAAA,MAAM,EAAE,KAD2B;AAEnCC,IAAAA,IAAI,EAAEN;AAF6B,GAArC;;AAKA,QAAMO,oBAAoB,GAAId,CAAD,IAAO;AAClCA,IAAAA,CAAC,CAACe,cAAF;AAEAnB,IAAAA,eAAe;AACfE,IAAAA,4BAA4B,CAAC,IAAD,CAA5B,CAJkC,CAKlC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACD,GAhBD;;AAkBA,sBACE;AAAK,IAAA,SAAS,EAAC,kBAAf;AAAkC,IAAA,OAAO,EAAEE,CAAC,IAAIJ,eAAe,EAA/D;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,eAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,qBAAf;AAAA,gCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAM,UAAA,QAAQ,EAAEkB,oBAAhB;AAAA,kCACE;AAAA,8CAEE;AACE,cAAA,EAAE,EAAC,OADL;AACa,cAAA,IAAI,EAAC,MADlB;AAEE,cAAA,KAAK,EAAEZ,QAFT;AAGE,cAAA,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAQE;AAAQ,YAAA,SAAS,EAAC,kBAAlB;AAAqC,YAAA,IAAI,EAAC,QAA1C;AAAA,sDAEE,QAAC,eAAD;AAAiB,cAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBARF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAyBD,CAhED;;GAAMT,mB;;KAAAA,mB;AAkEN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = ({ removeFormModal }) => {
\r\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\r\n\r\n
const stopProp = e => {
\r\n
e.stopPropagation()
\r\n
}
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
removeFormModal()
\r\n
setSubmitOkMessageModalState(true)
\r\n
// fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
// .then((res) => {
\r\n
// if (!res.ok) {
\r\n
// window.alert(
\"
Error: something went wrong
\"
)
\r\n
// Promise.reject(
\"\"
)
\r\n
// return
\r\n
// }
\r\n
// if (res.ok) {
\r\n
// toggleSubmitOkModalVisible()
\r\n
// }
\r\n
// })
\r\n
}
\r\n\r\n
return (
\r\n
<div className=
\"
modal-background
\"
onClick={e => removeFormModal()}>
\r\n
<div className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
{/* <div className={`modal ${submitOkMessageModalState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
</div> */}
\r\n
</div>
\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/064093c28affbcd07cc2933bbe925461.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
Login.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useEffect, useRef } from 'react';
\n
import { Redirect } from 'react-router-dom';
\n
import { useOktaAuth } from '@okta/okta-react';
\n
import
\"
./Login.css
\"
;
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import { NavLink } from 'react-router-dom';
\n
import signUp from './signUp/SignUp';
\n
import config from '../../config';
\n
import SignUp from './signUp/SignUp';
\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const Login = () => {
\n
_s();
\n\n
const {
\n
authState,
\n
oktaAuth
\n
} = useOktaAuth();
\n
const [sessionToken, setSessionToken] = useState();
\n
const [username, setUsername] = useState('');
\n
const [password, setPassword] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
const handlePasswordChange = e => {
\n
setPassword(e.target.value);
\n
};
\n\n
const userInputData = JSON.stringify({
\n
email: `${username}`,
\n
password: `${password}`
\n
});
\n
const loginRequestOptions = {
\n
method: 'POST',
\n
body: userInputData
\n
};
\n\n
const handleSignInFormSubmit = e => {
\n
e.preventDefault();
\n
oktaAuth.signInWithCredentials({
\n
username,
\n
password
\n
}).then(res => {
\n
const sessionToken = res.sessionToken;
\n
setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once
\n\n
oktaAuth.signInWithRedirect({
\n
sessionToken,
\n
originalUri: '/home'
\n
});
\n
}).catch(err => console.log('Found an error', err));
\n
};
\n\n
if (sessionToken) {
\n
// Hide form while sessionToken is converted into id/access tokens
\n
return null;
\n
}
\n\n
if (!authState || !authState.isAuthenticated) {
\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
pageContainer
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(SignUp, {}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 58,
\n
columnNumber: 9
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
signInForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Sign in to PipIt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 61,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handleSignInFormSubmit,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
username
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 63,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Password:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
password
\"
,
\n
type:
\"
password
\"
,
\n
value: password,
\n
onChange: handlePasswordChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 72,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 70,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Sign in
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
sign-in-alt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 79,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 62,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(PasswordForgotModal, {
\n
loginFormUsername: parseFloat(username)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 82,
\n
columnNumber: 11
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 60,
\n
columnNumber: 9
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 57,
\n
columnNumber: 7
\n
}, this);
\n
} else {
\n
return /*#__PURE__*/_jsxDEV(Redirect, {
\n
to:
\"
/home
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 87,
\n
columnNumber: 12
\n
}, this);
\n
}
\n
};
\n\n
_s(Login,
\"
u8yY6NlW4PSOG6xgLhGhaVL5lVE=
\"
, false, function () {
\n
return [useOktaAuth];
\n
});
\n\n
_c = Login;
\n
export default Login;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
Login
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/Login.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useEffect"
,
"useRef"
,
"Redirect"
,
"useOktaAuth"
,
"FontAwesomeIcon"
,
"NavLink"
,
"signUp"
,
"config"
,
"SignUp"
,
"PasswordForgotModal"
,
"Login"
,
"authState"
,
"oktaAuth"
,
"sessionToken"
,
"setSessionToken"
,
"username"
,
"setUsername"
,
"password"
,
"setPassword"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"handlePasswordChange"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"loginRequestOptions"
,
"method"
,
"body"
,
"handleSignInFormSubmit"
,
"preventDefault"
,
"signInWithCredentials"
,
"then"
,
"res"
,
"signInWithRedirect"
,
"originalUri"
,
"catch"
,
"err"
,
"console"
,
"log"
,
"isAuthenticated"
,
"parseFloat"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,aAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,mBAAP,MAAgC,qCAAhC;;;AAEA,MAAMC,KAAK,GAAG,MAAM;AAAA;;AAClB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BT,WAAW,EAA3C;AACA,QAAM,CAACU,YAAD,EAAeC,eAAf,IAAkCf,QAAQ,EAAhD;AAEA,QAAM,CAACgB,QAAD,EAAWC,WAAX,IAA0BjB,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACkB,QAAD,EAAWC,WAAX,IAA0BnB,QAAQ,CAAC,EAAD,CAAxC;;AAEA,QAAMoB,oBAAoB,GAAIC,CAAD,IAAO;AAClCJ,IAAAA,WAAW,CAACI,CAAC,CAACC,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIA,QAAMC,oBAAoB,GAAIH,CAAD,IAAO;AAClCF,IAAAA,WAAW,CAACE,CAAC,CAACC,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIA,QAAME,aAAa,GAAGC,IAAI,CA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I;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAQE;AAAA,iDAEE;AACE,cAAA,EAAE,EAAC,UADL;AACgB,cAAA,IAAI,EAAC,UADrB;AAEE,cAAA,KAAK,EAAEF,QAFT;AAGE,cAAA,QAAQ,EAAEM;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBARF,eAeE;AAAQ,YAAA,SAAS,EAAC,kBAAlB;AAAqC,YAAA,IAAI,EAAC,QAA1C;AAAA,uDAEE,QAAC,eAAD;AAAiB,cAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAfF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF,eAsBE,QAAC,mBAAD;AAAqB,UAAA,iBAAiB,EAAEoB,UAAU,CAAC5B,QAAD;AAAlD;AAAA;AAAA;AAAA;AAAA,gBAtBF;AAAA;AAAA;AAAA;AAAA;AAAA,cAHF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF;AA8BD,GA/BD,MA+BO;AACL,wBAAO,QAAC,QAAD;AAAU,MAAA,EAAE,EAAC;AAAb;AAAA;AAAA;AAAA;AAAA,YAAP;AACD;AACF,CA7ED;;GAAML,K;UAC4BP,W;;;KAD5BO,K;AA+EN,eAAeA,KAAf"
,
"sourcesContent"
:[
"import React, { useState, useEffect, useRef } from 'react';
\r\n
import { Redirect } from 'react-router-dom'
\r\n
import { useOktaAuth } from '@okta/okta-react';
\r\n
import
\"
./Login.css
\"\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
\r\n
import { NavLink } from 'react-router-dom';
\r\n
import signUp from './signUp/SignUp';
\r\n
import config from '../../config';
\r\n
import SignUp from './signUp/SignUp';
\r\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\r\n\r\n
const Login = () => {
\r\n
const { authState, oktaAuth } = useOktaAuth();
\r\n
const [sessionToken, setSessionToken] = useState()
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const [password, setPassword] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
const handlePasswordChange = (e) => {
\r\n
setPassword(e.target.value)
\r\n
}
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
password: `${password}`
\r\n
})
\r\n\r\n
const loginRequestOptions = {
\r\n
method: 'POST',
\r\n
body: userInputData
\r\n
};
\r\n\r\n
const handleSignInFormSubmit = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
oktaAuth.signInWithCredentials({ username, password })
\r\n
.then(res => {
\r\n
const sessionToken = res.sessionToken;
\r\n
setSessionToken(sessionToken);
\r\n
// sessionToken is a one-use token, so make sure this is only called once
\r\n
oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });
\r\n
})
\r\n
.catch(err => console.log('Found an error', err));
\r\n
};
\r\n\r\n
if (sessionToken) {
\r\n
// Hide form while sessionToken is converted into id/access tokens
\r\n
return null;
\r\n
}
\r\n\r\n
if (!authState || !authState.isAuthenticated) {
\r\n
return (
\r\n
<div className=
\"
pageContainer
\"
>
\r\n
<SignUp />
\r\n\r\n
<div className=
\"
signInForm
\"
>
\r\n
<h2>Sign in to PipIt</h2>
\r\n
<form onSubmit={handleSignInFormSubmit}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
username
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
Password:
\r\n
<input
\r\n
id=
\"
password
\"
type=
\"
password
\"\r\n
value={password}
\r\n
onChange={handlePasswordChange} />
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Sign in
\r\n
<FontAwesomeIcon icon=
\"
sign-in-alt
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
<PasswordForgotModal loginFormUsername={parseFloat(username)} />
\r\n
</div>
\r\n
</div>
\r\n
)
\r\n
} else {
\r\n
return <Redirect to=
\"
/home
\"
/>
\r\n
}
\r\n
}
\r\n\r\n
export default Login"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/094bd105da9ed9c4ed1b373b3428f44c.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState);
\n\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = e => {
\n
e.preventDefault();
\n
window.alert(userInputData);
\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {
\n
if (!res.ok) {
\n
window.alert(
\"
Error: something went wrong
\"
);
\n
Promise.reject(
\"\"
);
\n
return;
\n
}
\n\n
if (res.ok) {
\n
toggleForgotPasswordFormVisible();
\n
setSubmitOkMessageModalState(true);
\n
}
\n
});
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 69,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 68,
\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: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 81,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 79,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 86,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 91,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 78,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 76,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 75,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 74,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${submitOkMessageModalState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(MessageModal, {
\n
removeModal: () => setSubmitOkMessageModalState(false),
\n
headerMessage:
\"
Email submitted!
\"
,
\n
bodyMessage:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 98,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 66,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
g4WkMIawwrBahYMYonVecg/0JA0=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"forgotPasswordFormVisibilityState"
,
"setForgotPasswordFormVisibilityState"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"submitOkMessageModalState"
,
"setSubmitOkMessageModalState"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"preventDefault"
,
"alert"
,
"fetch"
,
"serviceAPI"
,
"ForgotPasswordURL"
,
"then"
,
"res"
,
"ok"
,
"Promise"
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BAAhB;AAAA,oCACE;AAAA,gDAEE;AACE,gBAAA,EAAE,EAAC,OADL;AACa,gBAAA,IAAI,EAAC,MADlB;AAEE,gBAAA,KAAK,EAAEnB,QAFT;AAGE,gBAAA,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAQE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eA+BE;AAAK,MAAA,SAAS,EAAG,SAAQJ,yBAAyB,GAAG,QAAH,GAAc,UAAW,EAA3E;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMC,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,kBAArF;AAAyG,QAAA,WAAW,EAAE;AAAtH;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CAhGD;;GAAMN,mB;;KAAAA,mB;AAkGN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)
\r\n\r\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\r\n\r\n
const [username, setUsername] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = (e) => {
\r\n
e.preventDefault();
\r\n
window.alert(userInputData)
\r\n\r\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
.then((res) => {
\r\n
if (!res.ok) {
\r\n
window.alert(
\"
Error: something went wrong
\"
)
\r\n
Promise.reject(
\"\"
)
\r\n
return
\r\n
}
\r\n
if (res.ok) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
setSubmitOkMessageModalState(true)
\r\n
}
\r\n
})
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
<div className={`modal ${submitOkMessageModalState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/0b78da76fda3607976341e47eeb2203f.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
// Submit ok modal
\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);
\n
const submitOkModalRef = useRef(null);
\n\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form
\n\n\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => {
\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState);
\n
};
\n\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (submitOkModalVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [submitOkModalVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = () => {
\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {
\n
if (!res.ok) {
\n
window.alert(
\"
Error: something went wrong
\"
);
\n
Promise.reject(
\"\"
);
\n
return;
\n
}
\n\n
if (res.ok) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
});
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 87,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 101,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 99,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 106,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 111,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 109,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 98,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 95,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 94,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(MessageModal, {
\n
ref: submitOkModalRef,
\n
headerMessage:
\"
Email submitted!
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 117,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 86,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
JewdldMzKvoWUXPBjhAQ4J+HRI8=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"submitOkModalVisibilityState"
,
"showSubmitOkModal"
,
"submitOkModalRef"
,
"toggleSubmitOkModalVisible"
,
"forgotPasswordFormVisibilityState"
,
"showForgotPasswordForm"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"fetch"
,
"serviceAPI"
,
"ForgotPasswordURL"
,
"then"
,
"res"
,
"ok"
,
"alert"
,
"Promise"
,
"reject"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDR,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMS,gBAAgB,GAAGR,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMS,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJgC,CAMhC;;;AACA,QAAM,CAACI,iCAAD,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eAEE;AAAM,YAAA,QAAQ,EAAEqB,oBAAhB;AAAA,oCACE;AAAA,gDAEE;AACE,gBAAA,EAAE,EAAC,OADL;AACa,gBAAA,IAAI,EAAC,MADlB;AAEE,gBAAA,KAAK,EAAEnB,QAFT;AAGE,gBAAA,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAQE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eA+BE,QAAC,YAAD;AAAc,MAAA,GAAG,EAAER,gBAAnB;AAAqC,MAAA,aAAa,EAAE;AAApD;AAAA;AAAA;AAAA;AAAA,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAoCD,CAlHD;;GAAMH,mB;;KAAAA,mB;AAoHN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
// Submit ok modal
\r\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)
\r\n
const submitOkModalRef = useRef(null)
\r\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)
\r\n\r\n
// Forgot password form
\r\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => {
\r\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState)
\r\n
}
\r\n\r\n
const [username, setUsername] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (submitOkModalVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [submitOkModalVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = () => {
\r\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
.then((res) => {
\r\n
if (!res.ok) {
\r\n
window.alert(
\"
Error: something went wrong
\"
)
\r\n
Promise.reject(
\"\"
)
\r\n
return
\r\n
}
\r\n
if (res.ok) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
})
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
<MessageModal ref={submitOkModalRef} headerMessage={
\"
Email submitted!
\"
} />
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/0c872dfc6b53b1558e70b36a93efcc01.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState);
\n\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = e => {
\n
e.preventDefault();
\n
toggleForgotPasswordFormVisible(); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\n
// .then((res) => {
\n
// if (!res.ok) {
\n
// window.alert(
\"
Error: something went wrong
\"
)
\n
// Promise.reject(
\"\"
)
\n
// return
\n
// }
\n
// if (res.ok) {
\n
// toggleSubmitOkModalVisible()
\n
// }
\n
// })
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 67,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 66,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 75,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 79,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 84,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 87,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 76,
\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, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 72,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(MessageModal, {
\n
activeState:
\"
false
\"
,
\n
headerMessage:
\"
Email submitted!
\"
,
\n
bodyMessage:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 95,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 64,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
g4WkMIawwrBahYMYonVecg/0JA0=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"forgotPasswordFormVisibilityState"
,
"setForgotPasswordFormVisibilityState"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"submitOkMessageModalState"
,
"setSubmitOkMessageModalState"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"preventDefault"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC,QAAM,CAACC,iCAAD,EAAoCC,oCAApC,IAA4ER,QAAQ,CAAC,KAAD,CAA1F;AACA,QAAMS,qBAAqB,GAAGR,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMS,+BAA+B,GAAG,MAAMF,oCAAoC,CAAC,CAACD,iCAAF,CAAlF;;AAEA,QAAM,CAACI,yBAAD,EAA4BC,4BAA5B,IAA4DZ,QAAQ,CAAC,KAAD,CAA1E;AAEA,QAAM,CAACa,QAAD,EAAWC,WAAX,IAA0Bd,QAAQ,CAAC,EAAD,CAAxC;;AACA,QAAMe,oBAAoB,GAAIC,CAAD,IAAO;AAClCF,IAAAA,WAAW,CAACE,CAAC,CAACC,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIAhB,EAAAA,SAAS,CAAC,MAAM;AACd,UAAMiB,cAAc,GAAIH,C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EAAC,qBAAf;AAAA,kCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAEE;AAAM,YAAA,QAAQ,EAAEuB,oBAAhB;AAAA,oCACE;AAAA,gDAEE;AACE,gBAAA,EAAE,EAAC,OADL;AACa,gBAAA,IAAI,EAAC,MADlB;AAEE,gBAAA,KAAK,EAAEnB,QAFT;AAGE,gBAAA,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAQE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eA+BE,QAAC,YAAD;AAAc,MAAA,WAAW,EAAE,OAA3B;AAAoC,MAAA,aAAa,EAAE,kBAAnD;AAAuE,MAAA,WAAW,EAAE;AAApF;AAAA;AAAA;AAAA;AAAA,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAoCD,CA5FD;;GAAMT,mB;;KAAAA,mB;AA8FN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)
\r\n\r\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
toggleForgotPasswordFormVisible()
\r\n
// fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
// .then((res) => {
\r\n
// if (!res.ok) {
\r\n
// window.alert(
\"
Error: something went wrong
\"
)
\r\n
// Promise.reject(
\"\"
)
\r\n
// return
\r\n
// }
\r\n
// if (res.ok) {
\r\n
// toggleSubmitOkModalVisible()
\r\n
// }
\r\n
// })
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
<MessageModal activeState={
\"
false
\"
} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/0de96a6adf9a1edd25e64d11d9f32c5d.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
// Submit ok modal
\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);
\n
const submitOkModalRef = useRef(null);
\n\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form
\n\n\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => {
\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState);
\n
};
\n\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (submitOkModalVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [submitOkModalVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = e => {
\n
e.preventDefault();
\n
toggleForgotPasswordFormVisible();
\n
toggleSubmitOkModalVisible(); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\n
// .then((res) => {
\n
// if (!res.ok) {
\n
// window.alert(
\"
Error: something went wrong
\"
)
\n
// Promise.reject(
\"\"
)
\n
// return
\n
// }
\n
// if (res.ok) {
\n
// toggleSubmitOkModalVisible()
\n
// }
\n
// })
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 93,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 92,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 91,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 101,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 105,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 103,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 115,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 113,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 102,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 100,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 99,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 98,
\n
columnNumber: 7
\n
}, this), submitOkModalVisibilityState && /*#__PURE__*/_jsxDEV(MessageModal, {
\n
ref: submitOkModalRef,
\n
headerMessage:
\"
Email submitted!
\"
,
\n
bodyMessage:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 122,
\n
columnNumber: 9
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 90,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
JewdldMzKvoWUXPBjhAQ4J+HRI8=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"submitOkModalVisibilityState"
,
"showSubmitOkModal"
,
"submitOkModalRef"
,
"toggleSubmitOkModalVisible"
,
"forgotPasswordFormVisibilityState"
,
"showForgotPasswordForm"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"handlePasswordForgot"
,
"preventDefault"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;AACA,OAAOC,YAAP,MAAyB,+CAAzB;;;AAEA,MAAMC,mBAAmB,GAAG,MAAM;AAAA;;AAChC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDR,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMS,gBAAgB,GAAGR,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMS,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJgC,CAMhC;;;AACA,QAAM,CAACI,iCAAD,EAAoCC,sBAApC,IAA8DZ,QAAQ,CAAC,KAAD,CAA5E;AACA,QAAMa,qBAAqB,GAAGZ,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMa,+BAA+B,GAAG,MAAM;AAC5CF,IAAAA,sBAAsB,CAAC,CAACD,iCAAF,CAAtB;AACD,GAFD;;AAIA,QAAM,CAACI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AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,EA+BGV,4BAA4B,iBAC3B,QAAC,YAAD;AAAc,MAAA,GAAG,EAAEE,gBAAnB;AAAqC,MAAA,aAAa,EAAE,kBAApD;AAAwE,MAAA,WAAW,EAAE;AAArF;AAAA;AAAA;AAAA;AAAA,YAhCJ;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CAxHD;;GAAMH,mB;;KAAAA,mB;AA0HN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
// Submit ok modal
\r\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)
\r\n
const submitOkModalRef = useRef(null)
\r\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)
\r\n\r\n
// Forgot password form
\r\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => {
\r\n
showForgotPasswordForm(!forgotPasswordFormVisibilityState)
\r\n
}
\r\n\r\n
const [username, setUsername] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (submitOkModalVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [submitOkModalVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
toggleForgotPasswordFormVisible()
\r\n
toggleSubmitOkModalVisible()
\r\n
// fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
// .then((res) => {
\r\n
// if (!res.ok) {
\r\n
// window.alert(
\"
Error: something went wrong
\"
)
\r\n
// Promise.reject(
\"\"
)
\r\n
// return
\r\n
// }
\r\n
// if (res.ok) {
\r\n
// toggleSubmitOkModalVisible()
\r\n
// }
\r\n
// })
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
{/* <label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label> */}
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
{submitOkModalVisibilityState && (
\r\n
<MessageModal ref={submitOkModalRef} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
)}
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/0e06a7e4878f6e458ebb88b670d289a2.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
Login.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useEffect, useRef } from 'react';
\n
import { Redirect } from 'react-router-dom';
\n
import { useOktaAuth } from '@okta/okta-react';
\n
import
\"
./Login.css
\"
;
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import { NavLink } from 'react-router-dom';
\n
import signUp from './signUp/SignUp';
\n
import config from '../../config';
\n
import SignUp from './signUp/SignUp';
\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const Login = () => {
\n
_s();
\n\n
const {
\n
authState,
\n
oktaAuth
\n
} = useOktaAuth();
\n
const [sessionToken, setSessionToken] = useState();
\n
const [username, setUsername] = useState('');
\n
const [password, setPassword] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
const handlePasswordChange = e => {
\n
setPassword(e.target.value);
\n
};
\n\n
const userInputData = JSON.stringify({
\n
email: `${username}`,
\n
password: `${password}`
\n
});
\n
const loginRequestOptions = {
\n
method: 'POST',
\n
body: userInputData
\n
};
\n\n
const handleSignInFormSubmit = e => {
\n
e.preventDefault();
\n
oktaAuth.signInWithCredentials({
\n
username,
\n
password
\n
}).then(res => {
\n
const sessionToken = res.sessionToken;
\n
setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once
\n\n
oktaAuth.signInWithRedirect({
\n
sessionToken,
\n
originalUri: '/home'
\n
});
\n
}).catch(err => console.log('Found an error', err));
\n
};
\n\n
if (sessionToken) {
\n
// Hide form while sessionToken is converted into id/access tokens
\n
return null;
\n
}
\n\n
if (!authState || !authState.isAuthenticated) {
\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
pageContainer
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(SignUp, {}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 58,
\n
columnNumber: 9
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
signInForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Sign in to PipIt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 61,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handleSignInFormSubmit,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
username
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 63,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Password:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
password
\"
,
\n
type:
\"
password
\"
,
\n
value: password,
\n
onChange: handlePasswordChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 72,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 70,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Sign in
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
sign-in-alt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 79,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 62,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(PasswordForgotModal, {
\n
loginFormUsername: parsefloat(username)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 82,
\n
columnNumber: 11
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 60,
\n
columnNumber: 9
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 57,
\n
columnNumber: 7
\n
}, this);
\n
} else {
\n
return /*#__PURE__*/_jsxDEV(Redirect, {
\n
to:
\"
/home
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 87,
\n
columnNumber: 12
\n
}, this);
\n
}
\n
};
\n\n
_s(Login,
\"
u8yY6NlW4PSOG6xgLhGhaVL5lVE=
\"
, false, function () {
\n
return [useOktaAuth];
\n
});
\n\n
_c = Login;
\n
export default Login;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
Login
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/Login.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useEffect"
,
"useRef"
,
"Redirect"
,
"useOktaAuth"
,
"FontAwesomeIcon"
,
"NavLink"
,
"signUp"
,
"config"
,
"SignUp"
,
"PasswordForgotModal"
,
"Login"
,
"authState"
,
"oktaAuth"
,
"sessionToken"
,
"setSessionToken"
,
"username"
,
"setUsername"
,
"password"
,
"setPassword"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"handlePasswordChange"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"loginRequestOptions"
,
"method"
,
"body"
,
"handleSignInFormSubmit"
,
"preventDefault"
,
"signInWithCredentials"
,
"then"
,
"res"
,
"signInWithRedirect"
,
"originalUri"
,
"catch"
,
"err"
,
"console"
,
"log"
,
"isAuthenticated"
,
"parsefloat"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,aAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,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B,QAAD;AAAlD;AAAA;AAAA;AAAA;AAAA,gBAtBF;AAAA;AAAA;AAAA;AAAA;AAAA,cAHF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF;AA8BD,GA/BD,MA+BO;AACL,wBAAO,QAAC,QAAD;AAAU,MAAA,EAAE,EAAC;AAAb;AAAA;AAAA;AAAA;AAAA,YAAP;AACD;AACF,CA7ED;;GAAML,K;UAC4BP,W;;;KAD5BO,K;AA+EN,eAAeA,KAAf"
,
"sourcesContent"
:[
"import React, { useState, useEffect, useRef } from 'react';
\r\n
import { Redirect } from 'react-router-dom'
\r\n
import { useOktaAuth } from '@okta/okta-react';
\r\n
import
\"
./Login.css
\"\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
\r\n
import { NavLink } from 'react-router-dom';
\r\n
import signUp from './signUp/SignUp';
\r\n
import config from '../../config';
\r\n
import SignUp from './signUp/SignUp';
\r\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\r\n\r\n
const Login = () => {
\r\n
const { authState, oktaAuth } = useOktaAuth();
\r\n
const [sessionToken, setSessionToken] = useState()
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const [password, setPassword] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
const handlePasswordChange = (e) => {
\r\n
setPassword(e.target.value)
\r\n
}
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
password: `${password}`
\r\n
})
\r\n\r\n
const loginRequestOptions = {
\r\n
method: 'POST',
\r\n
body: userInputData
\r\n
};
\r\n\r\n
const handleSignInFormSubmit = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
oktaAuth.signInWithCredentials({ username, password })
\r\n
.then(res => {
\r\n
const sessionToken = res.sessionToken;
\r\n
setSessionToken(sessionToken);
\r\n
// sessionToken is a one-use token, so make sure this is only called once
\r\n
oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });
\r\n
})
\r\n
.catch(err => console.log('Found an error', err));
\r\n
};
\r\n\r\n
if (sessionToken) {
\r\n
// Hide form while sessionToken is converted into id/access tokens
\r\n
return null;
\r\n
}
\r\n\r\n
if (!authState || !authState.isAuthenticated) {
\r\n
return (
\r\n
<div className=
\"
pageContainer
\"
>
\r\n
<SignUp />
\r\n\r\n
<div className=
\"
signInForm
\"
>
\r\n
<h2>Sign in to PipIt</h2>
\r\n
<form onSubmit={handleSignInFormSubmit}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
username
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
Password:
\r\n
<input
\r\n
id=
\"
password
\"
type=
\"
password
\"\r\n
value={password}
\r\n
onChange={handlePasswordChange} />
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Sign in
\r\n
<FontAwesomeIcon icon=
\"
sign-in-alt
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
<PasswordForgotModal loginFormUsername={parsefloat(username)} />
\r\n
</div>
\r\n
</div>
\r\n
)
\r\n
} else {
\r\n
return <Redirect to=
\"
/home
\"
/>
\r\n
}
\r\n
}
\r\n\r\n
export default Login"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/0e37a5d82278dee679cf9d6213c335fa.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
const [username, setUsername] = useState('');
\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => showForgotPasswordForm(!forgotPasswordFormVisibilityState);
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: JSON.stringify({
\n
email: `${username}`
\n
})
\n
};
\n\n
const handlePasswordForgot = () => {
\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {
\n
if (!res.ok) {
\n
window.alert(
\"
Error: something went wrong
\"
);
\n
Promise.reject(
\"\"
);
\n
return;
\n
}
\n\n
if (res.ok) {// do something
\n
}
\n
});
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 59,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\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: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 66,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 70,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 68,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if registered within our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 75,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Sign Up
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 80,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 78,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 67,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 64,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\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(PasswordForgotModal,
\"
VvmgU4VTr5ZNKM/8uo86UTvcRWY=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"PasswordForgotModal"
,
"username"
,
"setUsername"
,
"forgotPasswordFormVisibilityState"
,
"showForgotPasswordForm"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"JSON"
,
"stringify"
,
"email"
,
"handlePasswordForgot"
,
"fetch"
,
"serviceAPI"
,
"ForgotPasswordURL"
,
"then"
,
"res"
,
"ok"
,
"alert"
,
"Promise"
,
"re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,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,yDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAPF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAkCD,CAnFD;;GAAMP,mB;;KAAAA,mB;AAqFN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n\r\n
const PasswordForgotModal = () => {
\r\n
const [username, setUsername] = useState('');
\r\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null);
\r\n
const toggleForgotPasswordFormVisible = () => showForgotPasswordForm(!forgotPasswordFormVisibilityState)
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: JSON.stringify({
\r\n
email: `${username}`
\r\n
})
\r\n
}
\r\n\r\n
const handlePasswordForgot = () => {
\r\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
.then((res) => {
\r\n
if (!res.ok) {
\r\n
window.alert(
\"
Error: something went wrong
\"
)
\r\n
Promise.reject(
\"\"
)
\r\n
return
\r\n
}
\r\n
if (res.ok) {
\r\n
// do something
\r\n
}
\r\n
})
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if registered within our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Sign Up
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/0eea3857faab067a1da60aecc79b3f85.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
Login.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useEffect, useRef } from 'react';
\n
import { Redirect } from 'react-router-dom';
\n
import { useOktaAuth } from '@okta/okta-react';
\n
import
\"
./Login.css
\"
;
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import { NavLink } from 'react-router-dom';
\n
import signUp from './signUp/SignUp';
\n
import config from '../../config';
\n
import SignUp from './signUp/SignUp';
\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const Login = () => {
\n
_s();
\n\n
const {
\n
authState,
\n
oktaAuth
\n
} = useOktaAuth();
\n
const [sessionToken, setSessionToken] = useState();
\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);
\n
const [username, setUsername] = useState('');
\n
const [password, setPassword] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
const handlePasswordChange = e => {
\n
setPassword(e.target.value);
\n
};
\n\n
const userInputData = JSON.stringify({
\n
email: `${username}`,
\n
password: `${password}`
\n
});
\n
const loginRequestOptions = {
\n
method: 'POST',
\n
body: userInputData
\n
};
\n\n
const handleSignInFormSubmit = e => {
\n
e.preventDefault();
\n
oktaAuth.signInWithCredentials({
\n
username,
\n
password
\n
}).then(res => {
\n
const sessionToken = res.sessionToken;
\n
setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once
\n\n
oktaAuth.signInWithRedirect({
\n
sessionToken,
\n
originalUri: '/home'
\n
});
\n
}).catch(err => console.log('Found an error', err));
\n
};
\n\n
if (sessionToken) {
\n
// Hide form while sessionToken is converted into id/access tokens
\n
return null;
\n
}
\n\n
if (!authState || !authState.isAuthenticated) {
\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
pageContainer
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(SignUp, {}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 60,
\n
columnNumber: 9
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
signInForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Sign in to PipIt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 63,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handleSignInFormSubmit,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
username
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 67,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Password:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
password
\"
,
\n
type:
\"
password
\"
,
\n
value: password,
\n
onChange: handlePasswordChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 74,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 72,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Sign in
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
sign-in-alt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 81,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 79,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 64,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: setForgotPasswordFormVisibilityState(true),
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 86,
\n
columnNumber: 15
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 85,
\n
columnNumber: 13
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 84,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(PasswordForgotModal, {
\n
removeModal: () => setForgotPasswordFormVisibilityState(false)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 90,
\n
columnNumber: 13
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 11
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 62,
\n
columnNumber: 9
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 59,
\n
columnNumber: 7
\n
}, this);
\n
} else {
\n
return /*#__PURE__*/_jsxDEV(Redirect, {
\n
to:
\"
/home
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 12
\n
}, this);
\n
}
\n
};
\n\n
_s(Login,
\"
XlNc2CmG/vFxCt8acIKy6LZQ9RM=
\"
, false, function () {
\n
return [useOktaAuth];
\n
});
\n\n
_c = Login;
\n
export default Login;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
Login
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/Login.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useEffect"
,
"useRef"
,
"Redirect"
,
"useOktaAuth"
,
"FontAwesomeIcon"
,
"NavLink"
,
"signUp"
,
"config"
,
"SignUp"
,
"PasswordForgotModal"
,
"Login"
,
"authState"
,
"oktaAuth"
,
"sessionToken"
,
"setSessionToken"
,
"forgotPasswordFormVisibilityState"
,
"setForgotPasswordFormVisibilityState"
,
"username"
,
"setUsername"
,
"password"
,
"setPassword"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"handlePasswordChange"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"loginRequestOptions"
,
"method"
,
"body"
,
"handleSignInFormSubmit"
,
"preventDefault"
,
"signInWithCredentials"
,
"then"
,
"res"
,
"signInWithRedirect"
,
"originalUri"
,
"catch"
,
"err"
,
"console"
,
"log"
,
"isAuthenticated"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,aAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,mBAAP,MAAgC,qCAAhC;;;AAEA,MAAMC,KAAK,GAAG,MAAM;AAAA;;AAClB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BT,WAAW,EAA3C;AACA,QAAM,CAACU,YAAD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A;AADF;AAAA;AAAA;AAAA;AAAA,gBAtBF,eA2BE;AAAK,UAAA,SAAS,EAAG,SAAQD,iCAAiC,GAAG,QAAH,GAAc,UAAW,EAAnF;AAAA,iCACE,QAAC,mBAAD;AAAqB,YAAA,WAAW,EAAE,MAAMC,oCAAoC,CAAC,KAAD;AAA5E;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,gBA3BF;AAAA;AAAA;AAAA;AAAA;AAAA,cAHF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF;AAqCD,GAtCD,MAsCO;AACL,wBAAO,QAAC,QAAD;AAAU,MAAA,EAAE,EAAC;AAAb;AAAA;AAAA;AAAA;AAAA,YAAP;AACD;AACF,CAtFD;;GAAMN,K;UAC4BP,W;;;KAD5BO,K;AAwFN,eAAeA,KAAf"
,
"sourcesContent"
:[
"import React, { useState, useEffect, useRef } from 'react';
\r\n
import { Redirect } from 'react-router-dom'
\r\n
import { useOktaAuth } from '@okta/okta-react';
\r\n
import
\"
./Login.css
\"\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
\r\n
import { NavLink } from 'react-router-dom';
\r\n
import signUp from './signUp/SignUp';
\r\n
import config from '../../config';
\r\n
import SignUp from './signUp/SignUp';
\r\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\r\n\r\n
const Login = () => {
\r\n
const { authState, oktaAuth } = useOktaAuth();
\r\n
const [sessionToken, setSessionToken] = useState()
\r\n\r\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const [password, setPassword] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
const handlePasswordChange = (e) => {
\r\n
setPassword(e.target.value)
\r\n
}
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
password: `${password}`
\r\n
})
\r\n\r\n
const loginRequestOptions = {
\r\n
method: 'POST',
\r\n
body: userInputData
\r\n
};
\r\n\r\n
const handleSignInFormSubmit = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
oktaAuth.signInWithCredentials({ username, password })
\r\n
.then(res => {
\r\n
const sessionToken = res.sessionToken;
\r\n
setSessionToken(sessionToken);
\r\n
// sessionToken is a one-use token, so make sure this is only called once
\r\n
oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });
\r\n
})
\r\n
.catch(err => console.log('Found an error', err));
\r\n
};
\r\n\r\n
if (sessionToken) {
\r\n
// Hide form while sessionToken is converted into id/access tokens
\r\n
return null;
\r\n
}
\r\n\r\n
if (!authState || !authState.isAuthenticated) {
\r\n
return (
\r\n
<div className=
\"
pageContainer
\"
>
\r\n
<SignUp />
\r\n\r\n
<div className=
\"
signInForm
\"
>
\r\n
<h2>Sign in to PipIt</h2>
\r\n
<form onSubmit={handleSignInFormSubmit}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
username
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
Password:
\r\n
<input
\r\n
id=
\"
password
\"
type=
\"
password
\"\r\n
value={password}
\r\n
onChange={handlePasswordChange} />
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Sign in
\r\n
<FontAwesomeIcon icon=
\"
sign-in-alt
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={setForgotPasswordFormVisibilityState(true)}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<PasswordForgotModal removeModal={() => setForgotPasswordFormVisibilityState(false)} />
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
)
\r\n
} else {
\r\n
return <Redirect to=
\"
/home
\"
/>
\r\n
}
\r\n
}
\r\n\r\n
export default Login"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/0f97e620c26889fd6da13d54417cb63c.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = props => {
\n
_s();
\n\n
// Submit ok modal
\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);
\n
const submitOkModalRef = useRef(null);
\n\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form
\n\n\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => showForgotPasswordForm(!forgotPasswordFormVisibilityState);
\n\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
setUsername(props.loginFormUsername);
\n
}, []);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (submitOkModalVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [submitOkModalVisibilityState]);
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: JSON.stringify({
\n
email: `${username}`
\n
})
\n
};
\n\n
const handlePasswordForgot = () => {
\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {
\n
if (!res.ok) {
\n
window.alert(
\"
Error: something went wrong
\"
);
\n
Promise.reject(
\"\"
);
\n
return;
\n
}
\n\n
if (res.ok) {// do something
\n
}
\n
});
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 87,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 101,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 99,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 106,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 111,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 109,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 98,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 95,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 94,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${submitOkModalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: submitOkModalRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
submitOkModal
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Email has been submitted!
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 122,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children:
\"
Ok
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 123,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 121,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 120,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 119,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 86,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
6nRVeLyPRLhEC+nG9QEudfxhhrM=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"PasswordForgotModal"
,
"props"
,
"submitOkModalVisibilityState"
,
"showSubmitOkModal"
,
"submitOkModalRef"
,
"toggleSubmitOkModalVisible"
,
"forgotPasswordFormVisibilityState"
,
"showForgotPasswordForm"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"loginFormUsername"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"JSON"
,
"stringify"
,
"email"
,
"handlePasswordForgot"
,
"fetch"
,
"serviceAPI"
,
"ForgotPasswordURL"
,
"then"
,
"res"
,
"ok"
,
"alert"
,
"Promise"
,
"reject"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;;;AAEA,MAAMC,mBAAmB,GAAIC,KAAD,IAAW;AAAA;;AACrC;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDR,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMS,gBAAgB,GAAGR,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMS,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJqC,CAMrC;;;AACA,QAAM,CAACI,iCAAD,EAAoCC,sBAApC,IAA8DZ,QAAQ,CAAC,KAAD,CAA5E;AACA,QAAMa,qBAAqB,GAAGZ,MAAM,CAAC,IAAD,CAApC;;AACA,QAAMa,+BAA+B,GAAG,MAAMF,s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A,IAAI,EAAC,MADlB;AAEE,gBAAA,KAAK,EAAEnB,QAFT;AAGE,gBAAA,QAAQ,EAAEE;AAHZ;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAQE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eAiCE;AAAK,MAAA,SAAS,EAAG,SAAQV,4BAA4B,GAAG,QAAH,GAAc,UAAW,EAA9E;AAAA,6BACE;AAAK,QAAA,GAAG,EAAEE,gBAAV;AAA4B,QAAA,SAAS,EAAC,eAAtC;AAAA,+BACE;AAAK,UAAA,SAAS,EAAC,eAAf;AAAA,kCACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAEE;AAAQ,YAAA,SAAS,EAAC,kBAAlB;AAAqC,YAAA,IAAI,EAAC,QAA1C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YAjCF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AA+CD,CA9HD;;GAAMJ,mB;;KAAAA,mB;AAgIN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n\r\n
const PasswordForgotModal = (props) => {
\r\n
// Submit ok modal
\r\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)
\r\n
const submitOkModalRef = useRef(null)
\r\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)
\r\n\r\n
// Forgot password form
\r\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => showForgotPasswordForm(!forgotPasswordFormVisibilityState)
\r\n\r\n\r\n
const [username, setUsername] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
setUsername(props.loginFormUsername)
\r\n
}, [])
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (submitOkModalVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [submitOkModalVisibilityState]);
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: JSON.stringify({
\r\n
email: `${username}`
\r\n
})
\r\n
}
\r\n\r\n
const handlePasswordForgot = () => {
\r\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
.then((res) => {
\r\n
if (!res.ok) {
\r\n
window.alert(
\"
Error: something went wrong
\"
)
\r\n
Promise.reject(
\"\"
)
\r\n
return
\r\n
}
\r\n
if (res.ok) {
\r\n
// do something
\r\n
}
\r\n
})
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n\r\n
{/* SubmitOk modal */}
\r\n
<div className={`modal ${submitOkModalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={submitOkModalRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
submitOkModal
\"
>
\r\n
<h2>Email has been submitted!</h2>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Ok
\r\n
</button>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/12c01119619eb1113b92006fb0ccc736.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
components
\\\\
messageModal
\\\\
MessageModal.jsx
\"
;
\n
import React, { useState, useEffect, useRef } from 'react';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const MessageModal = ({
\n
removeModal,
\n
headerMessage,
\n
bodyMessage
\n
}) => {
\n
const stopProp = e => {
\n
e.stopPropagation();
\n
}; // useEffect(() => {
\n
// const pageClickEvent = (e) => {
\n
// if (messageModalRef.current !== null && !messageModalRef.current.contains(e.target)) {
\n
// toggleModalVisible()
\n
// }
\n
// };
\n
// // If the item is active (ie open) then listen for clicks
\n
// if (modalVisibilityState) {
\n
// window.addEventListener('click', pageClickEvent);
\n
// }
\n
// return () => {
\n
// window.removeEventListener('click', pageClickEvent);
\n
// }
\n
// }, [modalVisibilityState]);
\n\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
modal background
\"
,
\n
onClick: e => removeModal(),
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
submitOkModal
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children: headerMessage
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 30,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: bodyMessage
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 31,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
onClick: e => removeModal(),
\n
children:
\"
Ok
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 34,
\n
columnNumber: 11
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 29,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 28,
\n
columnNumber: 7
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 27,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_c = MessageModal;
\n
export default MessageModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
MessageModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/messageModal/MessageModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useEffect"
,
"useRef"
,
"MessageModal"
,
"removeModal"
,
"headerMessage"
,
"bodyMessage"
,
"stopProp"
,
"e"
,
"stopPropagation"
],
"mappings"
:
";AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;;;AAEA,MAAMC,YAAY,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAeC,EAAAA,aAAf;AAA8BC,EAAAA;AAA9B,CAAD,KAAiD;AACpE,QAAMC,QAAQ,GAAGC,CAAC,IAAI;AACpBA,IAAAA,CAAC,CAACC,eAAF;AACD,GAFD,CADoE,CAKpE;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AAEA;AACA;AACA;AAEA;;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAC,kBAAf;AAAkC,IAAA,OAAO,EAAED,CAAC,IAAIJ,WAAW,EAA3D;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,eAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,eAAf;AAAA,gCACE;AAAA,oBAAKC;AAAL;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA,oBACGC;AADH;AAAA;AAAA;AAAA;AAAA,gBAFF,eAKE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,OAAO,EAAEE,CAAC,IAAIJ,WAAW,EAA9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAeD,CAtCD;;KAAMD,Y;AAwCN,eAAeA,YAAf"
,
"sourcesContent"
:[
"import React, { useState, useEffect, useRef } from 'react'
\r\n\r\n
const MessageModal = ({ removeModal, headerMessage, bodyMessage }) => {
\r\n
const stopProp = e => {
\r\n
e.stopPropagation()
\r\n
}
\r\n\r\n
// useEffect(() => {
\r\n
// const pageClickEvent = (e) => {
\r\n
// if (messageModalRef.current !== null && !messageModalRef.current.contains(e.target)) {
\r\n
// toggleModalVisible()
\r\n
// }
\r\n
// };
\r\n\r\n
// // If the item is active (ie open) then listen for clicks
\r\n
// if (modalVisibilityState) {
\r\n
// window.addEventListener('click', pageClickEvent);
\r\n
// }
\r\n\r\n
// return () => {
\r\n
// window.removeEventListener('click', pageClickEvent);
\r\n
// }
\r\n\r\n
// }, [modalVisibilityState]);
\r\n\r\n
return (
\r\n
<div className=
\"
modal background
\"
onClick={e => removeModal()}>
\r\n
<div className=
\"
modal-content
\"
>
\r\n
<div className=
\"
submitOkModal
\"
>
\r\n
<h2>{headerMessage}</h2>
\r\n
<label>
\r\n
{bodyMessage}
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
onClick={e => removeModal()}>
\r\n
Ok
\r\n
</button>
\r\n
</div>
\r\n
</div>
\r\n
</div >
\r\n
)
\r\n
}
\r\n\r\n
export default MessageModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/140f76d269b939863897f586ad34fd2a.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = ({
\n
loginFormUsername
\n
}) => {
\n
_s();
\n\n
// Submit ok modal
\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false);
\n
const submitOkModalRef = useRef(null);
\n\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState); // Forgot password form
\n\n\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => showForgotPasswordForm(!forgotPasswordFormVisibilityState);
\n\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
setUsername(loginFormUsername.username);
\n
}, []);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\n
toggleSubmitOkModalVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (submitOkModalVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [submitOkModalVisibilityState]);
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: JSON.stringify({
\n
email: `${username}`
\n
})
\n
};
\n\n
const handlePasswordForgot = () => {
\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions).then(res => {
\n
if (!res.ok) {
\n
window.alert(
\"
Error: something went wrong
\"
);
\n
Promise.reject(
\"\"
);
\n
return;
\n
}
\n\n
if (res.ok) {// toggleSubmitOkModalVisible()
\n
}
\n
});
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 87,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 101,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 99,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 106,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 111,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 109,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 98,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 95,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 94,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${submitOkModalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: submitOkModalRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
submitOkModal
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Email submitted!
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 122,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 123,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children:
\"
Ok
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 126,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 121,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 120,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 119,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 86,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
6nRVeLyPRLhEC+nG9QEudfxhhrM=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"PasswordForgotModal"
,
"loginFormUsername"
,
"submitOkModalVisibilityState"
,
"showSubmitOkModal"
,
"submitOkModalRef"
,
"toggleSubmitOkModalVisible"
,
"forgotPasswordFormVisibilityState"
,
"showForgotPasswordForm"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventListener"
,
"ForgotPasswordRequestOptions"
,
"method"
,
"body"
,
"JSON"
,
"stringify"
,
"email"
,
"handlePasswordForgot"
,
"fetch"
,
"serviceAPI"
,
"ForgotPasswordURL"
,
"then"
,
"res"
,
"ok"
,
"alert"
,
"Promise"
,
"reject"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,MAA1B,EAAkCC,SAAlC,QAAmD,OAAnD;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,OAAO,2BAAP;;;AAEA,MAAMC,mBAAmB,GAAG,CAAC;AAAEC,EAAAA;AAAF,CAAD,KAA2B;AAAA;;AACrD;AACA,QAAM,CAACC,4BAAD,EAA+BC,iBAA/B,IAAoDR,QAAQ,CAAC,KAAD,CAAlE;AACA,QAAMS,gBAAgB,GAAGR,MAAM,CAAC,IAAD,CAA/B;;AACA,QAAMS,0BAA0B,GAAG,MAAMF,iBAAiB,CAAC,CAACD,4BAAF,CAA1D,CAJqD,CAMrD;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AA;AAAA,UADF;AAkDD,CAjID;;GAAMJ,mB;;KAAAA,mB;AAmIN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n\r\n
const PasswordForgotModal = ({ loginFormUsername }) => {
\r\n
// Submit ok modal
\r\n
const [submitOkModalVisibilityState, showSubmitOkModal] = useState(false)
\r\n
const submitOkModalRef = useRef(null)
\r\n
const toggleSubmitOkModalVisible = () => showSubmitOkModal(!submitOkModalVisibilityState)
\r\n\r\n
// Forgot password form
\r\n
const [forgotPasswordFormVisibilityState, showForgotPasswordForm] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => showForgotPasswordForm(!forgotPasswordFormVisibilityState)
\r\n\r\n\r\n
const [username, setUsername] = useState('');
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
setUsername(loginFormUsername.username)
\r\n
}, [])
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (submitOkModalRef.current !== null && !submitOkModalRef.current.contains(e.target)) {
\r\n
toggleSubmitOkModalVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (submitOkModalVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [submitOkModalVisibilityState]);
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: JSON.stringify({
\r\n
email: `${username}`
\r\n
})
\r\n
}
\r\n\r\n
const handlePasswordForgot = () => {
\r\n
fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
.then((res) => {
\r\n
if (!res.ok) {
\r\n
window.alert(
\"
Error: something went wrong
\"
)
\r\n
Promise.reject(
\"\"
)
\r\n
return
\r\n
}
\r\n
if (res.ok) {
\r\n
// toggleSubmitOkModalVisible()
\r\n
}
\r\n
})
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n\r\n
{/* SubmitOk modal */}
\r\n
<div className={`modal ${submitOkModalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={submitOkModalRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
submitOkModal
\"
>
\r\n
<h2>Email submitted!</h2>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Ok
\r\n
</button>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/16a007240a5fc459ae1741d6054fa686.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
passwordReset
\\\\
PasswordForgotModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useRef, useEffect } from 'react';
\n
import config from '../../../config';
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import
\"
./PasswordForgotModal.css
\"
;
\n
import MessageModal from '../../../components/messageModal/MessageModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const PasswordForgotModal = () => {
\n
_s();
\n\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false);
\n
const forgotPasswordFormRef = useRef(null);
\n\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState);
\n\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\n
const [username, setUsername] = useState('');
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
useEffect(() => {
\n
const pageClickEvent = e => {
\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\n
toggleForgotPasswordFormVisible();
\n
}
\n
}; // If the item is active (ie open) then listen for clicks
\n\n\n
if (forgotPasswordFormVisibilityState) {
\n
window.addEventListener('click', pageClickEvent);
\n
}
\n\n
return () => {
\n
window.removeEventListener('click', pageClickEvent);
\n
};
\n
}, [forgotPasswordFormVisibilityState]);
\n
const userInputData = JSON.stringify({
\n
email: `${username}`
\n
});
\n
const ForgotPasswordRequestOptions = {
\n
method: 'PUT',
\n
body: userInputData
\n
};
\n\n
const handlePasswordForgot = e => {
\n
e.preventDefault();
\n
toggleForgotPasswordFormVisible();
\n
setSubmitOkMessageModalState(true); // fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\n
// .then((res) => {
\n
// if (!res.ok) {
\n
// window.alert(
\"
Error: something went wrong
\"
)
\n
// Promise.reject(
\"\"
)
\n
// return
\n
// }
\n
// if (res.ok) {
\n
// toggleSubmitOkModalVisible()
\n
// }
\n
// })
\n
};
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: [/*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
password-forgot-prompt
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
span
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(
\"
a
\"
, {
\n
onClick: toggleForgotPasswordFormVisible,
\n
children:
\"
Forgot password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 68,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 67,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 66,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
ref: forgotPasswordFormRef,
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
recoverPasswordForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Recover password
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 76,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handlePasswordForgot,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
email
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 80,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 78,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 85,
\n
columnNumber: 15
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Submit
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
arrow-right
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 90,
\n
columnNumber: 17
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 88,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 75,
\n
columnNumber: 11
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 74,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 73,
\n
columnNumber: 7
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
children: /*#__PURE__*/_jsxDEV(MessageModal, {
\n
removeModal: () => setSubmitOkMessageModalState(false),
\n
headerMessage:
\"
Email submitted!
\"
,
\n
bodyMessage:
\"
An email with a password recovery link will be sent if it is registered in our system
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 97,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 96,
\n
columnNumber: 7
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(PasswordForgotModal,
\"
g4WkMIawwrBahYMYonVecg/0JA0=
\"
);
\n\n
_c = PasswordForgotModal;
\n
export default PasswordForgotModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
PasswordForgotModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/passwordReset/PasswordForgotModal.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useRef"
,
"useEffect"
,
"config"
,
"FontAwesomeIcon"
,
"MessageModal"
,
"PasswordForgotModal"
,
"forgotPasswordFormVisibilityState"
,
"setForgotPasswordFormVisibilityState"
,
"forgotPasswordFormRef"
,
"toggleForgotPasswordFormVisible"
,
"submitOkMessageModalState"
,
"setSubmitOkMessageModalState"
,
"username"
,
"setUsername"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"pageClickEvent"
,
"current"
,
"contains"
,
"window"
,
"addEventListener"
,
"removeEventList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AAA;AAAA;AAAA;AAAA;AAAA,oBADF,eAQE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBARF,eAWE;AAAQ,cAAA,SAAS,EAAC,kBAAlB;AAAqC,cAAA,IAAI,EAAC,QAA1C;AAAA,wDAEE,QAAC,eAAD;AAAiB,gBAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,sBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,oBAXF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAFF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YARF,eA+BE;AAAA,6BACE,QAAC,YAAD;AAAc,QAAA,WAAW,EAAE,MAAMH,4BAA4B,CAAC,KAAD,CAA7D;AAAsE,QAAA,aAAa,EAAE,kBAArF;AAAyG,QAAA,WAAW,EAAE;AAAtH;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,YA/BF;AAAA;AAAA;AAAA;AAAA;AAAA,UADF;AAsCD,CA/FD;;GAAMN,mB;;KAAAA,mB;AAiGN,eAAeA,mBAAf"
,
"sourcesContent"
:[
"import React, { useState, useRef, useEffect } from 'react'
\r\n
import config from '../../../config'
\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\r\n
import
\"
./PasswordForgotModal.css
\"\r\n
import MessageModal from '../../../components/messageModal/MessageModal';
\r\n\r\n
const PasswordForgotModal = () => {
\r\n
const [forgotPasswordFormVisibilityState, setForgotPasswordFormVisibilityState] = useState(false)
\r\n
const forgotPasswordFormRef = useRef(null)
\r\n
const toggleForgotPasswordFormVisible = () => setForgotPasswordFormVisibilityState(!forgotPasswordFormVisibilityState)
\r\n\r\n
const [submitOkMessageModalState, setSubmitOkMessageModalState] = useState(false);
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
useEffect(() => {
\r\n
const pageClickEvent = (e) => {
\r\n
if (forgotPasswordFormRef.current !== null && !forgotPasswordFormRef.current.contains(e.target)) {
\r\n
toggleForgotPasswordFormVisible()
\r\n
}
\r\n
};
\r\n\r\n
// If the item is active (ie open) then listen for clicks
\r\n
if (forgotPasswordFormVisibilityState) {
\r\n
window.addEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
return () => {
\r\n
window.removeEventListener('click', pageClickEvent);
\r\n
}
\r\n\r\n
}, [forgotPasswordFormVisibilityState]);
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
})
\r\n\r\n
const ForgotPasswordRequestOptions = {
\r\n
method: 'PUT',
\r\n
body: userInputData
\r\n
}
\r\n\r\n
const handlePasswordForgot = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
toggleForgotPasswordFormVisible()
\r\n
setSubmitOkMessageModalState(true)
\r\n
// fetch(config.serviceAPI.ForgotPasswordURL, ForgotPasswordRequestOptions)
\r\n
// .then((res) => {
\r\n
// if (!res.ok) {
\r\n
// window.alert(
\"
Error: something went wrong
\"
)
\r\n
// Promise.reject(
\"\"
)
\r\n
// return
\r\n
// }
\r\n
// if (res.ok) {
\r\n
// toggleSubmitOkModalVisible()
\r\n
// }
\r\n
// })
\r\n
}
\r\n\r\n
return (
\r\n
<div>
\r\n
<div className=
\"
password-forgot-prompt
\"
>
\r\n
<span>
\r\n
<a onClick={toggleForgotPasswordFormVisible}>Forgot password</a>
\r\n
</span>
\r\n
</div>
\r\n\r\n
{/* Forgot password modal */}
\r\n
<div className={`modal ${forgotPasswordFormVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div ref={forgotPasswordFormRef} className=
\"
modal-content
\"
>
\r\n
<div className=
\"
recoverPasswordForm
\"
>
\r\n
<h2>Recover password</h2>
\r\n
<form onSubmit={handlePasswordForgot}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
email
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
An email with a password recovery link will be sent if it is registered in our system
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Submit
\r\n
<FontAwesomeIcon icon=
\"
arrow-right
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
</div>
\r\n
</div>
\r\n
</div>
\r\n
<div>
\r\n
<MessageModal removeModal={() => setSubmitOkMessageModalState(false)} headerMessage={
\"
Email submitted!
\"
} bodyMessage={
\"
An email with a password recovery link will be sent if it is registered in our system
\"
} />
\r\n
</div>
\r\n
</div>
\r\n\r\n
)
\r\n
}
\r\n\r\n
export default PasswordForgotModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/16ab15817248a09cce22117b37b8d64b.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
components
\\\\
messageModal
\\\\
MessageModal.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React from 'react';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const MessageModal = props => {
\n
_s();
\n\n
const [modalVisibilityState, showModal] = useState(true);
\n\n
const toggleModalVisible = () => showModal(!modalVisibilityState);
\n\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className: `modal ${modalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
modal-content
\"
,
\n
children: /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
submitOkModal
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children: props.headerMessage
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 11,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: props.bodyMessage
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 12,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
onClick: toggleModalVisible,
\n
children:
\"
Ok
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 15,
\n
columnNumber: 11
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 10,
\n
columnNumber: 9
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 9,
\n
columnNumber: 7
\n
}, this)
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 8,
\n
columnNumber: 5
\n
}, this);
\n
};
\n\n
_s(MessageModal,
\"
o5WiWLNLIkTfnrQf/aeRT17JQYs=
\"
);
\n\n
_c = MessageModal;
\n
export default MessageModal;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
MessageModal
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/components/messageModal/MessageModal.jsx"
],
"names"
:[
"React"
,
"MessageModal"
,
"props"
,
"modalVisibilityState"
,
"showModal"
,
"useState"
,
"toggleModalVisible"
,
"headerMessage"
,
"bodyMessage"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;;;AAEA,MAAMC,YAAY,GAAIC,KAAD,IAAW;AAAA;;AAC9B,QAAM,CAACC,oBAAD,EAAuBC,SAAvB,IAAoCC,QAAQ,CAAC,IAAD,CAAlD;;AACA,QAAMC,kBAAkB,GAAG,MAAMF,SAAS,CAAC,CAACD,oBAAF,CAA1C;;AAEA,sBACE;AAAK,IAAA,SAAS,EAAG,SAAQA,oBAAoB,GAAG,QAAH,GAAc,UAAW,EAAtE;AAAA,2BACE;AAAK,MAAA,SAAS,EAAC,eAAf;AAAA,6BACE;AAAK,QAAA,SAAS,EAAC,eAAf;AAAA,gCACE;AAAA,oBAAKD,KAAK,CAACK;AAAX;AAAA;AAAA;AAAA;AAAA,gBADF,eAEE;AAAA,oBACGL,KAAK,CAACM;AADT;AAAA;AAAA;AAAA;AAAA,gBAFF,eAKE;AAAQ,UAAA,SAAS,EAAC,kBAAlB;AAAqC,UAAA,OAAO,EAAEF,kBAA9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBALF;AAAA;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA;AADF;AAAA;AAAA;AAAA;AAAA,UADF;AAeD,CAnBD;;GAAML,Y;;KAAAA,Y;AAqBN,eAAeA,YAAf"
,
"sourcesContent"
:[
"import React from 'react'
\r\n\r\n
const MessageModal = (props) => {
\r\n
const [modalVisibilityState, showModal] = useState(true)
\r\n
const toggleModalVisible = () => showModal(!modalVisibilityState)
\r\n\r\n
return (
\r\n
<div className={`modal ${modalVisibilityState ?
\"
active
\"
:
\"
inactive
\"
}`}>
\r\n
<div className=
\"
modal-content
\"
>
\r\n
<div className=
\"
submitOkModal
\"
>
\r\n
<h2>{props.headerMessage}</h2>
\r\n
<label>
\r\n
{props.bodyMessage}
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
onClick={toggleModalVisible}>
\r\n
Ok
\r\n
</button>
\r\n
</div>
\r\n
</div>
\r\n
</div >
\r\n
)
\r\n
}
\r\n\r\n
export default MessageModal
\r\n
"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
client/node_modules/.cache/babel-loader/184a8dabead2a93527f2c6355b7b0448.json
0 → 100644
View file @
a26e7d3e
{
"ast"
:
null
,
"code"
:
"var _jsxFileName =
\"
C:
\\\\
Users
\\\\
Bruger
\\\\
Desktop
\\\\
Web-projects
\\\\
pipit
\\\\
client
\\\\
src
\\\\
pages
\\\\
login
\\\\
Login.jsx
\"
,
\n
_s = $RefreshSig$();
\n\n
import React, { useState, useEffect, useRef } from 'react';
\n
import { Redirect } from 'react-router-dom';
\n
import { useOktaAuth } from '@okta/okta-react';
\n
import
\"
./Login.css
\"
;
\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
\n
import { NavLink } from 'react-router-dom';
\n
import signUp from './signUp/SignUp';
\n
import config from '../../config';
\n
import SignUp from './signUp/SignUp';
\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\n
import { jsxDEV as _jsxDEV } from
\"
react/jsx-dev-runtime
\"
;
\n\n
const Login = () => {
\n
_s();
\n\n
const {
\n
authState,
\n
oktaAuth
\n
} = useOktaAuth();
\n
const [sessionToken, setSessionToken] = useState();
\n
const [username, setUsername] = useState('');
\n
const [password, setPassword] = useState('');
\n
const [forgotUsername, setForgotUsername] = useState('');
\n
useEffect(() => {
\n
setForgotUsername(username);
\n
console.log(forgotUsername);
\n
}, [username]);
\n\n
const handleUsernameChange = e => {
\n
setUsername(e.target.value);
\n
};
\n\n
const handlePasswordChange = e => {
\n
setPassword(e.target.value);
\n
};
\n\n
const userInputData = JSON.stringify({
\n
email: `${username}`,
\n
password: `${password}`
\n
});
\n
const loginRequestOptions = {
\n
method: 'POST',
\n
body: userInputData
\n
};
\n\n
const handleSignInFormSubmit = e => {
\n
e.preventDefault();
\n
oktaAuth.signInWithCredentials({
\n
username,
\n
password
\n
}).then(res => {
\n
const sessionToken = res.sessionToken;
\n
setSessionToken(sessionToken); // sessionToken is a one-use token, so make sure this is only called once
\n\n
oktaAuth.signInWithRedirect({
\n
sessionToken,
\n
originalUri: '/home'
\n
});
\n
}).catch(err => console.log('Found an error', err));
\n
};
\n\n
if (sessionToken) {
\n
// Hide form while sessionToken is converted into id/access tokens
\n
return null;
\n
}
\n\n
if (!authState || !authState.isAuthenticated) {
\n
return /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
pageContainer
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(SignUp, {}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 65,
\n
columnNumber: 9
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
div
\"
, {
\n
className:
\"
signInForm
\"
,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
h2
\"
, {
\n
children:
\"
Sign in to PipIt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 68,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
form
\"
, {
\n
onSubmit: handleSignInFormSubmit,
\n
children: [/*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Email:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
username
\"
,
\n
type:
\"
text
\"
,
\n
value: username,
\n
onChange: handleUsernameChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 72,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 70,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
label
\"
, {
\n
children: [
\"
Password:
\"
, /*#__PURE__*/_jsxDEV(
\"
input
\"
, {
\n
id:
\"
password
\"
,
\n
type:
\"
password
\"
,
\n
value: password,
\n
onChange: handlePasswordChange
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 79,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 77,
\n
columnNumber: 13
\n
}, this), /*#__PURE__*/_jsxDEV(
\"
button
\"
, {
\n
className:
\"
formSubmitButton
\"
,
\n
type:
\"
submit
\"
,
\n
children: [
\"
Sign in
\\
xA0
\\
xA0
\"
, /*#__PURE__*/_jsxDEV(FontAwesomeIcon, {
\n
icon:
\"
sign-in-alt
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 86,
\n
columnNumber: 15
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 84,
\n
columnNumber: 13
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 69,
\n
columnNumber: 11
\n
}, this), /*#__PURE__*/_jsxDEV(PasswordForgotModal, {
\n
loginFormUsername: forgotUsername
\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 89,
\n
columnNumber: 11
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 67,
\n
columnNumber: 9
\n
}, this)]
\n
}, void 0, true, {
\n
fileName: _jsxFileName,
\n
lineNumber: 64,
\n
columnNumber: 7
\n
}, this);
\n
} else {
\n
return /*#__PURE__*/_jsxDEV(Redirect, {
\n
to:
\"
/home
\"\n
}, void 0, false, {
\n
fileName: _jsxFileName,
\n
lineNumber: 94,
\n
columnNumber: 12
\n
}, this);
\n
}
\n
};
\n\n
_s(Login,
\"
8cak91jM2hAuqTZEX5oSChwgzO4=
\"
, false, function () {
\n
return [useOktaAuth];
\n
});
\n\n
_c = Login;
\n
export default Login;
\n\n
var _c;
\n\n
$RefreshReg$(_c,
\"
Login
\"
);"
,
"map"
:{
"version"
:
3
,
"sources"
:[
"C:/Users/Bruger/Desktop/Web-projects/pipit/client/src/pages/login/Login.jsx"
],
"names"
:[
"React"
,
"useState"
,
"useEffect"
,
"useRef"
,
"Redirect"
,
"useOktaAuth"
,
"FontAwesomeIcon"
,
"NavLink"
,
"signUp"
,
"config"
,
"SignUp"
,
"PasswordForgotModal"
,
"Login"
,
"authState"
,
"oktaAuth"
,
"sessionToken"
,
"setSessionToken"
,
"username"
,
"setUsername"
,
"password"
,
"setPassword"
,
"forgotUsername"
,
"setForgotUsername"
,
"console"
,
"log"
,
"handleUsernameChange"
,
"e"
,
"target"
,
"value"
,
"handlePasswordChange"
,
"userInputData"
,
"JSON"
,
"stringify"
,
"email"
,
"loginRequestOptions"
,
"method"
,
"body"
,
"handleSignInFormSubmit"
,
"preventDefault"
,
"signInWithCredentials"
,
"then"
,
"res"
,
"signInWithRedirect"
,
"originalUri"
,
"catch"
,
"err"
,
"isAuthenticated"
],
"mappings"
:
";;;AAAA,OAAOA,KAAP,IAAgBC,QAAhB,EAA0BC,SAA1B,EAAqCC,MAArC,QAAmD,OAAnD;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,WAAT,QAA4B,kBAA5B;AACA,OAAO,aAAP;AACA,SAASC,eAAT,QAAgC,gCAAhC;AACA,SAASC,OAAT,QAAwB,kBAAxB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,MAAP,MAAmB,cAAnB;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,mBAAP,MAAgC,qCAAhC;;;AAEA,MAAMC,KAAK,GAAG,MAAM;AAAA;;AAClB,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,MAA0BT,WAAW,EAA3C;AACA,QAAM,CAACU,YAAD,EAAeC,eAAf,IAAkCf,QAAQ,EAAhD;AAEA,QAAM,CAACgB,QAAD,EAAWC,WAAX,IAA0BjB,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACkB,QAAD,EAAWC,WAAX,IAA0BnB,QAAQ,CAAC,EAAD,CAAxC;AACA,QAAM,CAACoB,cAAD,EAAiBC,iBAAjB,IAAsCrB,QAAQ,CAAC,EAAD,CAApD;AAGAC,EAAAA,SAAS,CAAC,MAAM;AACdoB,IAAAA,iBAAiB,CAACL,QAAD,CAAjB;AACAM,IAAAA,OAAO,CAACC,GAAR,CAAYH,cAAZ;AACD,GAHQ,EAGN,CAACJ,QAAD,CAHM,CAAT;;AAKA,QAAMQ,oBAAoB,GAAIC,CAAD,IAAO;AAClCR,IAAAA,WAAW,CAACQ,CAAC,CAACC,MAAF,CAASC,KAAV,CAAX;AACD,GAFD;;AAIA,QAAMC,oBAAoB,GAAIH,CAAD,IAAO;A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,cAAA,EAAE,EAAC,UADL;AACgB,cAAA,IAAI,EAAC,MADrB;AAEE,cAAA,KAAK,EAAEpB,QAFT;AAGE,cAAA,QAAQ,EAAEQ;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBADF,eAQE;AAAA,iDAEE;AACE,cAAA,EAAE,EAAC,UADL;AACgB,cAAA,IAAI,EAAC,UADrB;AAEE,cAAA,KAAK,EAAEN,QAFT;AAGE,cAAA,QAAQ,EAAEU;AAHZ;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBARF,eAeE;AAAQ,YAAA,SAAS,EAAC,kBAAlB;AAAqC,YAAA,IAAI,EAAC,QAA1C;AAAA,uDAEE,QAAC,eAAD;AAAiB,cAAA,IAAI,EAAC;AAAtB;AAAA;AAAA;AAAA;AAAA,oBAFF;AAAA;AAAA;AAAA;AAAA;AAAA,kBAfF;AAAA;AAAA;AAAA;AAAA;AAAA,gBAFF,eAsBE,QAAC,mBAAD;AAAqB,UAAA,iBAAiB,EAAER;AAAxC;AAAA;AAAA;AAAA;AAAA,gBAtBF;AAAA;AAAA;AAAA;AAAA;AAAA,cAHF;AAAA;AAAA;AAAA;AAAA;AAAA,YADF;AA8BD,GA/BD,MA+BO;AACL,wBAAO,QAAC,QAAD;AAAU,MAAA,EAAE,EAAC;AAAb;AAAA;AAAA;AAAA;AAAA,YAAP;AACD;AACF,CApFD;;GAAMT,K;UAC4BP,W;;;KAD5BO,K;AAsFN,eAAeA,KAAf"
,
"sourcesContent"
:[
"import React, { useState, useEffect, useRef } from 'react';
\r\n
import { Redirect } from 'react-router-dom'
\r\n
import { useOktaAuth } from '@okta/okta-react';
\r\n
import
\"
./Login.css
\"\r\n
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
\r\n
import { NavLink } from 'react-router-dom';
\r\n
import signUp from './signUp/SignUp';
\r\n
import config from '../../config';
\r\n
import SignUp from './signUp/SignUp';
\r\n
import PasswordForgotModal from './passwordReset/PasswordForgotModal';
\r\n\r\n
const Login = () => {
\r\n
const { authState, oktaAuth } = useOktaAuth();
\r\n
const [sessionToken, setSessionToken] = useState()
\r\n\r\n
const [username, setUsername] = useState('');
\r\n
const [password, setPassword] = useState('');
\r\n
const [forgotUsername, setForgotUsername] = useState('')
\r\n\r\n\r\n
useEffect(() => {
\r\n
setForgotUsername(username)
\r\n
console.log(forgotUsername)
\r\n
}, [username])
\r\n\r\n
const handleUsernameChange = (e) => {
\r\n
setUsername(e.target.value);
\r\n
};
\r\n\r\n
const handlePasswordChange = (e) => {
\r\n
setPassword(e.target.value)
\r\n
}
\r\n\r\n
const userInputData = JSON.stringify({
\r\n
email: `${username}`,
\r\n
password: `${password}`
\r\n
})
\r\n\r\n
const loginRequestOptions = {
\r\n
method: 'POST',
\r\n
body: userInputData
\r\n
};
\r\n\r\n
const handleSignInFormSubmit = (e) => {
\r\n
e.preventDefault();
\r\n\r\n
oktaAuth.signInWithCredentials({ username, password })
\r\n
.then(res => {
\r\n
const sessionToken = res.sessionToken;
\r\n
setSessionToken(sessionToken);
\r\n
// sessionToken is a one-use token, so make sure this is only called once
\r\n
oktaAuth.signInWithRedirect({ sessionToken, originalUri: '/home' });
\r\n
})
\r\n
.catch(err => console.log('Found an error', err));
\r\n
};
\r\n\r\n
if (sessionToken) {
\r\n
// Hide form while sessionToken is converted into id/access tokens
\r\n
return null;
\r\n
}
\r\n\r\n
if (!authState || !authState.isAuthenticated) {
\r\n
return (
\r\n
<div className=
\"
pageContainer
\"
>
\r\n
<SignUp />
\r\n\r\n
<div className=
\"
signInForm
\"
>
\r\n
<h2>Sign in to PipIt</h2>
\r\n
<form onSubmit={handleSignInFormSubmit}>
\r\n
<label>
\r\n
Email:
\r\n
<input
\r\n
id=
\"
username
\"
type=
\"
text
\"\r\n
value={username}
\r\n
onChange={handleUsernameChange} />
\r\n
</label>
\r\n
<label>
\r\n
Password:
\r\n
<input
\r\n
id=
\"
password
\"
type=
\"
password
\"\r\n
value={password}
\r\n
onChange={handlePasswordChange} />
\r\n
</label>
\r\n
<button className=
\"
formSubmitButton
\"
type=
\"
submit
\"
>
\r\n
Sign in
\r\n
<FontAwesomeIcon icon=
\"
sign-in-alt
\"
></FontAwesomeIcon>
\r\n
</button>
\r\n
</form>
\r\n
<PasswordForgotModal loginFormUsername={forgotUsername} />
\r\n
</div>
\r\n
</div>
\r\n
)
\r\n
} else {
\r\n
return <Redirect to=
\"
/home
\"
/>
\r\n
}
\r\n
}
\r\n\r\n
export default Login"
]},
"metadata"
:{},
"sourceType"
:
"module"
}
\ No newline at end of file
Prev
1
2
3
4
5
…
11
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment