コード例 #1
0
ファイル: GeneralService.cs プロジェクト: wuqiyou/betterslice
        public UserIdentity Authenticate(string email, string encryptedPassword)
        {
            UserIdentity authenticatedUser = null;

            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CMSDataStoreKey))
            {
                AuthenticateFacade facade = new AuthenticateFacade(uow);
                authenticatedUser = facade.Authenticate(email, encryptedPassword);
            }

            return(authenticatedUser);
        }
コード例 #2
0
        private void ProcAuthentication(string email, string encryptedPassword)
        {
            UserIdentity authenticatedUser = null;

            using (IUnitOfWork uow = UnitOfWorkFactory.Instance.Start(DataStoreResolver.CRMDataStoreKey))
            {
                AuthenticateFacade facade = new AuthenticateFacade(uow);
                authenticatedUser = facade.Authenticate(email, encryptedPassword);
            }

            if (authenticatedUser != null)
            {
                AfterLogin(authenticatedUser);
            }
            else
            {
                FailedLogin(email);
            }
        }