public async Task <IActionResult> SignIn(SignInRequest request) { var userId = $"{Guid.NewGuid()}"; var tenantId = $"{new Guid("f0f54a28-0714-4b1a-9012-b758213bff99")}"; if (_hubService.IsConnected($"{tenantId}-{request.Username}")) { return(new BadRequestObjectResult(new ProblemDetails { Title = "Login Failed", Type = "https://api.areyouconnected.com/errors/useralreadyloggedin", Detail = "User already logged in.", Status = StatusCodes.Status400BadRequest })); } if (_hubService.Count(tenantId) > 1) { return(new BadRequestObjectResult(new ProblemDetails { Title = "Login Failed", Type = "https://api.areyouconnected.com/errors/connectionlimitreached", Detail = "Connections limit reached.", Status = StatusCodes.Status400BadRequest })); } return(await Task.FromResult(new OkObjectResult(new SignInResponse { AccessToken = _securityTokenFactory.Create(tenantId, userId, request.Username), Username = request.Username, UserId = userId, TenantId = tenantId }))); }