public IActionResult SignInConfirm([FromBody] SignInConfirmRequest request) { var user = UserService.Get(request.UserID); if (user == null) { return(NotFound(new ResponseModel { Success = false, Message = "Пользователь не найден" })); } var session = UserSessionService.GetUserActiveSession(user); if (session == null) { return(NotFound(new ResponseModel { Success = false, Message = "Сессия не найдена" })); } if (request.Code != session.AuthCode) { return(BadRequest(new ResponseModel { Success = false, Message = "Неверный код подтверждения" })); } var token = UserSessionService.AuthorizeUser(user); return(Ok(new SignInConfirmResponse { Token = token, Role = user.Role })); }