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(); }
public async Task <string> CreateTokenAsync(string userId) { return(await _refreshTokenRepository.CreateTokenAsync(userId)); }