This commit is contained in:
john 2025-05-18 22:22:20 +02:00
parent fbc6f562e3
commit d7e0c59559
31 changed files with 249 additions and 57 deletions

View file

@ -1,3 +1,3 @@
namespace Femto.Modules.Auth.Application.Dto;
public record LoginResult(Session Session, Guid UserId, string Username);
public record LoginResult(Session Session, UserInfo User);

View file

@ -1,3 +1,3 @@
namespace Femto.Modules.Auth.Application.Dto;
public record RegisterResult(Session Session, Guid UserId, string Username);
public record RegisterResult(Session Session, UserInfo User);

View file

@ -0,0 +1,10 @@
namespace Femto.Modules.Auth.Application.Dto;
public record SignupCodeDto(
string Code,
string Email,
string Name,
Guid? RedeemedByUserId,
string? RedeemedByUsername,
DateTimeOffset? ExpiresOn
);

View file

@ -0,0 +1,10 @@
using Femto.Modules.Auth.Contracts;
using Femto.Modules.Auth.Models;
namespace Femto.Modules.Auth.Application.Dto;
public record UserInfo(Guid Id, string Username, ICollection<Role> Roles)
{
internal UserInfo(UserIdentity user)
: this(user.Id, user.Username, user.Roles.Select(r => r.Role).ToList()) { }
};

View file

@ -1,3 +1,3 @@
namespace Femto.Modules.Auth.Application.Dto;
public record ValidateSessionResult(Session Session, Guid UserId, string Username);
public record ValidateSessionResult(Session Session, UserInfo User);