Skip to content

Commit

Permalink
Don't manually set CreatedAt.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTedder committed Sep 6, 2024
1 parent b48b74f commit ac932aa
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public async Task<CreateConfirmationResult> CreateConfirmationAndSendEmail(User
AccountConfirmation newConfirmation =
new()
{
CreatedAt = now,
ExpiresAt = now + Duration.FromHours(1),
UserId = user.Id,
};
Expand Down
1 change: 0 additions & 1 deletion LeaderboardBackend/Services/Impl/AccountRecoveryService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ public async Task<CreateRecoveryResult> CreateRecoveryAndSendEmail(User user)

AccountRecovery recovery = new()
{
CreatedAt = now,
ExpiresAt = now + Duration.FromHours(1),
User = user
};
Expand Down
3 changes: 1 addition & 2 deletions LeaderboardBackend/Services/Impl/UserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace LeaderboardBackend.Services;

public class UserService(ApplicationContext applicationContext, IAuthService authService, IClock clock) : IUserService
public class UserService(ApplicationContext applicationContext, IAuthService authService) : IUserService
{
// TODO: Convert return sig to Task<GetUserResult>
public async Task<User?> GetUserById(Guid id)
Expand Down Expand Up @@ -86,7 +86,6 @@ public async Task<CreateUserResult> CreateUser(RegisterRequest request)
Email = request.Email,
Password = BCryptNet.EnhancedHashPassword(request.Password),
Role = UserRole.Registered,
CreatedAt = clock.GetCurrentInstant()
};

applicationContext.Users.Add(newUser);
Expand Down

0 comments on commit ac932aa

Please sign in to comment.