mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
feat(captcha): make ALTCHA the only captcha (#3035)
This commit is contained in:
1 parent
d433a039b5
commit
4f968bbc47
209 files changed
+4097
-8692
No files matched your search
@@ -12,7 +12,6 @@ import {Logger} from '@app/features/platform/utils/AppLogger';
|
||||
import {MS_PER_HOUR, MS_PER_MINUTE} from '@fluxer/date_utils/src/DateConstants';
|
||||
import type {
|
||||
InstanceAppPublic,
|
||||
InstanceCaptcha,
|
||||
InstanceCommunity,
|
||||
InstanceDiscoveryResponse,
|
||||
InstanceEndpoints,
|
||||
@@ -34,7 +33,6 @@ export interface InstanceConfig {
|
||||
fetchedAt: number;
|
||||
apiCodeVersion: number;
|
||||
endpoints: InstanceEndpoints;
|
||||
captcha: InstanceCaptcha;
|
||||
features: InstanceFeatures;
|
||||
registration: InstanceRegistration;
|
||||
community: InstanceCommunity;
|
||||
@@ -145,7 +143,6 @@ class InstanceConfigs {
|
||||
fetchedAt: Date.now(),
|
||||
apiCodeVersion: data.api_code_version,
|
||||
endpoints: data.endpoints,
|
||||
captcha: data.captcha,
|
||||
features: data.features,
|
||||
gif: {
|
||||
provider: gifProviderInfo.name,
|
||||
@@ -208,11 +205,6 @@ class InstanceConfigs {
|
||||
gift: RuntimeConfig.giftEndpoint,
|
||||
webapp: RuntimeConfig.webAppEndpoint,
|
||||
},
|
||||
captcha: {
|
||||
provider: RuntimeConfig.captchaProvider,
|
||||
hcaptcha_site_key: RuntimeConfig.hcaptchaSiteKey,
|
||||
turnstile_site_key: RuntimeConfig.turnstileSiteKey,
|
||||
},
|
||||
features: RuntimeConfig.features,
|
||||
gif: {
|
||||
provider: RuntimeConfig.gifProvider,
|
||||
|
||||
@@ -12,7 +12,6 @@ import {http} from '@app/features/platform/transport/RestTransport';
|
||||
import {API_CODE_VERSION} from '@fluxer/constants/src/AppConstants';
|
||||
import type {
|
||||
InstanceAppPublic,
|
||||
InstanceCaptcha,
|
||||
InstanceCommunity,
|
||||
InstanceDiscoveryResponse,
|
||||
InstanceFeatures,
|
||||
@@ -28,7 +27,6 @@ import {makeAutoObservable, reaction, runInAction} from 'mobx';
|
||||
export type {
|
||||
GifProvider,
|
||||
GifProviderInfo,
|
||||
InstanceCaptcha,
|
||||
InstanceCommunity,
|
||||
InstanceDiscoveryResponse,
|
||||
InstanceFeatures,
|
||||
@@ -51,9 +49,6 @@ export interface RuntimeConfigSnapshot {
|
||||
gifProvider: GifProvider;
|
||||
gifProviderDisplayName: string;
|
||||
gifAttributionRequired: boolean;
|
||||
captchaProvider: 'hcaptcha' | 'turnstile' | 'none';
|
||||
hcaptchaSiteKey: string | null;
|
||||
turnstileSiteKey: string | null;
|
||||
apiCodeVersion: number;
|
||||
features: InstanceFeatures;
|
||||
sso: InstanceSsoConfig | null;
|
||||
@@ -295,9 +290,6 @@ class RuntimeConfig {
|
||||
gifProvider: GifProvider = DEFAULT_GIF_PROVIDER_INFO.name;
|
||||
gifProviderDisplayName: string = DEFAULT_GIF_PROVIDER_INFO.displayName;
|
||||
gifAttributionRequired: boolean = DEFAULT_GIF_PROVIDER_INFO.attributionRequired;
|
||||
captchaProvider: 'hcaptcha' | 'turnstile' | 'none' = 'none';
|
||||
hcaptchaSiteKey: string | null = null;
|
||||
turnstileSiteKey: string | null = null;
|
||||
apiCodeVersion: number = API_CODE_VERSION;
|
||||
features: InstanceFeatures = {...DEFAULT_INSTANCE_FEATURES};
|
||||
sso: InstanceSsoConfig | null = null;
|
||||
@@ -342,9 +334,6 @@ class RuntimeConfig {
|
||||
gifProvider: this.gifProvider,
|
||||
gifProviderDisplayName: this.gifProviderDisplayName,
|
||||
gifAttributionRequired: this.gifAttributionRequired,
|
||||
captchaProvider: this.captchaProvider,
|
||||
hcaptchaSiteKey: this.hcaptchaSiteKey,
|
||||
turnstileSiteKey: this.turnstileSiteKey,
|
||||
apiCodeVersion: this.apiCodeVersion,
|
||||
features: {...this.features},
|
||||
sso: this.sso ? {...this.sso} : null,
|
||||
@@ -448,9 +437,6 @@ class RuntimeConfig {
|
||||
this.gifProvider = gifProviderInfo.name;
|
||||
this.gifProviderDisplayName = gifProviderInfo.displayName;
|
||||
this.gifAttributionRequired = gifProviderInfo.attributionRequired;
|
||||
this.captchaProvider = instance.captcha.provider;
|
||||
this.hcaptchaSiteKey = instance.captcha.hcaptcha_site_key;
|
||||
this.turnstileSiteKey = instance.captcha.turnstile_site_key;
|
||||
this.apiCodeVersion = instance.api_code_version;
|
||||
this.features = {
|
||||
...DEFAULT_INSTANCE_FEATURES,
|
||||
|
||||
Reference in new issue
Block a user