feat: add authentication system (JWT + RBAC) #3

Merged
ksv741 merged 1 commits from feature/auth-system into main 2026-06-13 22:26:34 +03:00
Owner

Backend

  • Регистрация, логин, логаут, refresh токенов, профиль (GET/PATCH /me)
  • JwtAuthGuard — глобальный guard с opt-out через @Public()
  • RolesGuard — глобальный guard с @Roles() для RBAC
  • Prisma 7 + SQLite через @prisma/adapter-libsql
  • Refresh token rotation (SHA-256 hash в БД, httpOnly cookie)
  • 21 unit tests, lint clean

Frontend

  • AuthContext — восстановление сессии через refresh cookie при монтировании
  • LoginPage, RegisterPage, ProfilePage, ProtectedRoute
  • Автоматический refresh токена при 401
  • Все тексты на русском языке

Документация

  • ADR-008-auth-system.md, backend/auth.md, backend/database.md
  • Обновлены architecture.md, api.md, overview.md, sidebars.ts, AGENTS.md

Изменения в конфигурации

  • Новые переменные: JWT_SECRET, JWT_REFRESH_SECRET, JWT_ACCESS_EXPIRES, JWT_REFRESH_EXPIRES
  • Примеры значений в .env
### Backend - Регистрация, логин, логаут, refresh токенов, профиль (GET/PATCH /me) - JwtAuthGuard — глобальный guard с opt-out через @Public() - RolesGuard — глобальный guard с @Roles() для RBAC - Prisma 7 + SQLite через @prisma/adapter-libsql - Refresh token rotation (SHA-256 hash в БД, httpOnly cookie) - 21 unit tests, lint clean ### Frontend - AuthContext — восстановление сессии через refresh cookie при монтировании - LoginPage, RegisterPage, ProfilePage, ProtectedRoute - Автоматический refresh токена при 401 - Все тексты на русском языке ### Документация - ADR-008-auth-system.md, backend/auth.md, backend/database.md - Обновлены architecture.md, api.md, overview.md, sidebars.ts, AGENTS.md ### Изменения в конфигурации - Новые переменные: JWT_SECRET, JWT_REFRESH_SECRET, JWT_ACCESS_EXPIRES, JWT_REFRESH_EXPIRES - Примеры значений в .env
ksv741 added 1 commit 2026-06-13 22:26:21 +03:00
feat: add authentication system with JWT + RBAC
Some checks failed
CI / lint (pull_request) Failing after 1m45s
CI / test (pull_request) Failing after 1m42s
CI / build (pull_request) Failing after 1m31s
CI / lint (push) Failing after 1m46s
CI / test (push) Failing after 1m34s
CI / build (push) Failing after 1m35s
c2478277e6
Backend:
- AuthModule with register, login, logout, refresh, profile endpoints
- JwtAuthGuard (global, opt-out via @Public) + RolesGuard (@Roles)
- PrismaModule with SQLite via @prisma/adapter-libsql (Prisma 7)
- Auth configuration in configuration.ts

Frontend:
- Auth context with session restoration via refresh cookie
- Login, Register, Profile pages with ProtectedRoute
- Auto-refresh on 401 with token rotation
- API client refactored for auth headers

Russian text: auth flows translated to Russian
All text translated: auth pages, profile, layout, loading states
ksv741 merged commit c2478277e6 into main 2026-06-13 22:26:34 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: moex/moex-vibe#3
No description provided.