From 41d790bfa35bd046efa1c26e4968688d219cb44f Mon Sep 17 00:00:00 2001 From: Web-serfer Date: Thu, 7 May 2026 19:48:36 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=BE=D0=B2=D1=8B=D0=B5=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/layout/header/Header.astro | 114 +++++++++++++++++- 1 file changed, 113 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/layout/header/Header.astro b/frontend/src/components/layout/header/Header.astro index 20578a4..867df70 100644 --- a/frontend/src/components/layout/header/Header.astro +++ b/frontend/src/components/layout/header/Header.astro @@ -63,6 +63,13 @@ import { COMPANY } from "@constants"; + +
+ + Войти + +
+ `; + + // Обновляем мобильный блок авторизации + const mobileAuthBlock = document.getElementById('mobile-auth-block'); + if (mobileAuthBlock) { + mobileAuthBlock.innerHTML = ` + + `; + + document.getElementById('mobile-logout-btn')?.addEventListener('click', async () => { + try { + await fetch('/api/auth/logout', { method: 'POST' }); + } catch (e) {} + localStorage.removeItem('auth_token'); + localStorage.removeItem('user'); + localStorage.removeItem('pocketbase_auth'); + document.querySelector('.header-right')?.classList.remove('auth-active'); + window.location.reload(); + }); + } // Обработчик выхода document.getElementById('logout-btn')?.addEventListener('click', async () => {