From 2b07b54a814185a3862c2f44fafa6f1fba4ee280 Mon Sep 17 00:00:00 2001 From: Ksathwik03 Date: Wed, 3 Nov 2021 13:24:23 +0530 Subject: [PATCH] forget password: --- package.json | 2 ++ src/Loginsignup/Home.js | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 9558f65c..6fdb804f 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,8 @@ "react-router-dom": "^5.3.0", "react-scripts": "4.0.3", "react-scroll-sync": "^0.9.0", + "react-toastify": "^8.0.3", + "toast": "^0.3.47", "web-vitals": "^1.1.2" }, "scripts": { diff --git a/src/Loginsignup/Home.js b/src/Loginsignup/Home.js index 3c536f89..f498901e 100644 --- a/src/Loginsignup/Home.js +++ b/src/Loginsignup/Home.js @@ -1,6 +1,9 @@ import React, { useState , useContext, useEffect } from 'react'; import axios from "axios"; import "./Home.css"; +import { ToastContainer } from 'react-toastify'; +import { Toast } from 'react-toastify/dist/components'; + function updateLocalStorage(tokens) { localStorage.setItem('accessToken', tokens.accessToken) @@ -88,6 +91,16 @@ const LogSign = () => { } } + const forgetPassword = async() => { + const body = {email: userNameSignin} + await axios.post(`http://localhost:8000/user/forgotpassword/`, body) + .then((res) => { + if(res.status == 200){ + Toast("Please check your email for instructions"); + } + }) + } + // console.log(`${'a' + (1^signupShow)}`); return ( <> @@ -113,7 +126,7 @@ const LogSign = () => { setUserNameSignin(e.target.value)}/> setPasswordSignin(e.target.value)}/> - Forgot your password? +