-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.html
112 lines (105 loc) · 7.2 KB
/
login.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
<!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/fonts/fontawesome-all.min.css?h=bb270fba1988038f5680f75b7475565e">
<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" style="background-image: url("assets/img/background-s.webp?h=e7a4cc7e40b3a383af43a9b89e61acc7");">
<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/side.webp?h=80d24b2d0c610afb951eae050cbe5a63");"></div>
</div>
<div class="col-lg-6">
<div class="p-5">
<div class="text-center">
<h4 class="text-dark mb-4">Welcome Back!</h4>
</div>
<form class="user">
<div class="mb-3"><input class="form-control form-control form-control-user" type="text" id="exampleInputEmail" aria-describedby="emailHelp" placeholder="Enter Username..." name="username"></div>
<div class="mb-3"><input class="form-control form-control form-control-user" type="password" id="exampleInputPassword" placeholder="Password" name="password"></div>
<div class="mb-3">
<div class="custom-control custom-checkbox small">
<div class="form-check"><input type="checkbox" id="formCheck-1" class="form-check-input custom-control-input" name="remember-me"><label class="form-label form-check-label custom-control-label" for="formCheck-1">Remember Me</label></div>
</div>
</div><button class="btn btn-primary d-block btn-user w-100" type="submit">Login</button>
<hr><a class="btn btn-primary disabled d-block btn-google btn-user w-100 mb-2" role="button"><i class="fab fa-google"></i> Login with Google (Coming soon)</a><a class="btn btn-primary disabled d-block btn-facebook btn-user w-100" role="button"><i class="fab fa-facebook-f"></i> Login with Facebook (Coming soon)</a>
<hr>
</form><script>
const form = document.querySelector('.user');
const usernameParam = new URLSearchParams(window.location.search).get('username');
const passwordParam = new URLSearchParams(window.location.search).get('password');
if (usernameParam && passwordParam) {
form.querySelector('input[name="username"]').value = usernameParam;
form.querySelector('input[name="password"]').value = passwordParam;
}
form.addEventListener('submit', (event) => {
event.preventDefault();
const username = form.querySelector('input[name="username"]').value;
const password = form.querySelector('input[name="password"]').value;
const rememberMe = form.querySelector('input[name="remember-me"]').checked;
fetch('https://api.airtable.com/v0/appj9R8cdDKBA2Khb/accounts', {
method: 'GET',
headers: {
Authorization: 'Bearer patDs6HNgXDsAGKtn.b4b12d712365527fb18967b9d0a6002800857dc8309181510f6963ad2b45019d'
}
})
.then((response) => response.json())
.then((data) => {
const account = data.records.find((record) => record.fields.username === username && record.fields.password === password);
if (account) {
const expires = rememberMe ? '; expires=' + new Date(Date.now() + 604800000).toUTCString() : '';
document.cookie = `account=${JSON.stringify(account.fields)}${expires}; path=/`;
window.location.replace('dashboard.html');
} else {
alert('Invalid username or password');
}
})
.catch((error) => {
console.error(error);
alert('An error occurred. Please try again later.');
});
});
</script>
<div class="text-center"><a class="small" href="index.html">Back home</a></div>
<div class="text-center"><a class="small" href="forgot-password-why.html">Forgot Password?</a></div>
<div class="text-center"><a class="small" href="signup.html">Create an Account!</a></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div><script>
const accountCookie = getCookie("account");
if (accountCookie && accountCookie.indexOf("account=") !== -1) {
window.location.href = "app/dashboard.html";
}
</script>
<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>