Challenge:
1. Телефон + OTP 2. Email + OTP 3. Профиль + пароль

POST /api/auth/otp/send

intent=register — первый шаг: телефон

POST /api/auth/otp/verify

Подтвердить код с телефона → nextStep: enter_email

POST /api/auth/otp/send

intent=register + challengeId + email (фаза await_email)

POST /api/auth/otp/verify

Подтвердить email → nextStep: complete_profile

POST /api/auth/register/complete

challengeId + имя + пароль (Argon2id, 8–128 символов)

OTP в dev смотрите в консоли NestJS: [TEST OTP] … code=…

Вход по OTP

intent=login — единый challenge API

POST /api/auth/otp/send

POST /api/auth/otp/verify

POST /api/auth/login

Вход по паролю (без OTP)

POST /api/auth/otp/send

intent=password_reset

POST /api/auth/otp/verify

Код + newPassword в одном запросе

intent=bind_email — требуется JWT (войдите сначала)

POST /api/auth/otp/send

POST /api/auth/otp/verify

GET /api/users/me

Данные профиля

Войдите и нажмите «Загрузить»

GET /api/users/:id

GET /api/auth/sessions

DELETE /api/auth/sessions/:id

POST /api/auth/logout

POST /api/auth/logout-all

POST /api/auth/refresh

Состояние JWT

Access Token
Payload

Произвольный запрос