fix
This commit is contained in:
parent
e288aa9fa8
commit
f27aa04d02
1 changed files with 4 additions and 10 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
const API_URL = "https://spectralvpn.ru:{port}";
|
const port = 8000;
|
||||||
|
const API_URL = "https://spectralvpn.ru:${port}";
|
||||||
|
|
||||||
async function sha256(text) {
|
async function sha256(text) {
|
||||||
const encoder = new TextEncoder();
|
const encoder = new TextEncoder();
|
||||||
|
|
@ -90,14 +91,8 @@ async function registration(e) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
alert("Аккаунт успешно создан! Перенаправляем в личный кабинет...");
|
setCookie("email", email, 365);
|
||||||
localStorage.setItem("user", JSON.stringify({
|
setCookie("hash_passwd", hashedPassword, 365);
|
||||||
id: data.id,
|
|
||||||
email: data.email,
|
|
||||||
loggedIn: true,
|
|
||||||
loginTime: Date.now()
|
|
||||||
}));
|
|
||||||
|
|
||||||
window.location.href = "control-panel.html";
|
window.location.href = "control-panel.html";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -122,7 +117,6 @@ document.addEventListener("DOMContentLoaded", () => {
|
||||||
form.addEventListener("submit", registration);
|
form.addEventListener("submit", registration);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Подсветка полей при фокусе
|
|
||||||
document.querySelectorAll('.input').forEach(input => {
|
document.querySelectorAll('.input').forEach(input => {
|
||||||
input.addEventListener('focus', () => {
|
input.addEventListener('focus', () => {
|
||||||
input.classList.remove('invalid');
|
input.classList.remove('invalid');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue