Ejemplo n.º 1
0
 public void DoAuthByEmailLinkRequested(object sender, AuthByEmailLinkEventArgs eventArgs)
 {
     if (AuthenticationByEmailLinkRequested != null)
     {
         AuthenticationByEmailLinkRequested.Invoke(sender, eventArgs);
     }
 }
Ejemplo n.º 2
0
        private void MainEventBusOnAuthenticationByEmailLinkRequested(object sender,
                                                                      AuthByEmailLinkEventArgs authByEmailLinkEventArgs)
        {
            var userCommunicationChannels =
                _applicationDataProvider.UserCommunicationChannels.GetByEmail(authByEmailLinkEventArgs.Email);

            if (userCommunicationChannels != null)
            {
                var token = _applicationDataProvider.UserAuthenticationTokens.Create();
                token.Token = Guid.NewGuid().ToString();
                token.User  = userCommunicationChannels.User;
                _applicationDataProvider.UserAuthenticationTokens.Push(token);
            }
            else
            {
                _mainEventBus.DoInviteUserByEmailRequested(this, authByEmailLinkEventArgs.Email);
            }
        }