Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
17 changes: 15 additions & 2 deletions src/Loginsignup/Home.js
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -90,6 +93,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 (
<>
Expand All @@ -115,7 +128,7 @@ const LogSign = () => {
<input className="input" required id="email_signin" type="email" placeholder="Email" onChange={(e) => setUserNameSignin(e.target.value)}/>
<input className="input" required id="pass_signin" type="password" placeholder="Password" onChange={(e) => setPasswordSignin(e.target.value)}/>
<a className="a" href="#">
Forgot your password?
<button className="button" onClick= {forgetPassword}> Forgot your password? </button>
</a>
<button className="button" onClick={signinSubmit}>
Sign In
Expand Down Expand Up @@ -152,7 +165,7 @@ const LogSign = () => {
</div>
</div>
</div>

<ToastContainer/>
</>
)
}
Expand Down