Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
saras-69 committed Nov 3, 2024
1 parent 2f00946 commit 1860d3a
Showing 1 changed file with 25 additions and 3 deletions.
28 changes: 25 additions & 3 deletions forgotPassword.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
display: flex;
justify-content: center;
align-items: center;

padding: 20px;
border-radius: 10px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
Expand Down Expand Up @@ -127,7 +126,7 @@
<div class="form-container">
<form id="forgotPasswordForm">
<h1>Forgot Password</h1>
<input type="email" placeholder="Enter your email" id="recoveryEmail">
<input type="email" placeholder="Enter your email" id="recoveryEmail" required>
<button type="submit">Send Recovery Link</button>
</form>
<div class="button-container">
Expand Down Expand Up @@ -156,8 +155,31 @@ <h1>Forgot Password</h1>
return;
}

// Prepare data for backend integration
const data = {
email: recoveryEmail
};

// Implement your password recovery logic here
alert("Password recovery link has been sent to your email address");
fetch('YOUR_BACKEND_ENDPOINT', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify(data)
})
.then(response => response.json())
.then(data => {
if (data.success) {
alert("Password recovery link has been sent to your email address");
} else {
alert("An error occurred. Please try again.");
}
})
.catch((error) => {
console.error('Error:', error);
alert("An error occurred. Please try again.");
});
});

function validateEmail(email) {
Expand Down

0 comments on commit 1860d3a

Please sign in to comment.