Ejemplo n.º 1
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="coreBaseResourceErrors">Ядро. Основа. Ресурсы. Ошибки.</param>
        /// <param name="resourceSuccesses">Ресурсы. Успехи.</param>
        /// <param name="resourceErrors">Ресурсы. Ошибки.</param>
        /// <param name="service">Сервис.</param>
        public ModAuthBaseJobs(
            CoreBaseResourceErrors coreBaseResourceErrors,
            ModAuthBaseResourceSuccesses resourceSuccesses,
            ModAuthBaseResourceErrors resourceErrors,
            ModAuthBaseService service
            )
        {
            JobLoginJwt = new ModAuthBaseJobLoginJwtService(
                service.JwtLogin,
                coreBaseResourceErrors,
                resourceSuccesses,
                resourceErrors
                );

            JobRefreshJwt = new ModAuthBaseJobRefreshJwtService(
                service.JwtRefresh,
                coreBaseResourceErrors,
                resourceSuccesses,
                resourceErrors
                );

            JobRegister = new ModAuthBaseJobRegisterService(
                service.Register,
                coreBaseResourceErrors,
                resourceSuccesses,
                resourceErrors
                );
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Конструктор.
        /// </summary>
        /// <param name="config">Конфигурация.</param>
        /// <param name="externals">Внешнее.</param>
        public ModAuthBaseContext(ModAuthBaseConfig config, ModAuthBaseExternals externals)
        {
            Config = config;

            Resources = new ModAuthBaseResources(
                externals.ResourceErrorsLocalizer,
                externals.ResourceSuccessesLocalizer
                );

            var jwtService = new CoreBaseAuthTypeJwtService(Config.Settings.Types.Jwt);

            Service = new ModAuthBaseService(jwtService);

            Jobs = new ModAuthBaseJobs(
                externals.CoreBaseResourceErrors,
                Resources.Successes,
                Resources.Errors,
                Service
                );
        }