-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathforgot-password.html
197 lines (171 loc) · 5.9 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
191
192
193
194
195
196
197
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Reset Password - Online Code Editor</title>
<!-- Favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="./src/images/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="./src/images/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="./src/images/favicon-16x16.png">
<!-- External Styles -->
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Roboto+Mono&display=swap" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" rel="stylesheet">
<style>
body {
font-family: 'Roboto Mono', monospace;
background-color: #f8f9fa;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}
.reset-container {
max-width: 400px;
width: 100%;
background: #fff;
padding: 30px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
border-radius: 8px;
}
.reset-container h1 {
text-align: center;
margin-bottom: 10px;
font-size: 2em;
color: #000;
}
.reset-container h1 i {
color: #007bff;
margin-right: 10px;
}
.reset-container h1 .code {
color: #28a745;
}
.reset-container h1 .editor {
color: #007bff;
}
.reset-container p {
text-align: center;
margin-bottom: 20px;
color: #6c757d;
font-size: 14px;
}
.form-group {
margin-bottom: 20px;
position: relative;
}
.form-group i {
position: absolute;
left: 10px;
top: 50%;
transform: translateY(-50%);
color: #6c757d;
font-size: 1.2em;
}
.form-control {
padding: 10px 10px 10px 50px;
font-size: 16px;
border: none;
border-bottom: 2px solid #6c757d;
border-radius: 0;
background-color: transparent;
outline: none;
transition: border-color 0.3s;
}
.form-control::placeholder {
color: #adb5bd;
}
.form-control:focus {
border-color: #007bff;
box-shadow: none;
}
.btn-primary {
background-color: #28a745;
border: none;
font-size: 16px;
padding: 12px;
border-radius: 8px;
}
.btn-primary:hover {
background-color: #218838;
}
.login-link {
text-align: center;
margin-top: 15px;
font-size: 14px;
}
.login-link a {
color: #007bff;
text-decoration: none;
}
.login-link a:hover {
text-decoration: underline;
}
.success-message {
color: green;
font-size: 14px;
text-align: center;
margin-bottom: 10px;
}
.error-message {
color: red;
font-size: 14px;
text-align: center;
margin-bottom: 10px;
}
</style>
</head>
<body>
<div class="reset-container">
<h1><i class="fas fa-code"></i><span class="code">Code</span> <span class="editor">Editor</span></h1>
<p>Forgot your password? Enter your email to reset it.</p>
<div id="message"></div>
<form id="resetPasswordForm">
<div class="form-group">
<i class="fas fa-envelope"></i>
<input type="email" class="form-control" id="resetEmail" name="email" placeholder="Enter your email" required>
</div>
<button type="submit" class="btn btn-primary btn-block">
<i class="fas fa-paper-plane"></i> Send Reset Link
</button>
</form>
<div class="login-link">
Remembered your password? <a href="login.html">Login</a>
</div>
</div>
<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/9.17.1/firebase-app.js"></script>
<script src="https://www.gstatic.com/firebasejs/9.17.1/firebase-auth.js"></script>
<script>
// Firebase configuration
const firebaseConfig = {
apiKey: "AIzaSyD8kL3cEoh2t_QuiHqk0x21BNV9knd01rU",
authDomain: "code-editor-efd72.firebaseapp.com",
projectId: "code-editor-efd72",
storageBucket: "code-editor-efd72.firebasestorage.app",
messagingSenderId: "28165650101",
appId: "1:28165650101:web:16c852e94780ac5f11b0fc",
measurementId: "G-82HBJ4TR9S"
};
// Initialize Firebase
const app = firebase.initializeApp(firebaseConfig);
const auth = firebase.getAuth(app);
// Reset password logic
const resetPasswordForm = document.getElementById('resetPasswordForm');
const resetEmail = document.getElementById('resetEmail');
const messageDiv = document.getElementById('message');
resetPasswordForm.addEventListener('submit', async (e) => {
e.preventDefault();
try {
await firebase.sendPasswordResetEmail(auth, resetEmail.value);
messageDiv.innerHTML = `<p class="success-message">Reset link sent! Check your email.</p>`;
resetPasswordForm.reset();
} catch (error) {
messageDiv.innerHTML = `<p class="error-message">${error.message}</p>`;
}
});
</script>
</body>
</html>