コード例 #1
0
        public async Task CreateAsync(int userId)
        {
            var user = await _userRepository.GetAsync(userId);

            if (user == null)
            {
                throw new ServiceException(ErrorCodes.UserNotFound,
                                           $"User: '******' was not found.");
            }
            await _refreshTokenRepository.CreateTokenAsync(new RefreshToken(user, _passwordHasher));

            await _unitOfWork.SaveChangesAsync();
        }
コード例 #2
0
 public async Task <string> CreateTokenAsync(string userId)
 {
     return(await _refreshTokenRepository.CreateTokenAsync(userId));
 }