Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 15 additions & 9 deletions Ticky.Web/Components/Pages/BoardView.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
@page "/boards/{Id:int}/{CardId:int?}"
@using System.Security.Cryptography
@using System.IO
@inject NavigationManager _navigationManager
@inject IDbContextFactory<DataContext> _dbContextFactory
@inject ProtectedLocalStorage _protectedLocalStorage
Expand Down Expand Up @@ -177,23 +178,28 @@
return;

var httpContext = _httpContextAccessor.HttpContext;
var uri = new Uri("http://localhost:8080" + Constants.Hubs.UPDATE_HUB);
Comment thread
dkorecko marked this conversation as resolved.

#if DEBUG
uri = new Uri("https://localhost:7225" + Constants.Hubs.UPDATE_HUB);
#endif
Comment thread
dkorecko marked this conversation as resolved.
Comment thread
dkorecko marked this conversation as resolved.

_hubConnection = new HubConnectionBuilder()
.WithUrl(_navigationManager.ToAbsoluteUri(Constants.Hubs.UPDATE_HUB), options =>
{
if(httpContext?.Request.Cookies is not null)
.WithUrl(uri, options =>
{
foreach (var cookie in httpContext.Request.Cookies)
var cookieName = ".AspNetCore.Identity.Application";
var cookieValue = httpContext?.Request?.Cookies[cookieName];

if (!string.IsNullOrEmpty(cookieValue))
{
options.Cookies.Add(new System.Net.Cookie
{
Name = cookie.Key,
Value = cookie.Value,
Domain = new Uri(_navigationManager.BaseUri).Host
Name = cookieName,
Value = cookieValue,
Domain = uri.Host
});
}
}
})
})
Comment thread
dkorecko marked this conversation as resolved.
Comment thread
dkorecko marked this conversation as resolved.
.WithAutomaticReconnect()
.Build();

Expand Down
6 changes: 5 additions & 1 deletion Ticky.Web/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,11 @@ mailKitOptions is null

builder.Services.AddControllers();

// builder.WebHost.UseUrls("https://0.0.0.0:7225");
#if !DEBUG
Comment thread
dkorecko marked this conversation as resolved.
// NOTE: In production, the application is expected to run behind a reverse proxy (e.g., Nginx, Traefik) that terminates HTTPS.
// Binding to HTTP here is intentional and safe in that context. Do NOT expose this endpoint directly to the internet.
builder.WebHost.UseUrls("http://0.0.0.0:8080");
#endif
Comment thread
dkorecko marked this conversation as resolved.

var app = builder.Build();

Expand Down
Loading