Skip to content

Commit

Permalink
Try again to fix this
Browse files Browse the repository at this point in the history
  • Loading branch information
CorruptComputer committed Aug 24, 2024
1 parent 5178e72 commit 3cb92ee
Show file tree
Hide file tree
Showing 4 changed files with 100 additions and 13 deletions.
1 change: 0 additions & 1 deletion Backend/Bones.Api/Bones.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.8" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="8.0.8">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
12 changes: 3 additions & 9 deletions Backend/Bones.Api/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public static class Program
public static void Main(string[] args)
{
WebApplicationBuilder builder = WebApplication.CreateBuilder(args);
builder.Configuration.AddEnvironmentVariables();

builder.Host.UseServiceProviderFactory(new AutofacServiceProviderFactory());
builder.Host.ConfigureContainer<ContainerBuilder>(containerBuilder =>
Expand Down Expand Up @@ -129,15 +130,8 @@ public static void Main(string[] args)

app.UseStaticFiles();
app.UseAuthentication();
app.UseRouting().UseAuthorization().UseEndpoints(configure =>
{
//configure.MapGroup("AccountManagement").WithTags("AccountManagement").MapIdentityApi<BonesUser>().WithOpenApi(
// apiOperation =>
// {
// return apiOperation;
// });
configure.MapControllers().WithOpenApi();
});
app.UseAuthorization();
app.MapControllers();

app.Run();
}
Expand Down
3 changes: 0 additions & 3 deletions Bones.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
LICENSE = LICENSE
.gitignore = .gitignore
.github\dependabot.yml = .github\dependabot.yml
.github\workflows\dotnetcore.yml = .github\workflows\dotnetcore.yml
.github\workflows\sonarcloud.yml = .github\workflows\sonarcloud.yml
EndProjectSection
EndProject

Expand Down
97 changes: 97 additions & 0 deletions Frontend/Bones.Api.Client/AutoGenBonesApiClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,94 @@ private static System.Text.Json.JsonSerializerOptions CreateSerializerSettings()
}
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>OK</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
public virtual async System.Threading.Tasks.Task<ApiResult<ActionResult>> AccountManagementResendConfirmationEmailAsync(ResendConfirmationEmailApiRequest body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{
if (body == null)
throw new System.ArgumentNullException("body");

var client_ = _httpClient;
var disposeClient_ = false;
try
{
using (var request_ = new System.Net.Http.HttpRequestMessage())
{
var json_ = System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(body, typeof(ResendConfirmationEmailApiRequest), JsonSerializerSettings);
var content_ = new System.Net.Http.ByteArrayContent(json_);
content_.Headers.ContentType = System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json");
request_.Content = content_;
request_.Method = new System.Net.Http.HttpMethod("POST");
request_.Headers.Accept.Add(System.Net.Http.Headers.MediaTypeWithQualityHeaderValue.Parse("application/json"));

var urlBuilder_ = new System.Text.StringBuilder();

// Operation Path: "AccountManagement/resend-confirmation-email"
urlBuilder_.Append("AccountManagement/resend-confirmation-email");

PrepareRequest(client_, request_, urlBuilder_);

var url_ = urlBuilder_.ToString();
request_.RequestUri = new System.Uri(url_, System.UriKind.RelativeOrAbsolute);

PrepareRequest(client_, request_, url_);

var response_ = await client_.SendAsync(request_, System.Net.Http.HttpCompletionOption.ResponseHeadersRead, cancellationToken).ConfigureAwait(false);
var disposeResponse_ = true;
try
{
var headers_ = new System.Collections.Generic.Dictionary<string, System.Collections.Generic.IEnumerable<string>>();
foreach (var item_ in response_.Headers)
headers_[item_.Key] = item_.Value;
if (response_.Content != null && response_.Content.Headers != null)
{
foreach (var item_ in response_.Content.Headers)
headers_[item_.Key] = item_.Value;
}

ProcessResponse(client_, response_);

var status_ = (int)response_.StatusCode;
if (status_ == 200)
{
var objectResponse_ = await ReadObjectResponseAsync<ActionResult>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
return new ApiResult<ActionResult>(status_, headers_, objectResponse_.Object);
}
else
if (status_ == 401)
{
var objectResponse_ = await ReadObjectResponseAsync<ActionResult>(response_, headers_, cancellationToken).ConfigureAwait(false);
if (objectResponse_.Object == null)
{
throw new ApiException("Response was null which was not expected.", status_, objectResponse_.Text, headers_, null);
}
throw new ApiException<ActionResult>("Unauthorized", status_, objectResponse_.Text, headers_, objectResponse_.Object, null);
}
else
{
var responseData_ = response_.Content == null ? null : await response_.Content.ReadAsStringAsync().ConfigureAwait(false);
throw new ApiException("The HTTP status code of the response was not expected (" + status_ + ").", status_, responseData_, headers_, null);
}
}
finally
{
if (disposeResponse_)
response_.Dispose();
}
}
}
finally
{
if (disposeClient_)
client_.Dispose();
}
}

/// <param name="cancellationToken">A cancellation token that can be used by other objects or threads to receive notice of cancellation.</param>
/// <returns>OK</returns>
/// <exception cref="ApiException">A server side error occurred.</exception>
Expand Down Expand Up @@ -624,6 +712,15 @@ public partial record RegisterUserApiRequest

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial record ResendConfirmationEmailApiRequest
{

[System.Text.Json.Serialization.JsonPropertyName("email")]
public string Email { get; set; }

}

[System.CodeDom.Compiler.GeneratedCode("NJsonSchema", "14.1.0.0 (NJsonSchema v11.0.2.0 (Newtonsoft.Json v13.0.0.0))")]
public partial record StringStringArrayDictionaryActionResult
{
Expand Down

0 comments on commit 3cb92ee

Please sign in to comment.