-
Notifications
You must be signed in to change notification settings - Fork 0
/
forgot-password.html
114 lines (103 loc) · 6.05 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
<title>Login - DigiCash Dashboard</title>
<meta name="description" content="The one dashboard to manage your DigiCash. Don't have any? Create an account and get some free credits">
<link rel="icon" type="image/png" sizes="500x500" href="assets/img/icon.png?h=65db8f52059975fa40b00e7f7accfb7e">
<link rel="icon" type="image/png" sizes="500x500" href="assets/img/icon.png?h=65db8f52059975fa40b00e7f7accfb7e">
<link rel="icon" type="image/png" sizes="500x500" href="assets/img/icon.png?h=65db8f52059975fa40b00e7f7accfb7e">
<link rel="icon" type="image/png" sizes="500x500" href="assets/img/icon.png?h=65db8f52059975fa40b00e7f7accfb7e">
<link rel="icon" type="image/png" sizes="500x500" href="assets/img/icon.png?h=65db8f52059975fa40b00e7f7accfb7e">
<link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css?h=cb606d99bb2418df19b6bc818b41e412">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i&display=swap">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono&display=swap">
<link rel="stylesheet" href="assets/css/animated-services.css?h=999aac9edd71396446e18beb66d01a03">
<link rel="stylesheet" href="assets/css/Articles-Cards-images.css?h=4f3cfa46e40e236365345fc77963f4b8">
<link rel="stylesheet" href="assets/css/Bootstrap-Callout-Danger.css?h=a01ce0f06f835595f67acd16b3bf64e9">
<link rel="stylesheet" href="assets/css/Bootstrap-Callout-Info.css?h=15b43fafd5928244e49dc20add914164">
<link rel="stylesheet" href="assets/css/Navbar-Right-Links-Dark-icons.css?h=0665e33d047a1482292ef967f3a249e2">
</head>
<body class="bg-gradient-primary"><script>
if (document.cookie.indexOf("account=") !== -1) {
window.location.href = "forgot-password-why.html";
}
window.location.href = "account-reclamation.html"
</script>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-9 col-lg-12 col-xl-10">
<div class="card shadow-lg o-hidden border-0 my-5">
<div class="card-body p-0">
<div class="row">
<div class="col-lg-6 d-none d-lg-flex">
<div class="flex-grow-1 bg-login-image" style="background-image: url("assets/img/backgrounds/forgot/pwd.webp?h=b1b74b6d46fa1e8aa28030a54fe9527f");"></div>
</div>
<div class="col-lg-6">
<div class="p-5">
<div class="text-center">
<h4 class="text-dark mb-4">Forgot your password?</h4>
</div><form class="user">
<div class="mb-3"><input id="exampleInputEmail" class="form-control form-control form-control-user" type="text" aria-describedby="emailHelp" placeholder="Enter Username..." name="username" /></div>
<div class="mb-3"><input id="exampleInputPassword" class="form-control form-control form-control-user" type="password" placeholder="Pin" name="PIN" /></div>
<p class="lead text-center" style="font-size: 11px;">On your first login, your dashboard will show your Pin</p><button class="btn btn-primary d-block btn-user w-100" type="submit">Show password</button>
<hr />
</form><script>
var authBaseId = "appj9R8cdDKBA2Khb"
var authTableName = "accounts"
var authAccessToken = "patDs6HNgXDsAGKtn.b4b12d712365527fb18967b9d0a6002800857dc8309181510f6963ad2b45019d"
// Select the form element
const form = document.querySelector('.user');
// Add a submit event listener to the form
form.addEventListener('submit', (event) => {
event.preventDefault(); // prevent default form submission behavior
// Get the value of the username input field
const username = form.querySelector('input[name="username"]').value;
// Fetch data from Airtable
fetch(`https://api.airtable.com/v0/${authBaseId}/${authTableName}?filterByFormula=AND(username="${username}")`, {
headers: {
Authorization: `Bearer ${authAccessToken}`,
},
})
.then((response) => response.json())
.then((data) => {
// Get the PIN field value from the first record, or set to undefined if no records are returned
const PIN = data.records[0]?.fields?.PIN;
// Get the value of the PIN input field
const enteredPIN = form.querySelector('input[name="PIN"]').value;
console.log(PIN);
console.log("entered" + ": " + enteredPIN);
if (PIN && enteredPIN === PIN.toString()) {
// Set the "recovery" cookie with value "true" and expiration when the browser closes
document.cookie = 'recovery=true; expires=0; path=/';
// Redirect to forgot-auth.html
window.location.href = 'forgot-auth.html';
} else {
// Display an error message to the user
alert('Incorrect PIN. Please try again.');
}
})
.catch((error) => {
console.error(error);
});
});
console.log(data);
</script>
<div class="text-center"><a class="small" href="index.html">Back home</a></div>
<div class="text-center"><a class="small" href="signup.html">Create an Account!</a></div>
<div class="text-center"><a class="small" href="signup.html">Need help?</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<p class="font-monospace text-center" style="font-family: monospace!important;color: rgb(0,0,0);font-weight: bold;">DigiCash Banking System - v0.9.2</p>
<script src="assets/bootstrap/js/bootstrap.min.js?h=79ff9637b74326c362fb6f7f5801a7ba"></script>
<script src="assets/js/bs-init.js?h=bd1e7bf16294cd29af0339e7c8132178"></script>
<script src="assets/js/theme.js?h=79f403485707cf2617c5bc5a2d386bb0"></script>
</body>
</html>