private static void ThrowIfInvalidOptions(PostponedWords.Models.JwtIssuerOptions options)
        {
            if (options == null)
            {
                throw new ArgumentNullException(nameof(options));
            }

            if (options.ValidFor <= TimeSpan.Zero)
            {
                throw new ArgumentException("Must be a non-zero TimeSpan.", nameof(PostponedWords.Models.JwtIssuerOptions.ValidFor));
            }

            if (options.SigningCredentials == null)
            {
                throw new ArgumentNullException(nameof(PostponedWords.Models.JwtIssuerOptions.SigningCredentials));
            }

            if (options.JtiGenerator == null)
            {
                throw new ArgumentNullException(nameof(PostponedWords.Models.JwtIssuerOptions.JtiGenerator));
            }
        }
 public JwtFactory(IOptions <PostponedWords.Models.JwtIssuerOptions> jwtOptions, IOptions <AppSettings> configuration)
 {
     _jwtOptions   = jwtOptions.Value;
     Сonfiguration = configuration.Value;
 }