feat: добавить новый backend и cabinet

- добавлен новый Nest backend для auth, projects и project access tokens
- добавлена control-plane схема БД и миграция Drizzle
- перенесён старый backend в old-backend
- добавлен React/Vite cabinet с auth-only входом и Mantine layout
- обновлены workspace scripts и lockfile
This commit is contained in:
2026-05-12 09:22:04 +03:00
parent d49449c30c
commit 98295d0569
113 changed files with 3426 additions and 169 deletions

View File

@@ -0,0 +1,20 @@
import { getAdminToken, useGetAdminSession } from 'infra/backend-api'
import type { AdminSession } from '../types/auth-api.type'
/**
* Состояние текущей admin-сессии.
*/
export const useAdminSession = (): AdminSession => {
const hasToken = Boolean(getAdminToken())
const sessionQuery = useGetAdminSession({
shouldRetryOnError: false,
})
return {
error: sessionQuery.error,
isAuthenticated: Boolean(sessionQuery.data),
isLoading: hasToken && sessionQuery.isLoading,
session: sessionQuery.data ?? null,
}
}