[AI] fix some modules, develop the big part of modules. TODO fix critical errors, update pipeline, test everything
This commit is contained in:
@@ -28,9 +28,14 @@ pub async fn auth_guard(
|
||||
)
|
||||
.map_err(|_| AppError::Unauthorized("Invalid session signature".into()))?;
|
||||
|
||||
// Парсим внутренний UUID из поля sub токена
|
||||
let user_id = uuid::Uuid::parse_str(&token_data.claims.sub)
|
||||
.map_err(|_| AppError::Unauthorized("Invalid token payload structure".into()))?;
|
||||
|
||||
// Ищем оперативника в сети по его системному UUID
|
||||
let user = state
|
||||
.repo
|
||||
.get_user_by_tg_id(token_data.claims.tg_id)
|
||||
.get_user_by_id(user_id)
|
||||
.await?
|
||||
.ok_or_else(|| AppError::NotFound("Operative not found in grid".into()))?;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user