{"version":3,"sources":["api/base-request-config.js","api/authenticated-user-api.js","components/LoginModal/forgot-password-modal-1.js","components/LoginModal/forgot-password-modal-2.js","api/unauthenticated-user-api.js","components/LoginModal/logo.png","components/LoginModal/login-modal.js","App.js","reportWebVitals.js","index.js"],"names":["require","window","Promise","authHeader","headers","token","Cookies","get","Authorization","postBaseRequestConfig","body","overriddenOptions","config","method","credentials","JSON","stringify","Object","assign","authenticatedUserApi","loginEmailPassword","loginDetails","fetch","process","then","response","json","r","message","notification","error","description","set","lastLogin","path","location","reload","ForgotPasswordModal1","callback","openLogin","title","className","visible","closable","footer","initialValues","remember","onFinish","Item","name","rules","required","prefix","UserOutlined","placeholder","type","htmlType","onClick","email","getFieldValue","validator","_","value","length","reject","test","resolve","LockOutlined","dependencies","BASE_REQUEST_CONFIG","mode","Accept","BASE_PUT_CONFIG","BASE_POST_CONFIG","LOGIN","FORGOT_PASSWORD_1","FORGOT_PASSWORD_2","LoginModal","useState","modal","changeModal","setEmail","formData","createForgotPasswordToken","password","console","log","trim","resetForgottenPassword","ok","success","setTimeout","src","logo","style","width","margin","App","document","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"0VAGAA,EAAQ,KAGHC,OAAOC,UACVD,OAAOC,QAAUA,KAGZ,IAAMC,EAAa,SAACC,GACzB,IAAIC,EAAQC,IAAQC,IAAI,kBACxB,OAAIF,EACK,2BAAKD,GAAZ,IAAqBI,cAAe,UAAYH,IAEzCD,GAkBEK,EAAwB,SAACC,GAAkC,IAA5BC,EAA2B,uDAAP,GACxDC,EAAS,CACbC,OAAQ,OACRC,YAAa,UACbV,QAASD,EAAW,CAClB,eAAgB,qBAElBO,KAAMK,KAAKC,UAAUN,IAGvB,OAAOO,OAAOC,OAAON,EAAQD,ICtCxB,IAAMQ,EAAuB,CAElCC,mBAFkC,SAEfC,GACjB,OAAOC,MAAM,GAAD,OACPC,OADO,uBAEVd,EAAsBY,I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B,QAAS,gCALf,SASE,cAAC,IAAD,CACEwB,OAAQ,cAACe,EAAA,EAAD,CAAc1B,UAAU,wBAChCc,KAAK,WACLD,YAAY,eAGhB,eAAC,IAAKN,KAAN,WACE,cAAC,IAAD,CAAQO,KAAK,UAAUC,SAAS,SAAhC,oBAGA,cAAC,IAAD,CACEC,QAAS,kBAAMuB,EAAYL,IAC3BpB,KAAK,OAFP,mCAhCE,kB,cC3GD0C,MAXf,WAIE,OAFAC,SAAS1D,MAAQjB,qBAGf,qBAAKkB,UAAU,MAAf,SACE,cAAC,EAAD,OCDS0D,EAZS,SAAAC,GAClBA,GAAeA,aAAuBC,UACxC,8BAAqB7E,MAAK,YAAkD,IAA/C8E,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCDdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,EAAD,MAEFX,SAASY,eAAe,SAM1BX,M","file":"static/js/main.84ab145c.chunk.js","sourcesContent":["import Promise from 'promise-polyfill';\r\nimport { saveAs } from 'file-saver';\r\nimport Cookies from 'js-cookie';\r\nrequire('isomorphic-fetch');\r\n\r\n// To add to window\r\nif (!window.Promise) {\r\n window.Promise = Promise;\r\n}\r\n\r\nexport const authHeader = (headers) => {\r\n let token = Cookies.get('SAVANNAH_TOKEN');\r\n if (token) {\r\n return { ...headers, Authorization: 'Bearer ' + token };\r\n } else {\r\n return headers;\r\n }\r\n};\r\n\r\nexport const getBaseRequestConfig = () => {\r\n const config = {\r\n method: 'GET',\r\n mode: 'cors',\r\n credentials: 'include',\r\n headers: authHeader({\r\n Accept: 'application/json',\r\n 'Content-Type': 'application/json',\r\n }),\r\n };\r\n\r\n return config;\r\n};\r\n\r\nexport const postBaseRequestConfig = (body, overriddenOptions = {}) => {\r\n const config = {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: authHeader({\r\n 'Content-Type': 'application/json',\r\n }),\r\n body: JSON.stringify(body),\r\n };\r\n\r\n return Object.assign(config, overriddenOptions);\r\n};\r\n\r\nexport const postFormRequestConfig = (bodyObj, overriddenOptions = {}) => {\r\n // TODO: Extract to api-utils.js\r\n const body = Object.entries(bodyObj)\r\n .map(\r\n ([key, value]) =>\r\n `${encodeURIComponent(key)}=${encodeURIComponent(value)}`\r\n )\r\n .join('&');\r\n\r\n const config = {\r\n method: 'POST',\r\n credentials: 'include',\r\n headers: authHeader({\r\n 'Content-Type': 'application/x-www-form-urlencoded',\r\n }),\r\n body,\r\n };\r\n\r\n return Object.assign(config, overriddenOptions);\r\n};\r\n\r\nexport const deleteBaseRequestConfig = (body) => {\r\n const config = {\r\n method: 'DELETE',\r\n mode: 'cors',\r\n credentials: 'include',\r\n headers: authHeader({\r\n Accept: 'application/json',\r\n 'Content-Type': 'application/json',\r\n }),\r\n body: JSON.stringify(body),\r\n };\r\n\r\n return config;\r\n};\r\n\r\nexport const putBaseRequestConfig = (body ) => {\r\n const config = {\r\n method: 'PUT',\r\n mode: 'cors',\r\n credentials: 'include',\r\n headers: authHeader({\r\n Accept: 'application/json',\r\n 'Content-Type': 'application/json',\r\n }),\r\n body: JSON.stringify(body),\r\n };\r\n\r\n return config;\r\n};\r\n\r\nexport const dlaAPIRequest = (model, action, params, config = {}) => {\r\n let body = {\r\n model: model,\r\n actionparam: action,\r\n params: params,\r\n config: config,\r\n };\r\n\r\n return fetch(\r\n `${process.env.REACT_APP_API_URL}/api/rest/index`,\r\n postBaseRequestConfig(body)\r\n ).then((response) => {\r\n switch (config.responseType) {\r\n case 'blob':\r\n return response.blob();\r\n case 'json':\r\n default:\r\n return response.json();\r\n }\r\n });\r\n};\r\n\r\n/**\r\n * Helper function for when you expect a file attachment from the\r\n * response of a post (i.e. Excel export).\r\n *\r\n * The only ways to download file responses with fetch are very hacky.\r\n * We need to be able to leverage promises to manage loading states, though,\r\n * so we leverage the file-saver package to encapsulate the hackiness.\r\n *\r\n * @param {string} url - API URL you want to post to\r\n * @param {FormData} body - FormData to include in the POST body\r\n * @return {Promise} - fetch Promise\r\n */\r\nexport const postFormExpectingDownload = (url, formData, filename = '') => {\r\n const config = {\r\n method: 'POST',\r\n credentials: 'include',\r\n body: formData,\r\n };\r\n\r\n let saveFilename = filename;\r\n return fetch(url, config)\r\n .then((response) => {\r\n // Try to extract the filename if one wasn't provided\r\n if (!filename) saveFilename = extractFilenameFromHeader(response);\r\n\r\n return response.blob();\r\n })\r\n .then((blob) => saveAs(blob, saveFilename));\r\n};\r\n\r\nfunction extractFilenameFromHeader(response) {\r\n const contentDisposition = response.headers.get('content-disposition'); // header name is case-insensitive\r\n if (contentDisposition) {\r\n const regex = /^attachment;.*filename=[\"']*([\\w-.&]+)[\"']*/;\r\n const filenameResult = regex.exec(contentDisposition)[1];\r\n if (filenameResult) return filenameResult;\r\n }\r\n\r\n return null;\r\n}\r\n","import { notification } from \"antd\";\r\nimport Cookies from 'js-cookie';\r\n\r\nimport { postBaseRequestConfig } from \"./base-request-config\";\r\n\r\nexport const authenticatedUserApi = {\r\n // Sends username(email) and password and tries to authenticate on the server\r\n loginEmailPassword(loginDetails) {\r\n return fetch(\r\n `${process.env.REACT_APP_API_URL}/users/authenticate`,\r\n postBaseRequestConfig(loginDetails)\r\n )\r\n .then((response) => response.json())\r\n .then((r) => {\r\n if (r.message) {\r\n notification.error({\r\n message: \"Error\",\r\n description: r.message,\r\n });\r\n } else {\r\n //Successful login, refresh the page\r\n Cookies.set('DLALastLogin', r.lastLogin ? r.lastLogin : null, { path: '' });\r\n window.location.reload();\r\n }\r\n });\r\n },\r\n};\r\n","import { UserOutlined } from \"@ant-design/icons\";\r\nimport { Button, Form, Input, Modal } from \"antd\";\r\nimport React from \"react\";\r\nimport { authenticatedUserApi } from \"api/authenticated-user-api\";\r\n\r\n/**\r\n * A modal representing the first of two steps in the Forgot Password process.\r\n * It consists of a form that collects the user's email address.\r\n *\r\n * Props:\r\n * callback - A function that will handle the form submission. The single\r\n * argument for callback will be the form data object: {email}. The callback\r\n * is expected to send an email to the user with a one-time token for\r\n * resetting their password.\r\n */\r\nexport default function ForgotPasswordModal1({ callback, openLogin }) {\r\n return (\r\n \r\n \r\n } placeholder=\"Email\" />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","import { UserOutlined, LockOutlined } from \"@ant-design/icons\";\r\nimport { Button, Form, Input, Modal } from \"antd\";\r\nimport React from \"react\";\r\n\r\n/**\r\n * A modal representing the send of two steps in the Forgot Password process.\r\n * It consists of a form that collects the one-time token sent by email,\r\n * the user's chosen new password, and a matching confirmation password.\r\n *\r\n * Props:\r\n * callback - A function that will handle the form submission. The single\r\n * argument for callback will be the form data object:\r\n * {token, password, confirmPassword}. The callback\r\n * is expected to reset the user's password and send them to the login modal.\r\n */\r\nexport default function ForgotPasswordModal1({ callback, email, openLogin }) {\r\n return (\r\n \r\n
It may take a minute or two for you to receive this code in your inbox.
\r\n \r\n }\r\n placeholder={`One-time code sent to ${email}`}\r\n />\r\n \r\n ({\r\n validator(_, value) {\r\n if(!value.length){\r\n return Promise.resolve();\r\n }\r\n if (value.length < 8) {\r\n return Promise.reject(\"Password must be at least 8 characters in length\");\r\n }\r\n if (!/[a-zA-Z]/.test(value) || !/[0-9]/.test(value) || !/[`!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?~]/.test(value)) {\r\n return Promise.reject(\"Password must be a mix of letters, numbers & symbols\");\r\n }\r\n return Promise.resolve();\r\n },\r\n }),\r\n ]}\r\n >\r\n }\r\n type=\"password\"\r\n placeholder=\"New password\"\r\n />\r\n \r\n ({\r\n validator(_, value) {\r\n if (!value || getFieldValue(\"password\") === value) {\r\n return Promise.resolve();\r\n }\r\n return Promise.reject(\r\n \"The two passwords that you entered do not match!\"\r\n );\r\n },\r\n }),\r\n ]}\r\n >\r\n }\r\n type=\"password\"\r\n placeholder=\"Confirm password\"\r\n />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n}\r\n","\r\n// Minimal configuration for an unauthenticated request\r\nconst BASE_REQUEST_CONFIG = {\r\n mode: 'cors',\r\n headers: {\r\n Accept: 'application/json',\r\n 'Content-Type': 'application/json'\r\n }\r\n};\r\n\r\n// Minimal configuration for an unauthenticated PUT request\r\nconst BASE_PUT_CONFIG = {\r\n ...BASE_REQUEST_CONFIG,\r\n method: 'PUT'\r\n};\r\n\r\n// Minimal configuration for an unauthenticated POST request\r\nconst BASE_POST_CONFIG = {\r\n ...BASE_REQUEST_CONFIG,\r\n method: 'POST'\r\n};\r\n\r\n/**\r\n * Send a request to create a ForgotPasswordToken\r\n * The server will send an email with the token to the given\r\n * email address.\r\n *\r\n * @param {string} email - The email address the one-time token should\r\n * be sent to\r\n * @returns A promise for the JSON response\r\n */\r\nfunction createForgotPasswordToken(email) {\r\n return fetch(\r\n `${process.env.REACT_APP_API_URL}/users/forgot_password`,\r\n {\r\n ...BASE_PUT_CONFIG,\r\n body: JSON.stringify(email)\r\n }\r\n ).then(response => response.json());\r\n}\r\n\r\n/**\r\n * Send a request to reset the user's password\r\n *\r\n * @param {string} token - The one-time token sent to the user via email\r\n * @param {string} passwword - The user's new password\r\n * @returns A promise for the JSON response\r\n */\r\nfunction resetForgottenPassword({token, password}) {\r\n console.log(token);\r\n return fetch(\r\n `${process.env.REACT_APP_API_URL}/users/forgot_password`,\r\n {\r\n ...BASE_POST_CONFIG,\r\n body: JSON.stringify({\r\n token: token.trim(),\r\n password\r\n })\r\n }\r\n );\r\n}\r\n\r\nexport { createForgotPasswordToken, resetForgottenPassword }\r\n","export default __webpack_public_path__ + \"static/media/logo.f1a7000b.png\";","import React, { useState } from \"react\";\r\nimport { Button, Form, Input, Modal, notification } from \"antd\";\r\nimport { UserOutlined, LockOutlined } from \"@ant-design/icons\";\r\nimport ForgotPasswordModal1 from \"./forgot-password-modal-1\";\r\nimport ForgotPasswordModal2 from \"./forgot-password-modal-2\";\r\nimport { authenticatedUserApi } from \"api/authenticated-user-api\";\r\nimport {\r\n createForgotPasswordToken,\r\n resetForgottenPassword,\r\n} from \"api/unauthenticated-user-api\";\r\nimport logo from \"./logo.png\";\r\n\r\nimport \"./index.scss\";\r\n\r\n// Three login modals\r\n// The Forgot Password flow proceeds form LOGIN to FORGOT_PASSWORD_1 to\r\n// FORGOT_PASSWORD_2.\r\n// Two-factor authentication could be implemented by adding another modal.\r\nconst LOGIN = \"LOGIN\";\r\nconst FORGOT_PASSWORD_1 = \"FORGOT_PASSWORD_1\";\r\nconst FORGOT_PASSWORD_2 = \"FORGOT_PASSWORD_2\";\r\n\r\nexport const LoginModal = () => {\r\n const [modal, changeModal] = useState(LOGIN);\r\n const [email, setEmail] = useState(\"\");\r\n\r\n /**\r\n * Handles form submission from ForgotPasswordModal1.\r\n * The server will send an email to the user with a one-time token for\r\n * resetting their password.\r\n * The view is switched to ForgotPasswordModal2 so the user can then enter\r\n * the one-time token and their new password.\r\n *\r\n * @param {object} formData - should include a validated email field\r\n * @returns void\r\n */\r\n function forgotPassword1Callback(formData) {\r\n // Send PUT to users/forgot_password\r\n createForgotPasswordToken(formData.email)\r\n // Switch to the second Forgot Password modal\r\n .then(() => {\r\n setEmail(formData.email);\r\n changeModal(FORGOT_PASSWORD_2);\r\n });\r\n }\r\n\r\n /**\r\n * Handles form submission from ForgotPasswordModal2.\r\n * A request to reset the user's password is sent to the server. A message\r\n * is displayed that either \"Password Successfully Reset\" or\r\n * \"Unable to Reset Your Password\" (most likely because the token\r\n * has expired).\r\n * The view is switched to LoginModal so the user can either login or\r\n * request a new Forgot Password token.\r\n *\r\n * @param {object} formData - should include a validated email field\r\n * @returns void\r\n */\r\n function forgotPassword2Callback(formData) {\r\n // Send POST to users/forgot_password to reset the password\r\n resetForgottenPassword(formData)\r\n // Switch to the second Forgot Password modal\r\n .then((response) => {\r\n if (response.ok) {\r\n notification.success({\r\n 'message': 'Password Successfully Reset, redirecting to login page',\r\n });\r\n window.setTimeout(() =>{\r\n changeModal(LOGIN);\r\n }, 2000);\r\n } else {\r\n notification.error({\r\n 'message': 'Unable to Reset Password',\r\n });\r\n }\r\n });\r\n }\r\n\r\n // Show one of the login modals\r\n switch (modal) {\r\n // First Forgot Password modal; has email input\r\n case FORGOT_PASSWORD_1:\r\n return (\r\n changeModal(LOGIN)}\r\n />\r\n );\r\n\r\n // Second Forgot Password modal; has token, password, and confirmPassword inputs\r\n case FORGOT_PASSWORD_2:\r\n return (\r\n changeModal(LOGIN)}\r\n />\r\n );\r\n\r\n // The primary login modal\r\n default:\r\n return (\r\n \r\n \r\n