From be3b0e91f421862f8e6946e87260f266ab9714d5 Mon Sep 17 00:00:00 2001 From: lendry Date: Wed, 22 Apr 2026 15:31:05 +0000 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=B8=D1=82?= =?UTF-8?q?=D1=8C=20index.html?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 947d75b..236a4a6 100644 --- a/index.html +++ b/index.html @@ -32,16 +32,18 @@ const errorEl = document.getElementById('error'); errorEl.style.display = 'none'; - const username = document.getElementById('username').value; - const password = document.getElementById('password').value; + let username = document.getElementById('username').value; + let password = document.getElementById('password').value; + console.log(username + password) + let json = JSON.stringify({ username, password, deviceId: 'stub-device', publicKey: 'N6fByS7oTIOX6m7on8h6T093SOn3df67o6v6n6n6n6o=' }), try { // 1. Делаем реальный запрос к вашему API Gateway const response = await fetch('https://api.dev.lendry.ru/auth/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, // Добавил device_id и public_key (как требует ваш auth.proto) - body: JSON.stringify({ username, password, deviceId: 'stub-device', publicKey: 'N6fByS7oTIOX6m7on8h6T093SOn3df67o6v6n6n6n6o=' }), + body: json, // КРИТИЧЕСКИ ВАЖНО: заставляет браузер сохранить куку refreshToken credentials: 'include' });