add username and userid cookies

This commit is contained in:
john 2025-05-20 09:20:50 +02:00
parent 0d34774059
commit a6fef1929c
3 changed files with 29 additions and 9 deletions

View file

@ -28,7 +28,7 @@ public class AuthController(
{
var result = await authModule.Command(new LoginCommand(request.Username, request.Password));
HttpContext.SetSession(result.Session, cookieSettings.Value);
HttpContext.SetSession(result.Session, result.User, cookieSettings.Value);
return new LoginResponse(
result.User.Id,
@ -44,7 +44,7 @@ public class AuthController(
new RegisterCommand(request.Username, request.Password, request.SignupCode)
);
HttpContext.SetSession(result.Session, cookieSettings.Value);
HttpContext.SetSession(result.Session, result.User, cookieSettings.Value);
return new RegisterResponse(
result.User.Id,