Skip to content

Commit dac7fca

Browse files
committed
Move user's Id from Guid to string to fit AspNetCore Identity
1 parent d40957d commit dac7fca

File tree

6 files changed

+6
-12
lines changed

6 files changed

+6
-12
lines changed

src/Wilcommerce.Auth/Commands/User/Handlers/CreateNewAdministratorCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public async Task Handle(CreateNewAdministratorCommand command)
5858
var role = await RoleFactory.Administrator();
5959
await UserManager.AddToRoleAsync(administrator, role.Name);
6060

61-
var @event = new NewAdministratorCreatedEvent(administrator.Id, administrator.Name, administrator.Email);
61+
var @event = new NewAdministratorCreatedEvent(Guid.Parse(administrator.Id), administrator.Name, administrator.Email);
6262
EventBus.RaiseEvent(@event);
6363
}
6464
catch

src/Wilcommerce.Auth/Commands/User/Handlers/DisableUserCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task Handle(DisableUserCommand command)
5050
throw new ApplicationException("Error while disabling the user");
5151
}
5252

53-
var @event = new UserDisabledEvent(user.Id);
53+
var @event = new UserDisabledEvent(Guid.Parse(user.Id));
5454
EventBus.RaiseEvent(@event);
5555
}
5656
catch

src/Wilcommerce.Auth/Commands/User/Handlers/EnableUserCommandHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public async Task Handle(EnableUserCommand command)
5050
throw new ApplicationException("Error while enabling the user");
5151
}
5252

53-
var @event = new UserEnabledEvent(user.Id);
53+
var @event = new UserEnabledEvent(Guid.Parse(user.Id));
5454
EventBus.RaiseEvent(@event);
5555
}
5656
catch

src/Wilcommerce.Auth/Models/User.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
using Microsoft.AspNetCore.Identity;
22
using System;
33
using Wilcommerce.Core.Common.Models;
4-
using Wilcommerce.Core.Infrastructure;
54

65
namespace Wilcommerce.Auth.Models
76
{
87
/// <summary>
98
/// Represents the user
109
/// </summary>
11-
public class User : IdentityUser, IAggregateRoot
10+
public class User : IdentityUser
1211
{
13-
/// <summary>
14-
/// Get the user's id in Guid format
15-
/// </summary>
16-
public new Guid Id => Guid.Parse(base.Id);
17-
1812
#region Constructor
1913
/// <summary>
2014
/// Construct the user

src/Wilcommerce.Auth/Services/AuthenticationService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public virtual async Task<SignInResult> SignIn(string email, string password, bo
6767
var claimsPrincipal = await AddCustomClaimsForUser(user);
6868
await RefreshAuthenticationWithClaimsPrincipal(claimsPrincipal, isPersistent);
6969

70-
var @event = new UserSignedInEvent(user.Id, user.Email);
70+
var @event = new UserSignedInEvent(Guid.Parse(user.Id), user.Email);
7171
EventBus.RaiseEvent(@event);
7272
}
7373

src/Wilcommerce.Auth/Wilcommerce.Auth.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
1616
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
1717
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
18-
<Version>1.0.0-rc5</Version>
18+
<Version>1.0.0-rc6</Version>
1919
<PackageReleaseNotes></PackageReleaseNotes>
2020
<Description>Wilcommerce Authentication and Authorization library</Description>
2121
</PropertyGroup>

0 commit comments

Comments
 (0)