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
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch API",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/src/Playground/Playground.Api/bin/Debug/net10.0/FSH.Playground.Api.dll",
"args": [],
"cwd": "${workspaceFolder}/src/Playground/Playground.Api",
"stopAtEntry": false,
"env": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
]
}
11 changes: 11 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"dotnet.dotnetPath": "/home/jarvis/.dotnet/dotnet",
"omnisharp.dotnetPath": "/home/jarvis/.dotnet",
"omnisharp.sdkPath": "/home/jarvis/.dotnet/sdk/10.0.102",
"omnisharp.useModernNet": true,
"editor.formatOnSave": true,
"files.exclude": {
"**/bin": true,
"**/obj": true
}
}
76 changes: 76 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "build",
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/src/FSH.Framework.slnx",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "test",
"command": "dotnet",
"type": "process",
"args": [
"test",
"${workspaceFolder}/src/FSH.Framework.slnx"
],
"problemMatcher": "$msCompile",
"group": "test"
},
{
"label": "run (Aspire)",
"command": "dotnet",
"type": "process",
"args": [
"run",
"--project",
"${workspaceFolder}/src/Playground/FSH.Playground.AppHost"
],
"problemMatcher": "$msCompile",
"group": "none"
},
{
"label": "run (API only)",
"command": "dotnet",
"type": "process",
"args": [
"run",
"--project",
"${workspaceFolder}/src/Playground/Playground.Api"
],
"problemMatcher": "$msCompile",
"group": "none"
},
{
"label": "clean",
"command": "dotnet",
"type": "process",
"args": [
"clean",
"${workspaceFolder}/src/FSH.Framework.slnx"
],
"problemMatcher": "$msCompile"
},
{
"label": "restore",
"command": "dotnet",
"type": "process",
"args": [
"restore",
"${workspaceFolder}/src/FSH.Framework.slnx"
],
"problemMatcher": "$msCompile"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
using FSH.Framework.Eventing.Outbox;
using FSH.Framework.Shared.Multitenancy;
using FSH.Modules.Identity.Contracts.Events;
using Microsoft.Extensions.Logging;

namespace FSH.Modules.Identity.Features.v1.Tokens.TokenGeneration;

Expand All @@ -22,6 +23,7 @@ public sealed class GenerateTokenCommandHandler
private readonly IOutboxStore _outboxStore;
private readonly IMultiTenantContextAccessor<AppTenantInfo> _multiTenantContextAccessor;
private readonly ISessionService _sessionService;
private readonly ILogger<GenerateTokenCommandHandler> _logger;

public GenerateTokenCommandHandler(
IIdentityService identityService,
Expand All @@ -30,7 +32,8 @@ public GenerateTokenCommandHandler(
IRequestContext requestContext,
IOutboxStore outboxStore,
IMultiTenantContextAccessor<AppTenantInfo> multiTenantContextAccessor,
ISessionService sessionService)
ISessionService sessionService,
ILogger<GenerateTokenCommandHandler> logger)
{
_identityService = identityService;
_tokenService = tokenService;
Expand All @@ -39,6 +42,7 @@ public GenerateTokenCommandHandler(
_outboxStore = outboxStore;
_multiTenantContextAccessor = multiTenantContextAccessor;
_sessionService = sessionService;
_logger = logger;
}

public async ValueTask<TokenResponse> Handle(
Expand Down Expand Up @@ -99,10 +103,11 @@ await _sessionService.CreateSessionAsync(
token.RefreshTokenExpiresAt,
cancellationToken);
}
catch (Exception)
catch (Exception ex)
{
// Session creation is non-critical - don't fail the login
// This can happen if migrations haven't been applied yet
_logger.LogWarning(ex, "Failed to create user session for user {UserId}. Login will continue without session tracking.", subject);
}

// 3) Audit token issuance with a fingerprint (never raw token)
Expand Down
Loading