Example #1
0
        public Guid Login(UserIdentifier userIdentifier, string username, string password)
        {
            VerifySystemIsInitialized();
            _verifier.VerifyMe(MethodBase.GetCurrentMethod(), userIdentifier, username, password);
            var result = _userDomain.Login(username, password);

            if (!result.Equals(Guid.Empty))
            {
                var newEvent = new UserLoggedInEvent(result);
                //newEvent.SetTargets(DomainData.ShopsCollection.Values, DomainData.RegisteredUsersCollection.Values);
                //newEvent.SetMessage(DomainData.ShopsCollection.Values, DomainData.RegisteredUsersCollection.Values);
                newEvent.SetMessages(_unitOfWork);
                UpdateCenter.RaiseEvent(newEvent);
                _logger.LogInformation($"{username} logged in successfuly.");
            }
            return(result);
        }