public async Task Login(Login loginCommand, IHashingService hashingService, ITokenFactory tokenFactory, AuthTokenStore tokenStore) { if (!hashingService.DoPasswordsMatch(loginCommand.Password, Password)) { throw new LoginFailed("UserManagement", "Email or password do not match. Login failed"); } var token = await tokenFactory.Create(Id); tokenStore.AddToken(token); loginCommand.GeneratedToken = token.Value; }