%PDF- %PDF-
Direktori : /home/opti/public_html/ncf/static/js/ |
Current File : /home/opti/public_html/ncf/static/js/52.d41ef2c9.chunk.js.map |
{"version":3,"sources":["app/actions/reset-password.js","app/main/Forgot/Reset/index.js"],"names":["resetAction","resetdata","fetch","SERVER_URL","method","headers","body","JSON","stringify","then","response","json","console","log","message","status","localStorage","setItem","window","location","href","CLIENT_URL","reload","code","Forgot","AuthSection","TopHeader","FormDiv","styled","div","section","ResetForm","className","name","initialValues","remember","onFinish","values","password","new_password","confirm_password","queryString","search","URLSearchParams","get","onFinishFailed","errorInfo","autoComplete","Item","rules","required","Password","placeholder","type","htmlType"],"mappings":"2NA0BeA,EAxBK,SAACC,GACjBC,MAAM,GAAD,OAAIC,aAAJ,wBAAsC,CACvCC,OAAQ,OACRC,QAAQ,CACN,OAAU,mBACV,eAAgB,oBAElBC,KAAMC,KAAKC,UAAUP,KACpBQ,MAAK,SAAAC,GAAQ,OAAIA,EAASC,UAC5BF,MAAK,SAAAE,GACFC,QAAQC,IAAIF,EAAKG,QAAS,QACP,MAAhBH,EAAKI,QACNC,aAAaC,QAAQ,gBAAiBV,KAAKC,UAAUG,EAAKG,UACxDI,OAAOC,SAASC,KAAhB,UAA0BC,aAA1B,WACsB,MAAhBV,EAAKI,QACbC,aAAaC,QAAQ,cAAeV,KAAKC,UAAUG,EAAKG,UACxDI,OAAOC,SAASG,WAEdV,QAAQC,IAAI,0BACZK,OAAOC,SAASC,KAAhB,UAA0BC,aAA1B,0BAAsDpB,EAAUsB,W,0CCH/DC,UAXf,WACE,OACE,eAACC,EAAD,WACE,cAACC,EAAA,EAAD,IACE,cAACC,EAAD,UACE,cAAC,EAAD,UAMKH,IAETG,EAAUC,IAAOC,IAAV,mMAUPJ,EAAcG,IAAOE,QAAV,qLAUXC,EAAY,WAwBhB,OACE,eAAC,IAAD,CAAMC,UAAU,aAAaC,KAAK,QAAQC,cAAe,CAACC,UAAU,GAAQC,SAxB7D,SAACC,GAChB,IAAMC,EAAWD,EAAOE,aAClBC,EAAmBH,EAAOG,iBAG1BC,EAAcvB,OAAOC,SAASuB,OAE9BnB,EADY,IAAIoB,gBAAgBF,GACfG,IAAI,QAQ3B5C,EANa,CACTuB,OACAe,WACAE,sBAY4FK,eAL3E,SAACC,GACtBlC,QAAQC,IAAI,UAAWiC,IAIyGC,aAAa,MAA7I,UAEE,oBAAIf,UAAU,yBAAd,4BAEA,sBAAKA,UAAU,kBAAf,UACE,cAAC,IAAKgB,KAAN,CAAahB,UAAU,cAAeC,KAAK,eAAegB,MAAO,CAAC,CAC5DC,UAAU,EACVpC,QAAS,mCAFf,SAKE,cAAC,IAAMqC,SAAP,CAAgBC,YAAY,eAAepB,UAAU,eAGvD,cAAC,IAAKgB,KAAN,CAAahB,UAAU,cAAeC,KAAK,mBAAmBgB,MAAO,CAAC,CAChEC,UAAU,EACVpC,QAAS,iCAFf,SAKE,cAAC,IAAMqC,SAAP,CAAgBC,YAAY,mBAAmBpB,UAAU,kBAK7D,cAAC,IAAKgB,KAAN,UACE,cAAC,IAAD,CAAQhB,UAAU,aAAaqB,KAAK,UAAUC,SAAS,SAAvD,qBAKF,cAAC,IAAKN,KAAN,CAAYhB,UAAU,oCAAtB,SACE,4DAA8B,mBAAGZ,KAAK,UAAR","file":"static/js/52.d41ef2c9.chunk.js","sourcesContent":["import {SERVER_URL, CLIENT_URL} from '../config/server';\r\n\r\nconst resetAction = (resetdata) =>{\r\n fetch(`${SERVER_URL}/auth/reset-password`, {\r\n method: 'POST',\r\n headers:{\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(resetdata)\r\n }).then(response => response.json())\r\n .then(json => {\r\n console.log(json.message, 'json')\r\n if(json.status === 200){\r\n localStorage.setItem('login-success', JSON.stringify(json.message));\r\n window.location.href = `${CLIENT_URL}signin`;\r\n }else if (json.status === 422) {\r\n localStorage.setItem('login-error', JSON.stringify(json.message));\r\n window.location.reload();\r\n } else{\r\n console.log(\"Password change failed\");\r\n window.location.href = `${CLIENT_URL}reset-password?${resetdata.code}`;\r\n }\r\n });\r\n}\r\n\r\nexport default resetAction\r\n","import React from 'react';\r\nimport \"../../SignIn/signin.css\"\r\nimport \"../../style.css\"\r\nimport TopHeader from \"../../../layout/components/TopBar/TopHeader\"\r\nimport resetAction from '../../../actions/reset-password'\r\nimport styled from 'styled-components'\r\nimport { Form, Input, Button, Checkbox } from 'antd';\r\nfunction Forgot() {\r\n return (\r\n <AuthSection>\r\n <TopHeader/>\r\n <FormDiv> \r\n <ResetForm/>\r\n </FormDiv>\r\n </AuthSection>\r\n );\r\n}\r\n\r\nexport default Forgot;\r\n\r\nconst FormDiv = styled.div`\r\n width: 100%;\r\n min-height: 100vh;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n background-color: #0000008f;\r\n`;\r\n\r\nconst AuthSection = styled.section`\r\n width: 100%;\r\n min-height: 100vh;\r\n background: url('assets/images/banner/species.png');\r\n background-size: cover;\r\n background-position: center;\r\n`;\r\n\r\n\r\n\r\nconst ResetForm = () => {\r\n const onFinish = (values) => {\r\n const password = values.new_password;\r\n const confirm_password = values.confirm_password;\r\n\r\n //Getting code from URL Parameters\r\n const queryString = window.location.search;\r\n const urlParams = new URLSearchParams(queryString);\r\n const code = urlParams.get('code')\r\n\r\n const data = {\r\n code,\r\n password,\r\n confirm_password\r\n };\r\n \r\n resetAction(data);\r\n\r\n };\r\n\r\n const onFinishFailed = (errorInfo) => {\r\n console.log('Failed:', errorInfo);\r\n };\r\n\r\n return (\r\n <Form className=\"signupform\" name=\"basic\" initialValues={{remember: true,}} onFinish={onFinish} onFinishFailed={onFinishFailed} autoComplete=\"off\">\r\n \r\n <h1 className=\"text-white text-center\">Reset Password</h1>\r\n\r\n <div className=\"form-item-group\">\r\n <Form.Item className=\"formItemcon\" name=\"new_password\" rules={[{\r\n required: true,\r\n message: 'Please enter your new password',\r\n },]}>\r\n\r\n <Input.Password placeholder=\"New Password\" className=\"formItem\" />\r\n </Form.Item>\r\n\r\n <Form.Item className=\"formItemcon\" name=\"confirm_password\" rules={[{\r\n required: true,\r\n message: 'Please confirm your password',\r\n },]}>\r\n\r\n <Input.Password placeholder=\"Confirm Password\" className=\"formItem\" />\r\n </Form.Item>\r\n </div>\r\n\r\n\r\n <Form.Item>\r\n <Button className=\"formButton\" type=\"primary\" htmlType=\"submit\">\r\n Reset\r\n </Button>\r\n </Form.Item>\r\n\r\n <Form.Item className=\"signuplink text-base text-center\">\r\n <h5>Don't have an Account yet <a href=\"/signup\">Sign Up</a></h5>\r\n </Form.Item>\r\n </Form>\r\n );\r\n};\r\n"],"sourceRoot":""}