sequelize-game-bank 5.0.0 → 5.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/public/js/js.js +771 -526
- package/public/login.html +129 -66
- package/public/register.html +505 -431
package/public/login.html
CHANGED
|
@@ -1,72 +1,135 @@
|
|
|
1
|
-
<!
|
|
1
|
+
<!doctype html>
|
|
2
2
|
<html lang="ru">
|
|
3
|
-
<head>
|
|
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
|
-
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<title>City-bank | Вход в систему</title>
|
|
6
|
+
<style>
|
|
7
|
+
body {
|
|
8
|
+
font-family: sans-serif;
|
|
9
|
+
background: #f4f6f9;
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
height: 100vh;
|
|
14
|
+
margin: 0;
|
|
15
|
+
}
|
|
16
|
+
.card {
|
|
17
|
+
background: white;
|
|
18
|
+
padding: 30px;
|
|
19
|
+
border-radius: 8px;
|
|
20
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
21
|
+
width: 100%;
|
|
22
|
+
max-width: 380px;
|
|
23
|
+
}
|
|
24
|
+
h2 {
|
|
25
|
+
text-align: center;
|
|
26
|
+
color: #007bff;
|
|
27
|
+
margin-top: 0;
|
|
28
|
+
}
|
|
29
|
+
.group {
|
|
30
|
+
margin: 15px 0;
|
|
31
|
+
}
|
|
32
|
+
label {
|
|
33
|
+
display: block;
|
|
34
|
+
margin-bottom: 5px;
|
|
35
|
+
font-weight: bold;
|
|
36
|
+
font-size: 14px;
|
|
37
|
+
}
|
|
38
|
+
input {
|
|
39
|
+
width: 100%;
|
|
40
|
+
padding: 10px;
|
|
41
|
+
border: 1px solid #ddd;
|
|
42
|
+
border-radius: 4px;
|
|
43
|
+
box-sizing: border-box;
|
|
44
|
+
font-size: 16px;
|
|
45
|
+
}
|
|
46
|
+
.btn {
|
|
47
|
+
width: 100%;
|
|
48
|
+
padding: 12px;
|
|
49
|
+
background: #007bff;
|
|
50
|
+
color: white;
|
|
51
|
+
border: none;
|
|
52
|
+
border-radius: 4px;
|
|
53
|
+
font-size: 16px;
|
|
54
|
+
font-weight: bold;
|
|
55
|
+
cursor: pointer;
|
|
56
|
+
}
|
|
57
|
+
.error {
|
|
58
|
+
color: #dc3545;
|
|
59
|
+
font-size: 14px;
|
|
60
|
+
margin-top: 10px;
|
|
61
|
+
display: none;
|
|
62
|
+
text-align: center;
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
65
|
+
</head>
|
|
66
|
+
<body>
|
|
67
|
+
<div class="card">
|
|
68
|
+
<h2>ВХОД В CITY-BANK</h2>
|
|
69
|
+
<div class="group">
|
|
70
|
+
<label for="login-name">Никнейм (Логин)</label>
|
|
71
|
+
<input type="text" id="login-name" placeholder="Введите ваш ник" />
|
|
72
|
+
</div>
|
|
73
|
+
<div class="group">
|
|
74
|
+
<label for="login-pass">Пароль</label>
|
|
75
|
+
<input type="password" id="login-pass" placeholder="Введите пароль" />
|
|
76
|
+
</div>
|
|
39
77
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
78
|
+
<!-- Скрытый блок 2FA, активируемый бэкендом -->
|
|
79
|
+
<div class="group" id="totp-block" style="display: none">
|
|
80
|
+
<label for="login-totp" style="color: #28a745"
|
|
81
|
+
>Введите временный токен 2FA</label
|
|
82
|
+
>
|
|
83
|
+
<input
|
|
84
|
+
type="text"
|
|
85
|
+
id="login-totp"
|
|
86
|
+
placeholder="000000"
|
|
87
|
+
style="text-align: center; font-size: 20px; letter-spacing: 2px"
|
|
88
|
+
/>
|
|
89
|
+
</div>
|
|
47
90
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const result = await response.json();
|
|
91
|
+
<div id="login-error" class="error"></div>
|
|
92
|
+
<button class="btn" onclick="submitLogin()">Войти в кабинет</button>
|
|
93
|
+
<p style="text-align: center; font-size: 14px; margin-top: 15px">
|
|
94
|
+
<a href="/bank/register.html">Создать аккаунт</a>
|
|
95
|
+
</p>
|
|
96
|
+
</div>
|
|
55
97
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
document.getElementById(
|
|
60
|
-
|
|
61
|
-
errBlock
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
98
|
+
<script>
|
|
99
|
+
async function submitLogin() {
|
|
100
|
+
const name = document.getElementById("login-name").value.trim();
|
|
101
|
+
const pass = document.getElementById("login-pass").value;
|
|
102
|
+
const totp = document.getElementById("login-totp").value.trim();
|
|
103
|
+
const errBlock = document.getElementById("login-error");
|
|
104
|
+
errBlock.style.display = "none";
|
|
105
|
+
try {
|
|
106
|
+
const response = await fetch("/api/bank/users/login", {
|
|
107
|
+
method: "POST",
|
|
108
|
+
headers: {
|
|
109
|
+
"Content-Type": "application/json",
|
|
110
|
+
"Bypass-Tunnel-Reminder": "true",
|
|
111
|
+
},
|
|
112
|
+
body: JSON.stringify({
|
|
113
|
+
name,
|
|
114
|
+
password: pass,
|
|
115
|
+
totpCode: totp || null,
|
|
116
|
+
}),
|
|
117
|
+
});
|
|
118
|
+
const result = await response.json();
|
|
119
|
+
if (response.ok && result.status === true) {
|
|
120
|
+
window.location.href = "/bank/general.html";
|
|
121
|
+
} else if (result.require2FA) {
|
|
122
|
+
document.getElementById("totp-block").style.display = "block";
|
|
123
|
+
errBlock.innerText = result.message;
|
|
124
|
+
errBlock.style.display = "block";
|
|
125
|
+
} else {
|
|
126
|
+
errBlock.innerText = result.message || "Ошибка авторизации";
|
|
127
|
+
errBlock.style.display = "block";
|
|
128
|
+
}
|
|
129
|
+
} catch (e) {
|
|
130
|
+
console.error(e);
|
|
131
|
+
}
|
|
65
132
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
</script>
|
|
71
|
-
</body>
|
|
133
|
+
</script>
|
|
134
|
+
</body>
|
|
72
135
|
</html>
|