many fixes and improvements - rework for modules/ and common/
feat(emailer): add Postmark and Resend providers
This commit is contained in:
21
backend/Modules/Identity/Services/UserLookup.cs
Normal file
21
backend/Modules/Identity/Services/UserLookup.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Hutopy.Modules.Identity.Contracts;
|
||||
using Hutopy.Modules.Identity.Data;
|
||||
|
||||
namespace Hutopy.Modules.Identity.Services;
|
||||
|
||||
public sealed class UserLookup(
|
||||
UserManager userManager)
|
||||
: IUserLookup
|
||||
{
|
||||
public async Task<UserReference?> GetUserAsync(Guid userId, CancellationToken cancellationToken = default)
|
||||
{
|
||||
var user = await userManager.FindByIdAsync(userId.ToString());
|
||||
|
||||
return user is null
|
||||
? null
|
||||
: new UserReference(
|
||||
user.Id,
|
||||
user.Fullname,
|
||||
user.PortraitUrl);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user