feat: add WiFi authorization module

- Backend: hotel_wifi_settings table (migration 046), CRUD routes
- Public API endpoint /api/wifi-auth/verify for captive portal
- Auth methods: room+lastname, room+birthdate, room+any, room_only
- Frontend: WiFiPage with settings, token management, setup guide
- Guide tabs: MikroTik, UniFi, Universal with copy-paste instructions
- Sidebar: WiFi item in Settings group

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-29 12:08:51 +03:00
parent 46524077a0
commit 0088457f51
7 changed files with 886 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
-- WiFi Auth module settings per hotel
CREATE TABLE IF NOT EXISTS hotel_wifi_settings (
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
hotel_id UUID NOT NULL REFERENCES hotels(id) ON DELETE CASCADE,
enabled BOOLEAN NOT NULL DEFAULT false,
api_token TEXT NOT NULL DEFAULT encode(gen_random_bytes(32), 'hex'),
auth_method TEXT NOT NULL DEFAULT 'room_any',
-- room_lastname | room_birthdate | room_any | room_only
ssid_name TEXT,
welcome_text TEXT DEFAULT 'Добро пожаловать! Введите данные для подключения к Wi-Fi.',
session_hours INT NOT NULL DEFAULT 24,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
UNIQUE (hotel_id)
);