-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathforgot-password.html
190 lines (168 loc) · 5.7 KB
/
forgot-password.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reset Password</title>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--primary-color: #6C63FF;
--secondary-color: #3F3D56;
--accent-color: #F50057;
--text-color: #F8F9FA;
--bg-color: #121212;
--card-bg: #1E1E1E;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Poppins', sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.reset-container {
background-color: var(--card-bg);
border-radius: 10px;
padding: 2rem;
width: 100%;
max-width: 400px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
h1 {
font-size: 2rem;
font-weight: 700;
margin-bottom: 1rem;
text-align: center;
}
.description {
text-align: center;
margin-bottom: 1.5rem;
color: #D1D5DB;
}
form {
display: flex;
flex-direction: column;
}
.form-group {
margin-bottom: 1rem;
}
label {
display: block;
margin-bottom: 0.5rem;
font-weight: 500;
}
input {
width: 100%;
padding: 0.75rem;
border: 1px solid #4B5563;
border-radius: 5px;
background-color: #374151;
color: var(--text-color);
}
.reset-btn {
background-color: #F50057;
color: var(--text-color);
padding: 0.75rem;
border: none;
border-radius: 5px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease;
}
.reset-btn:hover {
background-color: #5A52D5;
}
.signin-link {
text-align: center;
margin-top: 1rem;
}
.signin-link a {
color: var(--primary-color);
text-decoration: none;
}
.return-container {
text-align: center;
margin-top: 1rem; /* Space above the button */
}
.return-btn {
background-color: var(--primary-color); /* Matches the primary color */
color: var(--text-color);
padding: 0.75rem;
border: none;
border-radius: 5px;
font-weight: 600;
cursor: pointer;
transition: background-color 0.3s ease;
font-size: 1rem; /* Adjust font size if needed */
}
.return-btn:hover {
background-color: #4A2C77; /* Darker shade of primary color */
}
</style>
</head>
<body>
<div class="reset-container">
<h1>Reset Password</h1>
<p class="description">Type in your email and we'll send you a link to reset your password</p>
<form id="reset-form">
<div class="form-group">
<label for="email">Email</label>
<input type="email" id="email" name="email" required placeholder="name@example.com">
</div>
<button type="submit" class="reset-btn">Send Reset Email</button>
</form>
<div class="signin-link">
<p>Already have an account? <a href="login.html">Sign In</a></p>
</div>
<div class="return-container">
<button type="button" class="return-btn" onclick="window.location.href='dashboard.html'">Return to Dashboard</button>
</div>
</div>
<script type="module">
// Import the necessary Firebase modules
import { initializeApp } from "https://www.gstatic.com/firebasejs/10.12.1/firebase-app.js";
import { getAuth, sendPasswordResetEmail } from "https://www.gstatic.com/firebasejs/10.12.1/firebase-auth.js";
// Your web app's Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyDaMAlQRMXiDsZ4P0b06P18id3y5xBiZ1k",
authDomain: "deepworkai-c3419.firebaseapp.com",
projectId: "deepworkai-c3419",
storageBucket: "deepworkai-c3419.appspot.com",
messagingSenderId: "367439182644",
appId: "1:367439182644:web:304216430df97eff68c361"
};
// Initialize Firebase
const app = initializeApp(firebaseConfig);
const auth = getAuth();
// Password Reset Form
const resetForm = document.getElementById('reset-form');
if (resetForm) {
resetForm.addEventListener('submit', (e) => {
e.preventDefault();
const email = document.getElementById('email').value;
sendPasswordResetEmail(auth, email)
.then(() => {
// Password reset email sent successfully
alert("Password reset email sent. Please check your inbox.");
window.location.href = "login.html"; // Redirect to login page
})
.catch((error) => {
const errorCode = error.code;
const errorMessage = error.message;
console.error('Error sending password reset email:', errorCode, errorMessage);
alert(`Error sending password reset email: ${errorCode} - ${errorMessage}`);
});
});
}
</script>
</body>
</html>