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/public/login.html CHANGED
@@ -1,72 +1,135 @@
1
- <!DOCTYPE html>
1
+ <!doctype html>
2
2
  <html lang="ru">
3
- <head>
4
- <meta charset="UTF-8">
5
- <title>City-bank | Вход в систему</title>
6
- <style>
7
- body { font-family: sans-serif; background: #f4f6f9; display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; }
8
- .card { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); width: 100%; max-width: 380px; }
9
- h2 { text-align: center; color: #007bff; margin-top: 0; }
10
- .group { margin: 15px 0; }
11
- label { display: block; margin-bottom: 5px; font-weight: bold; font-size: 14px; }
12
- input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; box-sizing: border-box; font-size: 16px; }
13
- .btn { width: 100%; padding: 12px; background: #007bff; color: white; border: none; border-radius: 4px; font-size: 16px; font-weight: bold; cursor: pointer; }
14
- .error { color: #dc3545; font-size: 14px; margin-top: 10px; display: none; text-align: center; }
15
- </style>
16
- </head>
17
- <body>
18
- <div class="card">
19
- <h2>ВХОД В CITY-BANK</h2>
20
- <div class="group">
21
- <label for="login-name">Никнейм (Логин)</label>
22
- <input type="text" id="login-name" placeholder="Введите ваш ник">
23
- </div>
24
- <div class="group">
25
- <label for="login-pass">Пароль</label>
26
- <input type="password" id="login-pass" placeholder="Введите пароль">
27
- </div>
28
-
29
- <!-- Скрытый блок 2FA, активируемый бэкендом -->
30
- <div class="group" id="totp-block" style="display: none;">
31
- <label for="login-totp" style="color: #28a745;">Введите временный токен 2FA</label>
32
- <input type="text" id="login-totp" placeholder="000000" style="text-align: center; font-size: 20px; letter-spacing: 2px;">
33
- </div>
34
-
35
- <div id="login-error" class="error"></div>
36
- <button class="btn" onclick="submitLogin()">Войти в кабинет</button>
37
- <p style="text-align: center; font-size: 14px; margin-top: 15px;"><a href="/bank/register.html">Создать аккаунт</a></p>
38
- </div>
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
- <script>
41
- async function submitLogin() {
42
- const name = document.getElementById('login-name').value.trim();
43
- const pass = document.getElementById('login-pass').value;
44
- const totp = document.getElementById('login-totp').value.trim();
45
- const errBlock = document.getElementById('login-error');
46
- errBlock.style.display = 'none';
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
- try {
49
- const response = await fetch('/api/bank/users/login', {
50
- method: 'POST',
51
- headers: {'Content-Type': 'application/json'},
52
- body: JSON.stringify({ name, password: pass, totpCode: totp || null })
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
- if (response.ok && result.status === true) {
57
- window.location.href = '/bank/general.html';
58
- } else if (result.require2FA) {
59
- document.getElementById('totp-block').style.display = 'block';
60
- errBlock.innerText = result.message;
61
- errBlock.style.display = 'block';
62
- } else {
63
- errBlock.innerText = result.message || "Ошибка авторизации";
64
- errBlock.style.display = 'block';
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
- } catch(e) {
67
- console.error(e);
68
- }
69
- }
70
- </script>
71
- </body>
133
+ </script>
134
+ </body>
72
135
  </html>