コード例 #1
0
        public virtual async Task <AccessTokenDto> InitializeAccessToken(InitializeAccessTokenInputDto input)
        {
            CurrentUnitOfWork.DisableFilter(AbpDataFilters.SoftDelete);
            // AccessToken token = _accessTokenRepository
            AccessToken token = await this.Repository.GetAsync(input.AccessTokenId);

            try
            {
                _accessTokenManager.InitializeToken(token, input.Code);

                var output = MapToEntityDto(token);
                return(output);
            }
            catch (OceanException oceanError)
            {
                throw new UserFriendlyException(
                          oceanError.getError_code(),
                          oceanError.getError_message(),
                          oceanError
                          );
            }
            catch (Exception exc)
            {
                throw new UserFriendlyException(
                          exc.Message,
                          exc.ToString(),
                          exc
                          );
            }
        }
コード例 #2
0
        public void InitializeAccessToken_Test()
        {
            // Act
            var list = _accessTokenRepository.GetAllList();

            if (list.Count > 0)
            {
                var token = _accessTokenRepository.Get(list[0].Id);
                _accessTokenManager.InitializeToken(token, "079617f6-df6d-4253-b5d1-15ce170dbf10");
            }

            // Assert
            Assert.True(true);
        }