From f27aa04d02b9969ccafdcfc45df4f6c2ea19a734 Mon Sep 17 00:00:00 2001 From: Lev Date: Fri, 28 Nov 2025 15:12:08 +0300 Subject: [PATCH] fix --- Frontend/JS/register.js | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/Frontend/JS/register.js b/Frontend/JS/register.js index a2757f9..ebd0c07 100644 --- a/Frontend/JS/register.js +++ b/Frontend/JS/register.js @@ -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) { const encoder = new TextEncoder(); @@ -90,14 +91,8 @@ async function registration(e) { const data = await response.json(); if (response.ok) { - alert("Аккаунт успешно создан! Перенаправляем в личный кабинет..."); - localStorage.setItem("user", JSON.stringify({ - id: data.id, - email: data.email, - loggedIn: true, - loginTime: Date.now() - })); - + setCookie("email", email, 365); + setCookie("hash_passwd", hashedPassword, 365); window.location.href = "control-panel.html"; } else { @@ -122,7 +117,6 @@ document.addEventListener("DOMContentLoaded", () => { form.addEventListener("submit", registration); } - // Подсветка полей при фокусе document.querySelectorAll('.input').forEach(input => { input.addEventListener('focus', () => { input.classList.remove('invalid');