Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

refactor(api): emit moderation events and apply account actions (#3031)

Hampus364084c8193e
diff --git a/.devcontainer/docker-compose.yml b/.devcontainer/docker-compose.yml
index 7d0295353..faacb9163 100644
--- a/.devcontainer/docker-compose.yml
+++ b/.devcontainer/docker-compose.yml
@@ -202,11 +202,6 @@ services:
target: /workspaces/fluxer/fluxer_api/pkgs/rate_limit/node_modules
volume:
nocopy: true
- - type: volume
- source: fluxer-api-sms-node-modules
- target: /workspaces/fluxer/fluxer_api/pkgs/sms/node_modules
- volume:
- nocopy: true
- type: volume
source: fluxer-api-virus-scan-node-modules
target: /workspaces/fluxer/fluxer_api/pkgs/virus_scan/node_modules
@@ -384,7 +379,6 @@ volumes:
fluxer-api-mime-utils-node-modules:
fluxer-api-nats-node-modules:
fluxer-api-rate-limit-node-modules:
- fluxer-api-sms-node-modules:
fluxer-api-virus-scan-node-modules:
fluxer-api-worker-node-modules:
fluxer-app-list-utils-node-modules:
diff --git a/config/env/development.env b/config/env/development.env
index f87207d6d..f8b6b027b 100644
--- a/config/env/development.env
+++ b/config/env/development.env
@@ -107,7 +107,6 @@ FLUXER_EMAIL_SMTP_PORT=1025
FLUXER_EMAIL_SMTP_USERNAME=dev
FLUXER_EMAIL_SMTP_PASSWORD=dev
FLUXER_EMAIL_SMTP_SECURE=false
-FLUXER_SMS_ENABLED=false
FLUXER_CAPTCHA_ENABLED=false
FLUXER_CAPTCHA_PROVIDER=none
FLUXER_SEARCH_ENGINE=meilisearch
diff --git a/deploy/self-hosting/.env.example b/deploy/self-hosting/.env.example
index 97b6f09d9..a87dc1fca 100644
--- a/deploy/self-hosting/.env.example
+++ b/deploy/self-hosting/.env.example
@@ -98,15 +98,12 @@ MEILI_MASTER_KEY=CHANGE_ME
#FLUXER_LIVEKIT_ENABLED=false
# Optional systems, each off unless configured.
-#FLUXER_SMS_ENABLED=false
#FLUXER_STRIPE_ENABLED=false
#FLUXER_NCMEC_ENABLED=false
#FLUXER_CLAMAV_ENABLED=false
-# Outside lookups, off unless turned on. The Tor exit list comes from
-# onionoo.torproject.org and the breached password check asks
+# Outside lookups, off unless turned on. The breached password check asks
# api.pwnedpasswords.com.
-#FLUXER_TOR_EXIT_LIST_ENABLED=true
#FLUXER_BREACHED_PASSWORD_CHECK_ENABLED=true
# The client address. Name the header your proxy actually writes, and turn the
diff --git a/deploy/self-hosting/docker-compose.yml b/deploy/self-hosting/docker-compose.yml
index 01a043ad9..20472a9c9 100644
--- a/deploy/self-hosting/docker-compose.yml
+++ b/deploy/self-hosting/docker-compose.yml
@@ -24,7 +24,6 @@ x-fluxer-env: &fluxer-env
FLUXER_CLIENT_IP_HEADER_NAME: ${FLUXER_CLIENT_IP_HEADER_NAME:-x-forwarded-for}
FLUXER_API_HEADERS_TIMEOUT_MS: ${FLUXER_API_HEADERS_TIMEOUT_MS:-30000}
FLUXER_API_REQUEST_TIMEOUT_MS: ${FLUXER_API_REQUEST_TIMEOUT_MS:-120000}
- FLUXER_TOR_EXIT_LIST_ENABLED: "${FLUXER_TOR_EXIT_LIST_ENABLED:-false}"
FLUXER_BREACHED_PASSWORD_CHECK_ENABLED: "${FLUXER_BREACHED_PASSWORD_CHECK_ENABLED:-false}"
FLUXER_KV_URL: ${FLUXER_KV_URL:-redis://valkey:6379/0}
@@ -74,7 +73,6 @@ x-fluxer-env: &fluxer-env
FLUXER_EMAIL_SMTP_PASSWORD: ${FLUXER_EMAIL_SMTP_PASSWORD:-}
FLUXER_EMAIL_SMTP_SECURE: ${FLUXER_EMAIL_SMTP_SECURE:-true}
- FLUXER_SMS_ENABLED: "${FLUXER_SMS_ENABLED:-false}"
FLUXER_CAPTCHA_ENABLED: ${FLUXER_CAPTCHA_ENABLED:-false}
FLUXER_CAPTCHA_PROVIDER: ${FLUXER_CAPTCHA_PROVIDER:-none}
FLUXER_CAPTCHA_HCAPTCHA_SITE_KEY: ${FLUXER_CAPTCHA_HCAPTCHA_SITE_KEY:-}
diff --git a/fluxer_admin/openapi-admin.json b/fluxer_admin/openapi-admin.json
index b7886cc0d..a1a3f63c2 100644
--- a/fluxer_admin/openapi-admin.json
+++ b/fluxer_admin/openapi-admin.json
@@ -6070,6 +6070,69 @@
]
}
},
+ "/admin/users/{user_id}/ban/notes": {
+ "post": {
+ "operationId": "annotate_admin_user_ban",
+ "summary": "Add a note to a user ban",
+ "tags": ["Admin"],
+ "responses": {
+ "204": {"description": "No Content"},
+ "400": {
+ "description": "Bad Request - The request was malformed or contained invalid data",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "401": {
+ "description": "Unauthorized - Authentication is required or the token is invalid",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "403": {
+ "description": "Forbidden - You do not have permission to perform this action",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ },
+ "429": {
+ "description": "Too Many Requests - You are being rate limited",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/ThrottledError"}}},
+ "headers": {
+ "Retry-After": {
+ "description": "Number of seconds to wait before retrying (only on 429)",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Limit": {
+ "description": "The number of requests that can be made in the current window",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Remaining": {
+ "description": "The number of remaining requests that can be made",
+ "schema": {"type": "integer"}
+ },
+ "X-RateLimit-Reset": {
+ "description": "Unix timestamp when the rate limit resets",
+ "schema": {"type": "integer"}
+ }
+ }
+ },
+ "500": {
+ "description": "Internal Server Error - An unexpected error occurred",
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
+ }
+ },
+ "description": "Append a note to the current ban of a user. The note is recorded as the reason of a new annotate_ban audit log entry whose metadata names the ban audit log entry. Earlier entries are never changed. Requires USER_TEMP_BAN permission.",
+ "security": [{"adminApiKey": []}],
+ "parameters": [
+ {
+ "name": "user_id",
+ "in": "path",
+ "required": true,
+ "schema": {"description": "The ID of the user", "allOf": [{"$ref": "#/components/schemas/SnowflakeType"}]},
+ "description": "The ID of the user"
+ }
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminUserBanNoteRequest"}}}
+ }
+ }
+ },
"/admin/users/{user_id}/bot-status": {
"put": {
"operationId": "set_admin_user_bot_status",
@@ -6329,7 +6392,7 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "description": "Schedule user account for deletion after grace period. Account will be fully deleted with all content unless cancellation is executed. Creates audit log entry. Requires USER_DELETE permission.",
+ "description": "Schedule user account for deletion after grace period. Account will be fully deleted with all content unless cancellation is executed. When a deletion is already scheduled, the request must name it in replace_pending_deletion_at or it returns 409. Records who scheduled the deletion. Creates audit log entry. Requires USER_DELETE permission.",
"security": [{"adminApiKey": []}],
"parameters": [
{
@@ -6393,7 +6456,7 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "description": "Cancel a scheduled account deletion. User account restoration prevents data loss. Creates audit log entry. Requires USER_DELETE permission.",
+ "description": "Cancel the scheduled account deletion named by expected_pending_deletion_at. Returns 409 when a different deletion is pending and 400 when none is. The user is emailed only when notify_user is true, and the email never includes the audit log reason. Creates audit log entry recording the cancelled deletion. Requires USER_DELETE permission.",
"security": [{"adminApiKey": []}],
"parameters": [
{
@@ -6403,7 +6466,11 @@
"schema": {"description": "The ID of the user", "allOf": [{"$ref": "#/components/schemas/SnowflakeType"}]},
"description": "The ID of the user"
}
- ]
+ ],
+ "requestBody": {
+ "required": true,
+ "content": {"application/json": {"schema": {"$ref": "#/components/schemas/AdminUserDeletionCancelRequest"}}}
+ }
}
},
"/admin/users/{user_id}/dm-channels": {
@@ -9702,6 +9769,23 @@
}
]
},
+ "AdminUserDeletionCancelRequest": {
+ "type": "object",
+ "properties": {
+ "expected_pending_deletion_at": {
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$",
+ "description": "pending_deletion_at of the deletion being cancelled, as shown on the account"
+ },
+ "notify_user": {
+ "default": false,
+ "description": "Whether to email the user that the deletion was cancelled",
+ "type": "boolean"
+ }
+ },
+ "required": ["expected_pending_deletion_at"]
+ },
"AdminUserDeletionScheduleRequest": {
"type": "object",
"properties": {
@@ -9716,6 +9800,12 @@
"type": "integer",
"minimum": 1,
"maximum": 365
+ },
+ "replace_pending_deletion_at": {
+ "description": "pending_deletion_at of the deletion this request replaces. Required when a deletion is already scheduled for the account",
+ "type": "string",
+ "format": "date-time",
+ "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
}
},
"required": ["reason_code"]
@@ -9756,6 +9846,20 @@
"properties": {"bot": {"type": "boolean", "description": "Whether the user should be marked as a bot"}},
"required": ["bot"]
},
+ "AdminUserBanNoteRequest": {
+ "type": "object",
+ "properties": {
+ "ban_audit_log_id": {
+ "description": "Audit log entry of the current ban that the note refers to",
+ "allOf": [{"$ref": "#/components/schemas/SnowflakeType"}]
+ },
+ "note": {
+ "description": "Note to append to the ban. Recorded as the reason of a new audit log entry",
+ "type": "string"
+ }
+ },
+ "required": ["ban_audit_log_id", "note"]
+ },
"AdminUserBanRequest": {
"type": "object",
"properties": {
@@ -9837,7 +9941,7 @@
"type": "object",
"properties": {
"acls": {
- "maxItems": 111,
+ "maxItems": 108,
"type": "array",
"items": {"$ref": "#/components/schemas/AdminAclType"},
"description": "List of access control permissions to assign"
@@ -10719,16 +10823,6 @@
},
"required": ["gif", "youtube", "bluesky"],
"additionalProperties": false
- },
- "deferred_phone_gate": {
- "type": "object",
- "properties": {
- "enabled": {"type": "boolean"},
- "window_hours": {"type": "number"},
- "member_threshold": {"type": "number"}
- },
- "required": ["enabled", "window_hours", "member_threshold"],
- "additionalProperties": false
}
},
"required": [
@@ -10739,8 +10833,7 @@
"premium_mode",
"services",
"services_resolved",
- "services_available",
- "deferred_phone_gate"
+ "services_available"
],
"additionalProperties": false
},
@@ -11312,15 +11405,6 @@
"youtube_enabled": {"nullable": true, "type": "boolean"},
"bluesky_enabled": {"nullable": true, "type": "boolean"}
}
- },
- "deferred_phone_gate": {
- "nullable": true,
- "type": "object",
- "properties": {
- "enabled": {"type": "boolean"},
- "window_hours": {"type": "number", "minimum": 0, "exclusiveMinimum": true, "maximum": 8760},
- "member_threshold": {"type": "integer", "minimum": 0, "exclusiveMinimum": true, "maximum": 1000000}
- }
}
}
},
@@ -12323,17 +12407,7 @@
},
"AdminBlocklistListType": {
"type": "string",
- "enum": [
- "ip",
- "email",
- "email-domain-suspicious",
- "phrase",
- "url",
- "url-domain",
- "file-sha",
- "avatar-hash",
- "profile-substring"
- ],
+ "enum": ["ip", "email", "phrase", "url", "url-domain", "file-sha", "avatar-hash", "profile-substring"],
"description": "The blocklist an entry belongs to"
},
"AdminBlocklistEntryUpdateRequest": {
@@ -12376,7 +12450,6 @@
"anyOf": [
{"$ref": "#/components/schemas/BanIpRequest"},
{"$ref": "#/components/schemas/BanEmailRequest"},
- {"$ref": "#/components/schemas/SuspiciousEmailDomainRequest"},
{"$ref": "#/components/schemas/BanPhraseRequest"},
{"$ref": "#/components/schemas/BanUrlRequest"},
{"$ref": "#/components/schemas/BanUrlDomainRequest"},
@@ -12753,7 +12826,7 @@
},
"acls": {
"description": "Replacement list of access control permissions for the key",
- "maxItems": 111,
+ "maxItems": 108,
"type": "array",
"items": {"$ref": "#/components/schemas/AdminAclType"}
}
@@ -12771,7 +12844,7 @@
"type": "string"
},
"acls": {
- "maxItems": 111,
+ "maxItems": 108,
"type": "array",
"items": {"type": "string"},
"description": "List of access control permissions for the key"
@@ -12801,7 +12874,7 @@
"maximum": 365
},
"acls": {
- "maxItems": 111,
+ "maxItems": 108,
"type": "array",
"items": {"$ref": "#/components/schemas/AdminAclType"},
"description": "List of access control permissions for the key"
@@ -12822,7 +12895,7 @@
"type": "string"
},
"acls": {
- "maxItems": 111,
+ "maxItems": 108,
"type": "array",
"items": {"type": "string"},
"description": "List of access control permissions for the key"
@@ -12835,7 +12908,7 @@
"type": "object",
"properties": {
"acls": {
- "maxItems": 111,
+ "maxItems": 108,
"type": "array",
"items": {"type": "string", "minLength": 1, "maxLength": 64},
"description": "Every admin access control permission the admin API recognises"
@@ -12864,9 +12937,6 @@
"ban:email:add",
"ban:email:check",
"ban:email:remove",
- "suspicious_email_domain:add",
- "suspicious_email_domain:check",
- "suspicious_email_domain:remove",
"ban:phrase:add",
"ban:phrase:check",
"ban:phrase:remove",
@@ -13179,19 +13249,6 @@
},
"required": ["phrase"]
},
- "SuspiciousEmailDomainRequest": {
- "type": "object",
- "properties": {
- "domain": {
- "type": "string",
- "minLength": 1,
- "maxLength": 253,
- "pattern": "^[a-zA-Z0-9][a-zA-Z0-9\\-.]*\\.[a-zA-Z]{2,}$",
- "description": "Email domain to flag as suspicious (e.g. mail.ru). Registrants from this domain will be required to verify a phone number."
- }
- },
- "required": ["domain"]
- },
"BanEmailRequest": {
"type": "object",
"properties": {
@@ -13434,12 +13491,12 @@
{
"name": "FORCE_INBOUND_PHONE_VERIFICATION",
"value": "2305843009213693952",
- "description": "User is forced through inbound (expensive-destination) phone verification regardless of phone prefix, for debugging"
+ "description": "User is forced through inbound phone verification, for debugging"
},
{
"name": "NOT_SUSPICIOUS",
"value": "4611686018427387904",
- "description": "User is permanently exempt from automatic suspicious-activity flagging on RPC session start (does not require a prior payment)"
+ "description": "User is permanently exempt from automatic suspicious-activity flagging"
}
]
},
@@ -15703,14 +15760,29 @@
"suspicious_activity_flags": {"allOf": [{"$ref": "#/components/schemas/SuspiciousActivityFlags"}]},
"phone_verification_deferred": {
"type": "boolean",
- "description": "Whether a stored phone requirement is deferred until the user joins a discoverable or large community"
+ "description": "Whether a stored phone requirement is deferred and not enforced"
},
"temp_banned_until": {"nullable": true, "type": "string"},
"pending_deletion_at": {"nullable": true, "type": "string"},
"pending_bulk_message_deletion_at": {"nullable": true, "type": "string"},
"deletion_reason_code": {"nullable": true, "allOf": [{"$ref": "#/components/schemas/Int32Type"}]},
"deletion_public_reason": {"nullable": true, "type": "string"},
- "acls": {"maxItems": 111, "type": "array", "items": {"type": "string"}},
+ "deletion_audit_log_reason": {
+ "nullable": true,
+ "description": "Private reason recorded with the pending deletion, null without the audit log view permission",
+ "type": "string"
+ },
+ "deletion_scheduled_by": {
+ "nullable": true,
+ "description": "ID of the account that scheduled the pending deletion, null when it was not recorded",
+ "allOf": [{"$ref": "#/components/schemas/SnowflakeStringType"}]
+ },
+ "deletion_scheduled_at": {
+ "nullable": true,
+ "description": "ISO 8601 timestamp when the pending deletion was scheduled",
+ "type": "string"
+ },
+ "acls": {"maxItems": 108, "type": "array", "items": {"type": "string"}},
"traits": {"maxItems": 100, "type": "array", "items": {"type": "string"}},
"has_totp": {"type": "boolean"},
"authenticator_types": {"maxItems": 10, "type": "array", "items": {"$ref": "#/components/schemas/Int32Type"}},
@@ -15751,6 +15823,9 @@
"pending_bulk_message_deletion_at",
"deletion_reason_code",
"deletion_public_reason",
+ "deletion_audit_log_reason",
+ "deletion_scheduled_by",
+ "deletion_scheduled_at",
"acls",
"traits",
"has_totp",
diff --git a/fluxer_admin/src/acl.rs b/fluxer_admin/src/acl.rs
index 7c4fa0e05..d2b8bf3b1 100644
--- a/fluxer_admin/src/acl.rs
+++ b/fluxer_admin/src/acl.rs
@@ -17,9 +17,6 @@ pub const JOBS_CANCEL: &str = "jobs:cancel";
pub const BAN_EMAIL_ADD: &str = "ban:email:add";
pub const BAN_EMAIL_CHECK: &str = "ban:email:check";
pub const BAN_EMAIL_REMOVE: &str = "ban:email:remove";
-pub const SUSPICIOUS_EMAIL_DOMAIN_ADD: &str = "suspicious_email_domain:add";
-pub const SUSPICIOUS_EMAIL_DOMAIN_CHECK: &str = "suspicious_email_domain:check";
-pub const SUSPICIOUS_EMAIL_DOMAIN_REMOVE: &str = "suspicious_email_domain:remove";
pub const BAN_PHRASE_ADD: &str = "ban:phrase:add";
pub const BAN_PHRASE_CHECK: &str = "ban:phrase:check";
pub const BAN_PHRASE_REMOVE: &str = "ban:phrase:remove";
@@ -129,9 +126,6 @@ pub const ALL_ACLS: &[&str] = &[
BAN_EMAIL_ADD,
BAN_EMAIL_CHECK,
BAN_EMAIL_REMOVE,
- SUSPICIOUS_EMAIL_DOMAIN_ADD,
- SUSPICIOUS_EMAIL_DOMAIN_CHECK,
- SUSPICIOUS_EMAIL_DOMAIN_REMOVE,
BAN_PHRASE_ADD,
BAN_PHRASE_CHECK,
BAN_PHRASE_REMOVE,
diff --git a/fluxer_admin/src/api/bans.rs b/fluxer_admin/src/api/bans.rs
index cdd43fa20..86f345e95 100644
--- a/fluxer_admin/src/api/bans.rs
+++ b/fluxer_admin/src/api/bans.rs
@@ -9,12 +9,11 @@ impl AdminApiClient {
pub async fn ban_email(&self, email: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
self.create_blocklist_entry(
"email",
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_1: Some(generated_types::BanEmailRequest {
+ generated_types::AdminBlocklistEntryCreateRequest::from(
+ generated_types::BanEmailRequest {
email: generated_types::EmailType::from(email.to_owned()),
- }),
- ..Default::default()
- },
+ },
+ ),
audit_log_reason,
)
.await
@@ -32,10 +31,9 @@ impl AdminApiClient {
pub async fn ban_ip(&self, ip: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
self.create_blocklist_entry(
"ip",
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_0: Some(generated_types::BanIpRequest { ip: ip.to_owned() }),
- ..Default::default()
- },
+ generated_types::AdminBlocklistEntryCreateRequest::from(
+ generated_types::BanIpRequest { ip: ip.to_owned() },
+ ),
audit_log_reason,
)
.await
@@ -50,45 +48,14 @@ impl AdminApiClient {
self.check_blocklist_entry("ip", ip, None).await
}
- pub async fn add_suspicious_email_domain(
- &self,
- domain: &str,
- audit_log_reason: Option<&str>,
- ) -> ApiResult<()> {
- self.create_blocklist_entry(
- SUSPICIOUS_EMAIL_DOMAIN_LIST,
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_2: Some(suspicious_email_domain_request(domain)?),
- ..Default::default()
- },
- audit_log_reason,
- )
- .await
- }
-
- pub async fn remove_suspicious_email_domain(
- &self,
- domain: &str,
- audit_log_reason: Option<&str>,
- ) -> ApiResult<()> {
- self.delete_blocklist_entry(SUSPICIOUS_EMAIL_DOMAIN_LIST, domain, None, audit_log_reason)
- .await
- }
-
- pub async fn check_suspicious_email_domain(&self, domain: &str) -> ApiResult<BanCheckResult> {
- self.check_blocklist_entry(SUSPICIOUS_EMAIL_DOMAIN_LIST, domain, None)
- .await
- }
-
pub async fn ban_phrase(&self, phrase: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
self.create_blocklist_entry(
"phrase",
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_3: Some(generated_types::BanPhraseRequest {
+ generated_types::AdminBlocklistEntryCreateRequest::from(
+ generated_types::BanPhraseRequest {
phrase: phrase.to_owned(),
- }),
- ..Default::default()
- },
+ },
+ ),
audit_log_reason,
)
.await
@@ -110,16 +77,15 @@ impl AdminApiClient {
pub async fn ban_url(&self, url: &str, audit_log_reason: Option<&str>) -> ApiResult<()> {
self.create_blocklist_entry(
"url",
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_4: Some(generated_types::BanUrlRequest {
+ generated_types::AdminBlocklistEntryCreateRequest::from(
+ generated_types::BanUrlRequest {
category: None,
notes: None,
severity: None,
source_url: None,
url: url.to_owned(),
- }),
- ..Default::default()
- },
+ },
+ ),
audit_log_reason,
)
.await
@@ -142,17 +108,16 @@ impl AdminApiClient {
) -> ApiResult<()> {
self.create_blocklist_entry(
"url-domain",
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_5: Some(generated_types::BanUrlDomainRequest {
+ generated_types::AdminBlocklistEntryCreateRequest::from(
+ generated_types::BanUrlDomainRequest {
category: None,
domain: domain.to_owned(),
match_subdomains,
notes: None,
severity: None,
source_url: None,
- }),
- ..Default::default()
- },
+ },
+ ),
audit_log_reason,
)
.await
@@ -178,17 +143,16 @@ impl AdminApiClient {
) -> ApiResult<()> {
self.create_blocklist_entry(
"file-sha",
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_6: Some(generated_types::BanFileShaRequest {
+ generated_types::AdminBlocklistEntryCreateRequest::from(
+ generated_types::BanFileShaRequest {
category: None,
content_type: None,
notes: None,
severity: None,
sha256_hex: sha256_hex.to_owned(),
source_url: None,
- }),
- ..Default::default()
- },
+ },
+ ),
audit_log_reason,
)
.await
@@ -231,17 +195,16 @@ impl AdminApiClient {
) -> ApiResult<()> {
self.create_blocklist_entry(
"avatar-hash",
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_7: Some(generated_types::BanAvatarHashRequest {
+ generated_types::AdminBlocklistEntryCreateRequest::from(
+ generated_types::BanAvatarHashRequest {
category: None,
hashes: vec![hash_short.to_owned()],
notes: None,
reason: None,
severity: None,
source_url: None,
- }),
- ..Default::default()
- },
+ },
+ ),
audit_log_reason,
)
.await
@@ -279,10 +242,9 @@ impl AdminApiClient {
) -> ApiResult<()> {
self.create_blocklist_entry(
PROFILE_SUBSTRING_LIST,
- generated_types::AdminBlocklistEntryCreateRequest {
- subtype_8: Some(profile_substring_request(scope, substring)?),
- ..Default::default()
- },
+ generated_types::AdminBlocklistEntryCreateRequest::from(profile_substring_request(
+ scope, substring,
+ )?),
audit_log_reason,
)
.await
@@ -359,8 +321,6 @@ impl AdminApiClient {
}
}
-const SUSPICIOUS_EMAIL_DOMAIN_LIST: &str = "email-domain-suspicious";
-
const PROFILE_SUBSTRING_LIST: &str = "profile-substring";
fn blocklist_list_type(list_type: &str) -> ApiResult<generated_types::AdminBlocklistListType> {
@@ -380,15 +340,6 @@ fn blocklist_delete_scope(
.map_err(|e| ApiError::Parse(e.to_string()))
}
-fn suspicious_email_domain_request(
- domain: &str,
-) -> ApiResult<generated_types::SuspiciousEmailDomainRequest> {
- Ok(generated_types::SuspiciousEmailDomainRequest {
- domain: generated_types::SuspiciousEmailDomainRequestDomain::try_from(domain)
- .map_err(|e| ApiError::Parse(e.to_string()))?,
- })
-}
-
fn profile_substring_request(
scope: &str,
substring: &str,
diff --git a/fluxer_admin/src/api/client.rs b/fluxer_admin/src/api/client.rs
index c4357b36b..8fc478fa9 100644
--- a/fluxer_admin/src/api/client.rs
+++ b/fluxer_admin/src/api/client.rs
@@ -90,10 +90,7 @@ impl AdminApiClient {
fn headers_with_reason(&self, audit_log_reason: Option<&str>) -> ApiResult<HeaderMap> {
let mut headers = self.generated.inner().clone();
if let Some(reason) = audit_log_reason {
- let mut value = HeaderValue::from_str(reason)
- .map_err(|_| ApiError::Parse("invalid audit log reason header".to_owned()))?;
- value.set_sensitive(true);
- headers.insert("x-audit-log-reason", value);
+ headers.insert("x-audit-log-reason", audit_log_reason_header(reason)?);
}
Ok(headers)
}
@@ -422,11 +419,27 @@ impl std::fmt::Display for ApiError {
}
}
+fn audit_log_reason_header(reason: &str) -> ApiResult<HeaderValue> {
+ let mut value = HeaderValue::from_bytes(reason.as_bytes())
+ .map_err(|_| ApiError::Parse("invalid audit log reason header".to_owned()))?;
+ value.set_sensitive(true);
+ Ok(value)
+}
+
#[cfg(test)]
mod tests {
use super::*;
use serde_json::{Value, json};
+ #[test]
+ fn audit_log_reason_header_carries_utf8_bytes() {
+ let reason = "§ 3 Regel – wiederholt 日本";
+ let value = audit_log_reason_header(reason).expect("valid reason header");
+ assert_eq!(value.as_bytes(), reason.as_bytes());
+ assert!(value.is_sensitive());
+ assert!(audit_log_reason_header("line one\nline two").is_err());
+ }
+
fn response(status: u16, body: &'static str) -> reqwest::Response {
axum::http::Response::builder()
.status(status)
diff --git a/fluxer_admin/src/api/types/common.rs b/fluxer_admin/src/api/types/common.rs
index e54d404ad..a1bc703e7 100644
--- a/fluxer_admin/src/api/types/common.rs
+++ b/fluxer_admin/src/api/types/common.rs
@@ -122,6 +122,12 @@ pub struct AdminUser {
pub pending_bulk_message_deletion_at: Option<String>,
pub deletion_reason_code: Option<i32>,
pub deletion_public_reason: Option<String>,
+ #[serde(default)]
+ pub deletion_audit_log_reason: Option<String>,
+ #[serde(default)]
+ pub deletion_scheduled_by: Option<String>,
+ #[serde(default)]
+ pub deletion_scheduled_at: Option<String>,
pub last_active_at: Option<String>,
pub last_active_ip: Option<String>,
pub last_active_ip_reverse: Option<String>,
diff --git a/fluxer_admin/src/api/types/instance_config.rs b/fluxer_admin/src/api/types/instance_config.rs
index 87dd429cf..9b87f3091 100644
--- a/fluxer_admin/src/api/types/instance_config.rs
+++ b/fluxer_admin/src/api/types/instance_config.rs
@@ -51,28 +51,6 @@ pub struct InstancePolicyResponse {
pub services_resolved: InstanceServicesResolved,
#[serde(default)]
pub services_available: InstanceServicesAvailable,
- #[serde(default)]
- pub deferred_phone_gate: DeferredPhoneGateResponse,
-}
-
-#[derive(Clone, Debug, Deserialize, Serialize)]
-pub struct DeferredPhoneGateResponse {
- #[serde(default)]
- pub enabled: bool,
- #[serde(default)]
- pub window_hours: f64,
- #[serde(default)]
- pub member_threshold: i64,
-}
-
-impl Default for DeferredPhoneGateResponse {
- fn default() -> Self {
- Self {
- enabled: true,
- window_hours: 6.0,
- member_threshold: 50,
- }
- }
}
impl Default for InstancePolicyResponse {
@@ -86,7 +64,6 @@ impl Default for InstancePolicyResponse {
services: InstanceServicesOverrides::default(),
services_resolved: InstanceServicesResolved::default(),
services_available: InstanceServicesAvailable::default(),
- deferred_phone_gate: DeferredPhoneGateResponse::default(),
}
}
}
@@ -781,18 +758,6 @@ pub struct InstancePolicyUpdateRequest {
pub premium_mode: Option<PremiumMode>,
#[serde(skip_serializing_if = "Option::is_none")]
pub services: Option<InstanceServicesUpdateRequest>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub deferred_phone_gate: Option<DeferredPhoneGateUpdateRequest>,
-}
-
-#[derive(Clone, Debug, Default, Serialize)]
-pub struct DeferredPhoneGateUpdateRequest {
- #[serde(skip_serializing_if = "Option::is_none")]
- pub enabled: Option<bool>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub window_hours: Option<f64>,
- #[serde(skip_serializing_if = "Option::is_none")]
- pub member_threshold: Option<i64>,
}
#[derive(Clone, Debug, Default, Serialize)]
diff --git a/fluxer_admin/src/api/users.rs b/fluxer_admin/src/api/users.rs
index 5455c142b..5c0eb00f3 100644
--- a/fluxer_admin/src/api/users.rs
+++ b/fluxer_admin/src/api/users.rs
@@ -439,6 +439,7 @@ impl AdminApiClient {
public_reason: public_reason.map(std::borrow::ToOwned::to_owned),
reason_code: crate::api::generated::deletion_reason_code(reason_code, "reason_code")
.map_err(ApiError::Parse)?,
+ replace_pending_deletion_at: None,
};
let response = self
.generated_with_reason(audit_log_reason)?
@@ -449,16 +450,44 @@ impl AdminApiClient {
Ok(resp.user)
}
- pub async fn cancel_deletion(&self, user_id: &str) -> ApiResult<AdminUser> {
- let response = self
- .generated()
- .cancel_admin_user_deletion(&snowflake(user_id))
- .await
- .map_err(|e| self.generated_error(e))?;
- let resp: UserMutationResponse = self.generated_value(response.into_inner())?;
+ pub async fn cancel_deletion(
+ &self,
+ user_id: &str,
+ expected_pending_deletion_at: &str,
+ notify_user: bool,
+ audit_log_reason: Option<&str>,
+ ) -> ApiResult<AdminUser> {
+ let body = serde_json::json!({
+ "expected_pending_deletion_at": expected_pending_deletion_at,
+ "notify_user": notify_user,
+ });
+ let resp: UserMutationResponse = self
+ .delete_with_reason(
+ &format!("/admin/users/{}/deletion", urlencoding::encode(user_id)),
+ Some(&body),
+ audit_log_reason,
+ )
+ .await?;
Ok(resp.user)
}
+ pub async fn annotate_ban(
+ &self,
+ user_id: &str,
+ ban_audit_log_id: &str,
+ note: &str,
+ ) -> ApiResult<()> {
+ let body = serde_json::json!({
+ "ban_audit_log_id": ban_audit_log_id,
+ "note": note,
+ });
+ self.post_void(
+ &format!("/admin/users/{}/ban/notes", urlencoding::encode(user_id)),
+ Some(&body),
+ )
+ .await
+ }
+
pub async fn change_dob(&self, user_id: &str, dob: &str) -> ApiResult<AdminUser> {
let body = generated_types::AdminUserDobUpdateRequest {
date_of_birth: dob.to_owned(),
diff --git a/fluxer_admin/src/routes/bans.rs b/fluxer_admin/src/routes/bans.rs
index f718d3f17..387873ade 100644
--- a/fluxer_admin/src/routes/bans.rs
+++ b/fluxer_admin/src/routes/bans.rs
@@ -23,10 +23,6 @@ pub fn router() -> Router<AppState> {
Router::new()
.route("/ip-bans", get(ip_bans).post(ip_bans_post))
.route("/email-bans", get(email_bans).post(email_bans_post))
- .route(
- "/suspicious-email-domains",
- get(suspicious_email_domains).post(suspicious_email_domains_post),
- )
.route("/phrase-bans", get(phrase_bans).post(phrase_bans_post))
.route("/url-bans", get(url_bans).post(url_bans_post))
.route(
@@ -72,7 +68,6 @@ macro_rules! ban_get {
ban_get!(ip_bans, "ip-bans");
ban_get!(email_bans, "email-bans");
-ban_get!(suspicious_email_domains, "suspicious-email-domains");
ban_get!(phrase_bans, "phrase-bans");
ban_get!(url_bans, "url-bans");
ban_get!(file_sha_bans, "file-sha-bans");
@@ -141,7 +136,6 @@ macro_rules! ban_post {
ban_post!(ip_bans_post, "ip-bans");
ban_post!(email_bans_post, "email-bans");
-ban_post!(suspicious_email_domains_post, "suspicious-email-domains");
ban_post!(phrase_bans_post, "phrase-bans");
ban_post!(url_bans_post, "url-bans");
ban_post!(file_sha_bans_post, "file-sha-bans");
diff --git a/fluxer_admin/src/routes/bans_actions.rs b/fluxer_admin/src/routes/bans_actions.rs
index 2524187e6..666f521dc 100644
--- a/fluxer_admin/src/routes/bans_actions.rs
+++ b/fluxer_admin/src/routes/bans_actions.rs
@@ -116,11 +116,6 @@ async fn execute_single_ban(
let result = match ban_type {
"ip-bans" => client.ban_ip(value, audit_log_reason).await,
"email-bans" => client.ban_email(value, audit_log_reason).await,
- "suspicious-email-domains" => {
- client
- .add_suspicious_email_domain(value, audit_log_reason)
- .await
- }
"phrase-bans" => client.ban_phrase(value, audit_log_reason).await,
"url-bans" => client.ban_url(value, audit_log_reason).await,
"file-sha-bans" => client.ban_file_sha(value, audit_log_reason).await,
@@ -143,11 +138,6 @@ async fn execute_single_unban(
let result = match ban_type {
"ip-bans" => client.unban_ip(value, audit_log_reason).await,
"email-bans" => client.unban_email(value, audit_log_reason).await,
- "suspicious-email-domains" => {
- client
- .remove_suspicious_email_domain(value, audit_log_reason)
- .await
- }
"phrase-bans" => client.unban_phrase(value, audit_log_reason).await,
"url-bans" => client.unban_url(value, audit_log_reason).await,
"file-sha-bans" => client.unban_file_sha(value, audit_log_reason).await,
@@ -169,7 +159,6 @@ async fn execute_check(
let result = match ban_type {
"ip-bans" => client.check_ip_ban(value).await,
"email-bans" => client.check_email_ban(value).await,
- "suspicious-email-domains" => client.check_suspicious_email_domain(value).await,
"phrase-bans" => client.check_phrase_ban(value).await,
"url-bans" => client.check_url_ban(value).await,
"file-sha-bans" => client.check_file_sha_ban(value).await,
diff --git a/fluxer_admin/src/routes/system_actions.rs b/fluxer_admin/src/routes/system_actions.rs
index cf5184381..e33eef902 100644
--- a/fluxer_admin/src/routes/system_actions.rs
+++ b/fluxer_admin/src/routes/system_actions.rs
@@ -8,20 +8,19 @@ use crate::{
AltchaCaptchaConfigUpdateRequest, AppBrandingConfigUpdateRequest,
AppLegalConfigUpdateRequest, AppPublicConfigUpdateRequest,
AppRegistrationConfigUpdateRequest, AppSetupConfigUpdateRequest,
- CreateRegistrationUrlRequest, DeferredPhoneGateUpdateRequest,
- DomainMigrationConfigUpdateRequest, EXPERIMENT_MAX_TARGETED_USERS,
- ExperimentDeliveryConfigUpdateRequest, GatewayRolloutConfigUpdateRequest,
- GatewayRolloutMode, InstanceAttachmentDecayUpdateRequest,
- InstanceBlueskyIntegrationUpdateRequest, InstanceBlueskyKeyIntegrationUpdateRequest,
- InstanceCaptchaIntegrationUpdateRequest, InstanceConfigUpdateRequest,
- InstanceEmailIntegrationUpdateRequest, InstanceEmailSmtpIntegrationUpdateRequest,
- InstanceEmailSmtpTestRequest, InstanceGifIntegrationUpdateRequest,
- InstanceIntegrationsUpdateRequest, InstanceMediaUpdateRequest,
- InstancePolicyUpdateRequest, InstanceRegistrationConfigUpdateRequest,
- InstanceServicesUpdateRequest, InstanceYoutubeIntegrationUpdateRequest,
- LimitConfigUpdateRequest, LimitRule, LimitRuleFilters, PremiumMode,
- ProfileTimezoneConfigUpdateRequest, PushRelayConfigUpdateRequest, RegistrationMode,
- SsoConfigUpdateRequest, VoiceE2eeScope,
+ CreateRegistrationUrlRequest, DomainMigrationConfigUpdateRequest,
+ EXPERIMENT_MAX_TARGETED_USERS, ExperimentDeliveryConfigUpdateRequest,
+ GatewayRolloutConfigUpdateRequest, GatewayRolloutMode,
+ InstanceAttachmentDecayUpdateRequest, InstanceBlueskyIntegrationUpdateRequest,
+ InstanceBlueskyKeyIntegrationUpdateRequest, InstanceCaptchaIntegrationUpdateRequest,
+ InstanceConfigUpdateRequest, InstanceEmailIntegrationUpdateRequest,
+ InstanceEmailSmtpIntegrationUpdateRequest, InstanceEmailSmtpTestRequest,
+ InstanceGifIntegrationUpdateRequest, InstanceIntegrationsUpdateRequest,
+ InstanceMediaUpdateRequest, InstancePolicyUpdateRequest,
+ InstanceRegistrationConfigUpdateRequest, InstanceServicesUpdateRequest,
+ InstanceYoutubeIntegrationUpdateRequest, LimitConfigUpdateRequest, LimitRule,
+ LimitRuleFilters, PremiumMode, ProfileTimezoneConfigUpdateRequest,
+ PushRelayConfigUpdateRequest, RegistrationMode, SsoConfigUpdateRequest, VoiceE2eeScope,
},
},
config::AdminConfig,
@@ -808,7 +807,6 @@ fn build_policy_update(form: &MultiValueForm) -> InstanceConfigUpdateRequest {
_ => None,
};
let services = build_services_update(form);
- let deferred_phone_gate = build_deferred_phone_gate_update(form);
InstanceConfigUpdateRequest {
policy: Some(InstancePolicyUpdateRequest {
single_community_enabled: None,
@@ -816,36 +814,11 @@ fn build_policy_update(form: &MultiValueForm) -> InstanceConfigUpdateRequest {
direct_messages_disabled,
premium_mode,
services,
- deferred_phone_gate,
}),
..Default::default()
}
}
-fn build_deferred_phone_gate_update(
- form: &MultiValueForm,
-) -> Option<DeferredPhoneGateUpdateRequest> {
- let enabled = form
- .first("policy_deferred_phone_gate_enabled")
- .map(|value| value == "true");
- let window_hours = form
- .first("policy_deferred_phone_gate_window_hours")
- .and_then(|value| value.parse::<f64>().ok())
- .filter(|value| *value > 0.0);
- let member_threshold = form
- .first("policy_deferred_phone_gate_member_threshold")
- .and_then(|value| value.parse::<i64>().ok())
- .filter(|value| *value > 0);
- if enabled.is_none() && window_hours.is_none() && member_threshold.is_none() {
- return None;
- }
- Some(DeferredPhoneGateUpdateRequest {
- enabled,
- window_hours,
- member_threshold,
- })
-}
-
fn build_services_update(form: &MultiValueForm) -> Option<InstanceServicesUpdateRequest> {
let parse_tristate = |key: &str| match form.first(key) {
Some("inherit") => Some(None),
@@ -980,7 +953,6 @@ fn build_single_community_update(enabled: bool) -> InstanceConfigUpdateRequest {
direct_messages_disabled: None,
premium_mode: None,
services: None,
- deferred_phone_gate: None,
}),
..Default::default()
}
diff --git a/fluxer_admin/src/routes/user_actions.rs b/fluxer_admin/src/routes/user_actions.rs
index 0c529d8bd..5830d641c 100644
--- a/fluxer_admin/src/routes/user_actions.rs
+++ b/fluxer_admin/src/routes/user_actions.rs
@@ -1,7 +1,9 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
use crate::{
- admin_flags, api::client::AdminApiClient, middleware::flash::FlashData,
+ admin_flags,
+ api::client::{AdminApiClient, ApiError},
+ middleware::flash::FlashData,
utils::forms::MultiValueForm,
};
use std::collections::HashSet;
@@ -303,11 +305,53 @@ pub async fn dispatch(
"Failed to schedule user deletion",
)
}
- "cancel_deletion" => DispatchOutcome::from_result(
- client.cancel_deletion(user_id).await,
- "User deletion cancelled successfully",
- "Failed to cancel user deletion",
- ),
+ "cancel_deletion" => {
+ let Some(expected) = get("expected_pending_deletion_at") else {
+ return DispatchOutcome::error(
+ "The pending deletion is missing from the form. Reload and review.",
+ );
+ };
+ if !form.bool_value("confirm") {
+ return DispatchOutcome::error(
+ "Confirm whose deletion you are cancelling before submitting",
+ );
+ }
+ let Some(private_reason) = get("private_reason") else {
+ return DispatchOutcome::error("A private reason is required to cancel a deletion");
+ };
+ let notify_user = form.bool_value("notify_user");
+ match client
+ .cancel_deletion(user_id, &expected, notify_user, Some(&private_reason))
+ .await
+ {
+ Ok(_) => DispatchOutcome::success("User deletion cancelled successfully"),
+ Err(ApiError::Http { status: 409, .. }) => DispatchOutcome::error(
+ "The pending deletion changed since this page loaded. Reload and review.",
+ ),
+ Err(error) => {
+ tracing::warn!(%error, user_id, "admin API request failed: cancel user deletion");
+ DispatchOutcome::error("Failed to cancel user deletion")
+ }
+ }
+ }
+ "annotate_ban" => {
+ let Some(ban_audit_log_id) = get("ban_audit_log_id") else {
+ return DispatchOutcome::error("The ban audit log entry is missing from the form");
+ };
+ let Some(note) = get("note") else {
+ return DispatchOutcome::error("Note is required");
+ };
+ match client.annotate_ban(user_id, &ban_audit_log_id, &note).await {
+ Ok(()) => DispatchOutcome::success("Note added to the ban"),
+ Err(ApiError::Http { status: 409, .. }) => DispatchOutcome::error(
+ "The ban changed since this page loaded. Reload and review.",
+ ),
+ Err(error) => {
+ tracing::warn!(%error, user_id, "admin API request failed: annotate ban");
+ DispatchOutcome::error("Failed to add the note to the ban")
+ }
+ }
+ }
"change_dob" => {
let Some(dob) = get("date_of_birth") else {
return DispatchOutcome::error("Date of birth is required");
diff --git a/fluxer_admin/src/routes/user_tabs.rs b/fluxer_admin/src/routes/user_tabs.rs
index 4b85f75b5..f76b9c965 100644
--- a/fluxer_admin/src/routes/user_tabs.rs
+++ b/fluxer_admin/src/routes/user_tabs.rs
@@ -111,11 +111,47 @@ pub async fn render(
query.delete_all_messages_channel_count.unwrap_or(0),
query.delete_all_messages_message_count.unwrap_or(0),
));
+ let deletion_scheduler = match u.deletion_scheduled_by.as_deref() {
+ Some(scheduler_id) if u.pending_deletion_at.is_some() && scheduler_id != u.id => {
+ client
+ .get_user_by_id(scheduler_id)
+ .await
+ .log_error("load deletion scheduler")
+ }
+ _ => None,
+ };
+ let ban_logs = if u.temp_banned_until.is_some()
+ && acl::has_permission(admin_acls, acl::AUDIT_LOG_VIEW)
+ {
+ client
+ .search_audit_logs(&SearchAuditLogsParams {
+ query: None,
+ admin_user_id: None,
+ target_id: Some(user_id.to_owned()),
+ target_type: Some("user".to_owned()),
+ access: Some("write".to_owned()),
+ sort_by: Some("created_at".to_owned()),
+ sort_order: Some("desc".to_owned()),
+ limit: 100,
+ offset: 0,
+ })
+ .await
+ .log_error("load ban audit logs")
+ .map(|response| response.logs)
+ .unwrap_or_default()
+ } else {
+ Vec::new()
+ };
+ let context = tabs::moderation::ModerationContext {
+ deletion_scheduler: deletion_scheduler.as_ref(),
+ current_ban: tabs::moderation::find_current_ban(&u, &ban_logs),
+ };
Some(tabs::moderation::moderation_tab(
config,
&u,
csrf_token,
admin_acls,
+ &context,
query.message_shred_job_id.as_deref(),
message_shred_status.as_ref(),
delete_all_messages_dry_run,
diff --git a/fluxer_admin/src/templates/layout_sidebar_nav.rs b/fluxer_admin/src/templates/layout_sidebar_nav.rs
index 8575f8e67..2cc5bede5 100644
--- a/fluxer_admin/src/templates/layout_sidebar_nav.rs
+++ b/fluxer_admin/src/templates/layout_sidebar_nav.rs
@@ -114,16 +114,6 @@ pub const NAV_SECTIONS: &[NavSection] = &[
acl::BAN_EMAIL_REMOVE
]
),
- item!(
- "Suspicious Email Domains",
- "/suspicious-email-domains",
- "suspicious-email-domains",
- [
- acl::SUSPICIOUS_EMAIL_DOMAIN_CHECK,
- acl::SUSPICIOUS_EMAIL_DOMAIN_ADD,
- acl::SUSPICIOUS_EMAIL_DOMAIN_REMOVE,
- ]
- ),
item!(
"Phrase Bans",
"/phrase-bans",
diff --git a/fluxer_admin/src/templates/pages/audit_logs_table.rs b/fluxer_admin/src/templates/pages/audit_logs_table.rs
index 2aa3e419c..1946c4f19 100644
--- a/fluxer_admin/src/templates/pages/audit_logs_table.rs
+++ b/fluxer_admin/src/templates/pages/audit_logs_table.rs
@@ -25,7 +25,9 @@ pub fn action_badge_variant(action: &str) -> BadgeVariant {
| "ban_ip"
| "ban_email" => BadgeVariant::Danger,
"unban" | "cancel_deletion" | "unban_ip" | "unban_email" => BadgeVariant::Success,
- "update_flags" | "update_features" | "set_acls" | "update_settings" => BadgeVariant::Info,
+ "update_flags" | "update_features" | "set_acls" | "update_settings" | "annotate_ban" => {
+ BadgeVariant::Info
+ }
"delete_message" => BadgeVariant::Warning,
_ => BadgeVariant::Default,
}
diff --git a/fluxer_admin/src/templates/pages/bans.rs b/fluxer_admin/src/templates/pages/bans.rs
index ae1ae924f..7b952de92 100644
--- a/fluxer_admin/src/templates/pages/bans.rs
+++ b/fluxer_admin/src/templates/pages/bans.rs
@@ -45,17 +45,6 @@ pub const BAN_CONFIGS: &[BanConfig] = &[
active_page: "email-bans",
show_bulk_tools: false,
},
- BanConfig {
- title: "Suspicious Email Domains",
- route: "/suspicious-email-domains",
- input_label: "Email Domain",
- input_name: "domain",
- input_type: "text",
- placeholder: "mail.ru",
- entity_name: "Domain",
- active_page: "suspicious-email-domains",
- show_bulk_tools: false,
- },
BanConfig {
title: "Phrase Bans",
route: "/phrase-bans",
diff --git a/fluxer_admin/src/templates/pages/bulk_actions.rs b/fluxer_admin/src/templates/pages/bulk_actions.rs
index 9c413c1be..ab6eeed68 100644
--- a/fluxer_admin/src/templates/pages/bulk_actions.rs
+++ b/fluxer_admin/src/templates/pages/bulk_actions.rs
@@ -410,6 +410,9 @@ fn bulk_schedule_deletion_section(base: &str, csrf_token: &str) -> Markup {
}
},
))
+ p class="text-neutral-500 text-sm" {
+ "Users that already have a pending deletion are skipped and listed as failed with the reason already scheduled. Cancel those from the user page first to schedule them again."
+ }
(text_input("public_reason", "Public Reason (optional)", "", "Terms of service violation"))
(form_field_group("Days Until Deletion", "days_until_deletion", true, None,
Some("Moderation reasons are held for at least 60 days. Only User requested allows 14."),
diff --git a/fluxer_admin/src/templates/pages/instance_config.rs b/fluxer_admin/src/templates/pages/instance_config.rs
index a7a0d6e8e..b2ea047c6 100644
--- a/fluxer_admin/src/templates/pages/instance_config.rs
+++ b/fluxer_admin/src/templates/pages/instance_config.rs
@@ -119,7 +119,6 @@ pub fn instance_config_page(
instance_config.self_hosted,
))
(sso_config_section(base, csrf_token, &instance_config.sso))
- (deferred_phone_gate_form(base, csrf_token, &instance_config.policy))
},
))
@if instance_config.self_hosted {
@@ -334,57 +333,6 @@ fn direct_messages_form(base: &str, csrf_token: &str, policy: &InstancePolicyRes
}
}
-fn deferred_phone_gate_form(
- base: &str,
- csrf_token: &str,
- policy: &InstancePolicyResponse,
-) -> Markup {
- let gate = &policy.deferred_phone_gate;
- let status = if gate.enabled {
- ("Enabled", BadgeVariant::Success)
- } else {
- ("Disabled", BadgeVariant::Default)
- };
- html! {
- div class="space-y-4 border-t border-neutral-200 pt-6" {
- div class="flex flex-wrap items-center gap-2" {
- h3 class="text-sm font-semibold text-neutral-900" { "Deferred phone verification" }
- (badge(status.0, status.1))
- }
- p class="text-sm text-neutral-500" {
- "When enabled, a phone requirement raised at registration is held back and only \
- applied if the account joins a discoverable community, or one above the member \
- threshold, within the window. Accounts that wait out the window are not challenged. \
- Inbound-SMS requirements are never deferred."
- }
- form method="post" action={(base) "/instance-config?action=update_policy"} {
- (csrf_input(csrf_token))
- div class="space-y-4" {
- (select_input("policy_deferred_phone_gate_enabled", "Deferred phone verification", &[
- ("true", "Enabled"),
- ("false", "Disabled"),
- ], if gate.enabled { "true" } else { "false" }))
- (text_input(
- "policy_deferred_phone_gate_window_hours",
- "Window (hours)",
- &gate.window_hours.to_string(),
- "6",
- ))
- (text_input(
- "policy_deferred_phone_gate_member_threshold",
- "Member threshold",
- &gate.member_threshold.to_string(),
- "50",
- ))
- (form_actions(html! {
- (submit_button("Save deferred phone verification"))
- }))
- }
- }
- }
- }
-}
-
fn premium_mode_form(
base: &str,
csrf_token: &str,
diff --git a/fluxer_admin/src/templates/pages/jobs_list.rs b/fluxer_admin/src/templates/pages/jobs_list.rs
index 32e768b38..06bfde907 100644
--- a/fluxer_admin/src/templates/pages/jobs_list.rs
+++ b/fluxer_admin/src/templates/pages/jobs_list.rs
@@ -31,7 +31,7 @@ fn filter_bar(base: &str, p: &JobsListParams) -> Markup {
div class="flex flex-col gap-2" {
label for="task_type" class=(FORM_LABEL_CLASS) { "Task type" }
input type="text" id="task_type" name="task_type"
- value=(p.task_type_filter) placeholder="syncDisposableEmailDomains"
+ value=(p.task_type_filter) placeholder="syncUrlBlocklists"
class=(FORM_INPUT_CLASS);
}
div class="flex flex-col gap-2" {
diff --git a/fluxer_admin/src/templates/pages/user_detail_tabs/moderation.rs b/fluxer_admin/src/templates/pages/user_detail_tabs/moderation.rs
index 9c3bf9133..bca935084 100644
--- a/fluxer_admin/src/templates/pages/user_detail_tabs/moderation.rs
+++ b/fluxer_admin/src/templates/pages/user_detail_tabs/moderation.rs
@@ -4,13 +4,14 @@ use crate::{
acl,
api::{
client::{ApiError, ApiResult},
- types::{AdminUser, MessageShredStatusResponse},
+ types::{AdminUser, AuditLogEntry, MessageShredStatusResponse},
},
config::AdminConfig,
templates::components::{
- form::{csrf_input, danger_button, form_actions, submit_button},
+ form::{checkbox, csrf_input, danger_button, form_actions, submit_button},
page_container::card_with_header,
},
+ utils::timestamps::format_admin_timestamp,
};
use maud::{Markup, html};
@@ -51,11 +52,60 @@ const DELETION_REASONS: &[(&str, &str)] = &[
("22", "Impersonation or fake identity"),
];
+pub struct CurrentBan<'a> {
+ pub entry: &'a AuditLogEntry,
+ pub notes: Vec<&'a AuditLogEntry>,
+}
+
+#[derive(Default)]
+pub struct ModerationContext<'a> {
+ pub deletion_scheduler: Option<&'a AdminUser>,
+ pub current_ban: Option<CurrentBan<'a>>,
+}
+
+pub fn find_current_ban<'a>(user: &AdminUser, logs: &'a [AuditLogEntry]) -> Option<CurrentBan<'a>> {
+ let banned_until = user.temp_banned_until.as_deref()?;
+ let entry = logs.iter().find(|log| {
+ log.action == "temp_ban"
+ && log.target_id == user.id
+ && log.metadata.get("banned_until").map(String::as_str) == Some(banned_until)
+ })?;
+ let mut notes: Vec<&AuditLogEntry> = logs
+ .iter()
+ .filter(|log| {
+ log.action == "annotate_ban"
+ && log.metadata.get("ban_audit_log_id") == Some(&entry.log_id)
+ })
+ .collect();
+ notes.sort_by(|a, b| a.created_at.cmp(&b.created_at));
+ Some(CurrentBan { entry, notes })
+}
+
+fn deletion_reason_label(code: i32) -> String {
+ let value = code.to_string();
+ DELETION_REASONS
+ .iter()
+ .find(|(candidate, _)| *candidate == value)
+ .map_or_else(
+ || format!("Reason {code}"),
+ |(_, label)| (*label).to_owned(),
+ )
+}
+
+fn admin_name(entry: &AuditLogEntry) -> String {
+ entry.admin_user.as_ref().map_or_else(
+ || entry.admin_user_id.clone(),
+ |admin| admin.username.clone(),
+ )
+}
+
+#[allow(clippy::too_many_arguments)]
pub fn moderation_tab(
config: &AdminConfig,
user: &AdminUser,
csrf_token: &str,
admin_acls: &[String],
+ context: &ModerationContext<'_>,
message_shred_job_id: Option<&str>,
message_shred_status: Option<&ApiResult<MessageShredStatusResponse>>,
delete_all_messages_dry_run: Option<(u64, u64)>,
@@ -66,8 +116,8 @@ pub fn moderation_tab(
html! {
div class="space-y-6" {
div class="grid grid-cols-1 gap-6 md:grid-cols-2" {
- (ban_actions_card(base, user, csrf_token))
- (deletion_card(base, user, csrf_token))
+ (ban_actions_card(base, user, csrf_token, context.current_ban.as_ref()))
+ (deletion_card(base, user, csrf_token, context.deletion_scheduler))
}
@if can_delete_all_messages {
(delete_all_messages_card(base, user, csrf_token, delete_all_messages_dry_run))
@@ -79,10 +129,16 @@ pub fn moderation_tab(
}
}
-fn ban_actions_card(base: &str, user: &AdminUser, csrf_token: &str) -> Markup {
+fn ban_actions_card(
+ base: &str,
+ user: &AdminUser,
+ csrf_token: &str,
+ current_ban: Option<&CurrentBan<'_>>,
+) -> Markup {
html! {
(card_with_header("Ban Actions", html! {
@if user.temp_banned_until.is_some() {
+ (current_ban_details(base, user, csrf_token, current_ban))
form method="post"
action={(base) "/users/" (user.id) "?action=unban&tab=moderation"} {
(csrf_input(csrf_token))
@@ -129,16 +185,160 @@ fn ban_actions_card(base: &str, user: &AdminUser, csrf_token: &str) -> Markup {
}
}
-fn deletion_card(base: &str, user: &AdminUser, csrf_token: &str) -> Markup {
+fn current_ban_details(
+ base: &str,
+ user: &AdminUser,
+ csrf_token: &str,
+ current_ban: Option<&CurrentBan<'_>>,
+) -> Markup {
+ let Some(ban) = current_ban else {
+ return html! {
+ p class="mb-4 text-sm text-neutral-500" {
+ "The audit log entry of this ban could not be loaded, so notes cannot be added here."
+ }
+ };
+ };
+ html! {
+ div class="mb-4 space-y-3" {
+ dl class="space-y-1 text-sm text-neutral-700" {
+ div {
+ dt class="inline font-medium" { "Banned by: " }
+ dd class="inline" {
+ a href={(base) "/users/" (ban.entry.admin_user_id)} class="underline" {
+ (admin_name(ban.entry))
+ }
+ " on " (format_admin_timestamp(&ban.entry.created_at))
+ }
+ }
+ div {
+ dt class="inline font-medium" { "Reason: " }
+ dd class="inline" { (ban.entry.audit_log_reason.as_deref().unwrap_or("None recorded")) }
+ }
+ }
+ @if !ban.notes.is_empty() {
+ ul class="space-y-1 text-sm text-neutral-700" {
+ @for note in &ban.notes {
+ li {
+ span class="font-medium" { (admin_name(note)) }
+ " (" (format_admin_timestamp(&note.created_at)) "): "
+ (note.audit_log_reason.as_deref().unwrap_or(""))
+ }
+ }
+ }
+ }
+ form method="post"
+ action={(base) "/users/" (user.id) "?action=annotate_ban&tab=moderation"} {
+ (csrf_input(csrf_token))
+ input type="hidden" name="ban_audit_log_id" value=(ban.entry.log_id);
+ div class="space-y-3" {
+ (form_label("Add a note to this ban"))
+ textarea name="note" rows="2" required maxlength="512"
+ placeholder="Appended to the ban. The original reason is kept."
+ class="block w-full rounded-md border border-neutral-300 \
+ px-3 py-2 text-sm shadow-sm \
+ focus:border-brand-primary focus:outline-none \
+ focus:ring-1 focus:ring-brand-primary" {}
+ (form_actions(html! {
+ (submit_button("Add Note"))
+ }))
+ }
+ }
+ }
+ }
+}
+
+fn pending_deletion_summary(
+ base: &str,
+ user: &AdminUser,
+ scheduler: Option<&AdminUser>,
+) -> (String, Markup) {
+ let scheduler_name = match (user.deletion_scheduled_by.as_deref(), scheduler) {
+ (None, _) => "an unrecorded source".to_owned(),
+ (Some(id), _) if id == user.id => "the user".to_owned(),
+ (Some(_), Some(scheduler)) => scheduler.username.clone(),
+ (Some(id), None) => id.to_owned(),
+ };
+ let reason = user
+ .deletion_reason_code
+ .map_or_else(|| "no reason code".to_owned(), deletion_reason_label);
+ let due = user
+ .pending_deletion_at
+ .as_deref()
+ .map(format_admin_timestamp)
+ .unwrap_or_default();
+ let markup = html! {
+ dl class="mb-4 space-y-1 text-sm text-neutral-700" {
+ div {
+ dt class="inline font-medium" { "Scheduled by: " }
+ dd class="inline" {
+ @match user.deletion_scheduled_by.as_deref() {
+ Some(id) => {
+ a href={(base) "/users/" (id)} class="underline" { (scheduler_name) }
+ }
+ None => { (scheduler_name) }
+ }
+ @if let Some(at) = user.deletion_scheduled_at.as_deref() {
+ " on " (format_admin_timestamp(at))
+ }
+ }
+ }
+ div {
+ dt class="inline font-medium" { "Due: " }
+ dd class="inline" { (due) }
+ }
+ div {
+ dt class="inline font-medium" { "Reason: " }
+ dd class="inline" { (reason) }
+ }
+ @if let Some(public_reason) = &user.deletion_public_reason {
+ div {
+ dt class="inline font-medium" { "Public reason: " }
+ dd class="inline" { (public_reason) }
+ }
+ }
+ @if let Some(private_reason) = &user.deletion_audit_log_reason {
+ div {
+ dt class="inline font-medium" { "Private reason: " }
+ dd class="inline" { (private_reason) }
+ }
+ }
+ }
+ };
+ (
+ format!("Cancel {scheduler_name}'s deletion ({reason}, due {due})"),
+ markup,
+ )
+}
+
+fn deletion_card(
+ base: &str,
+ user: &AdminUser,
+ csrf_token: &str,
+ scheduler: Option<&AdminUser>,
+) -> Markup {
html! {
(card_with_header("Account Deletion", html! {
- @if user.pending_deletion_at.is_some() {
+ @if let Some(pending) = &user.pending_deletion_at {
+ @let (confirmation, summary) = pending_deletion_summary(base, user, scheduler);
+ (summary)
form method="post"
action={(base) "/users/" (user.id) "?action=cancel_deletion&tab=moderation"} {
(csrf_input(csrf_token))
- (form_actions(html! {
- (submit_button("Cancel Deletion"))
- }))
+ input type="hidden" name="expected_pending_deletion_at" value=(pending);
+ div class="space-y-3" {
+ (form_label("Private Reason"))
+ input type="text" name="private_reason" required
+ placeholder="Why this deletion is being cancelled (audit log)..."
+ class="block w-full rounded-md border border-neutral-300 \
+ px-3 py-2 text-sm shadow-sm \
+ focus:border-brand-primary focus:outline-none \
+ focus:ring-1 focus:ring-brand-primary";
+ (checkbox("notify_user", "true", "Email the user that the deletion was cancelled", false, true))
+ (checkbox("confirm", "true", &confirmation, false, true))
+ (form_actions(html! {
+ (danger_button("Cancel Deletion"))
+ }))
+ }
}
} @else {
form method="post"
@@ -153,11 +353,12 @@ fn deletion_card(base: &str, user: &AdminUser, csrf_token: &str) -> Markup {
focus:border-brand-primary focus:outline-none \
focus:ring-1 focus:ring-brand-primary";
(form_label("Reason"))
- select name="reason_code"
+ select name="reason_code" required
class="block w-full rounded-md border border-neutral-300 \
px-3 py-2 text-sm shadow-sm \
focus:border-brand-primary focus:outline-none \
focus:ring-1 focus:ring-brand-primary" {
+ option value="" disabled selected { "Choose a reason" }
@for &(value, label) in DELETION_REASONS {
option value=(value) { (label) }
}
@@ -513,3 +714,112 @@ const MESSAGE_SHRED_FORM_SCRIPT: &str = r#"
});
})();
"#;
+
+#[cfg(test)]
+mod tests {
+ use super::*;
+ use serde_json::{Value, json};
+
+ fn user(extra: Value) -> AdminUser {
+ let mut value =
+ json!({"id": "1500000000000000001", "username": "target", "discriminator": "0001"});
+ if let (Some(target), Some(fields)) = (value.as_object_mut(), extra.as_object()) {
+ target.extend(fields.clone());
+ }
+ serde_json::from_value(value).expect("valid admin user")
+ }
+
+ fn entry(log_id: &str, action: &str, reason: &str, metadata: Value) -> AuditLogEntry {
+ serde_json::from_value(json!({
+ "log_id": log_id,
+ "admin_user_id": "1400000000000000001",
+ "admin_user": {"id": "1400000000000000001", "username": "lilith", "discriminator": "0001", "global_name": null},
+ "action": action,
+ "target_id": "1500000000000000001",
+ "target_type": "user",
+ "audit_log_reason": reason,
+ "metadata": metadata,
+ "created_at": "2026-09-01T10:00:00.000Z"
+ }))
+ .expect("valid audit log entry")
+ }
+
+ #[test]
+ fn pending_deletion_card_names_the_scheduler_and_the_deletion_it_cancels() {
+ let target = user(json!({
+ "pending_deletion_at": "2026-10-30T17:40:29.690Z",
+ "deletion_reason_code": 3,
+ "deletion_public_reason": "Spam",
+ "deletion_audit_log_reason": "Report batch 12",
+ "deletion_scheduled_by": "1400000000000000001",
+ "deletion_scheduled_at": "2026-08-31T17:40:29.690Z"
+ }));
+ let scheduler = user(json!({"id": "1400000000000000001", "username": "lilith"}));
+ let markup = deletion_card("/admin", &target, "csrf", Some(&scheduler)).into_string();
+ assert!(markup.contains(r#"href="/admin/users/1400000000000000001""#));
+ assert!(markup.contains("lilith"));
+ assert!(markup.contains("Report batch 12"));
+ assert!(
+ markup.contains(
+ r#"name="expected_pending_deletion_at" value="2026-10-30T17:40:29.690Z""#
+ )
+ );
+ assert!(markup.contains(r#"name="notify_user" value="true""#));
+ assert!(!markup.contains(r#"name="notify_user" value="true" checked"#));
+ assert!(markup.contains("Cancel lilith's deletion (Spam, due"));
+ assert!(markup.contains(r#"name="private_reason" required"#));
+ }
+
+ #[test]
+ fn schedule_form_makes_the_reason_an_explicit_choice() {
+ let markup = deletion_card("/admin", &user(json!({})), "csrf", None).into_string();
+ assert!(markup.contains(r#"<option value="" disabled selected>Choose a reason</option>"#));
+ assert!(!markup.contains(r#"<option value="1" selected>"#));
+ assert!(!markup.contains("replace_pending_deletion_at"));
+ }
+
+ #[test]
+ fn current_ban_is_the_entry_matching_the_ban_end_and_notes_attach_to_it() {
+ let target = user(json!({"temp_banned_until": "2026-10-01T00:00:00.000Z"}));
+ let logs = vec![
+ entry(
+ "3",
+ "annotate_ban",
+ "Also sent links",
+ json!({"ban_audit_log_id": "2"}),
+ ),
+ entry(
+ "2",
+ "temp_ban",
+ "Regel § 3",
+ json!({"banned_until": "2026-10-01T00:00:00.000Z"}),
+ ),
+ entry(
+ "1",
+ "temp_ban",
+ "Older ban",
+ json!({"banned_until": "2026-01-01T00:00:00.000Z"}),
+ ),
+ entry(
+ "4",
+ "annotate_ban",
+ "Old note",
+ json!({"ban_audit_log_id": "1"}),
+ ),
+ ];
+ let ban = find_current_ban(&target, &logs).expect("current ban");
+ assert_eq!(ban.entry.log_id, "2");
+ assert_eq!(
+ ban.notes
+ .iter()
+ .map(|note| note.log_id.as_str())
+ .collect::<Vec<_>>(),
+ ["3"]
+ );
+ let markup = ban_actions_card("/admin", &target, "csrf", Some(&ban)).into_string();
+ assert!(markup.contains("Regel § 3"));
+ assert!(markup.contains("Also sent links"));
+ assert!(markup.contains(r#"name="ban_audit_log_id" value="2""#));
+ assert!(markup.contains("?action=annotate_ban&amp;tab=moderation"));
+ }
+}
diff --git a/fluxer_admin/src/templates/pages/user_detail_tabs/overview.rs b/fluxer_admin/src/templates/pages/user_detail_tabs/overview.rs
index e08d72db3..f43a23b4e 100644
--- a/fluxer_admin/src/templates/pages/user_detail_tabs/overview.rs
+++ b/fluxer_admin/src/templates/pages/user_detail_tabs/overview.rs
@@ -9,7 +9,10 @@ use crate::{
form::{checkbox, csrf_input, form_actions, submit_button},
page_container::{card_with_header, detail_row},
},
- utils::{bigint::format_discriminator, timestamps::snowflake_creation_date},
+ utils::{
+ bigint::format_discriminator,
+ timestamps::{format_admin_timestamp, snowflake_creation_date},
+ },
};
use maud::{Markup, html};
@@ -70,6 +73,22 @@ fn render_overview_tab(
@if let Some(reason) = &user.deletion_public_reason {
div class="mt-1" { "Public reason: " (reason) }
}
+ @if let Some(reason) = &user.deletion_audit_log_reason {
+ div class="mt-1" { "Private reason: " (reason) }
+ }
+ div class="mt-1" {
+ "Scheduled by "
+ @match user.deletion_scheduled_by.as_deref() {
+ Some(id) if id == user.id => { "the user" }
+ Some(id) => {
+ a href={(config.base_path) "/users/" (id)} class="underline" { (id) }
+ }
+ None => { "an unrecorded source" }
+ }
+ @if let Some(at) = user.deletion_scheduled_at.as_deref() {
+ " on " (format_admin_timestamp(at))
+ }
+ }
}
}
}
@@ -293,7 +312,7 @@ fn flags_card(
))
@if user.phone_verification_deferred {
p class="text-sm text-amber-700 dark:text-amber-400" {
- "Phone verification is deferred: the requirement above is stored but not enforced until this user joins a discoverable or large community within the deferral window."
+ "Phone verification is deferred: the requirement above is stored but not enforced."
}
}
}
diff --git a/fluxer_admin/tests/api_deserialization.rs b/fluxer_admin/tests/api_deserialization.rs
index bbea1ae66..1c4b426ee 100644
--- a/fluxer_admin/tests/api_deserialization.rs
+++ b/fluxer_admin/tests/api_deserialization.rs
@@ -37,6 +37,9 @@ fn deserialize_admin_users_me_response() {
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"acls": ["super_admin"],
"traits": ["beta_tester"],
"has_totp": true,
@@ -81,7 +84,8 @@ fn deserialize_flags_as_string_and_number() {
"premium_grace_ends_at": null, "premium_lifetime_sequence": null,
"suspicious_activity_flags": 0, "temp_banned_until": null,
"pending_deletion_at": null, "pending_bulk_message_deletion_at": null,
- "deletion_reason_code": null, "deletion_public_reason": null,
+ "deletion_reason_code": null, "deletion_public_reason": null, "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null, "deletion_scheduled_at": null,
"acls": [], "traits": [], "has_totp": false, "authenticator_types": [],
"last_active_at": null, "last_active_ip": null,
"last_active_ip_reverse": null, "last_active_location": null
@@ -113,7 +117,8 @@ fn deserialize_discriminator_int_and_string() {
"premium_lifetime_sequence": null, "suspicious_activity_flags": 0,
"temp_banned_until": null, "pending_deletion_at": null,
"pending_bulk_message_deletion_at": null, "deletion_reason_code": null,
- "deletion_public_reason": null, "acls": [], "traits": [],
+ "deletion_public_reason": null, "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null, "deletion_scheduled_at": null, "acls": [], "traits": [],
"has_totp": false, "authenticator_types": [],
"last_active_at": null, "last_active_ip": null,
"last_active_ip_reverse": null, "last_active_location": null
@@ -170,6 +175,9 @@ fn deserialize_search_users_response() {
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"acls": [],
"traits": [],
"has_totp": false,
@@ -484,12 +492,7 @@ fn deserialize_instance_config_response_with_unknown_keys() {
"youtube_enabled": true,
"bluesky_enabled": false
},
- "services_available": {"gif": true, "youtube": true, "bluesky": false},
- "deferred_phone_gate": {
- "enabled": false,
- "window_hours": 24,
- "member_threshold": 100
- }
+ "services_available": {"gif": true, "youtube": true, "bluesky": false}
},
"integrations": {
"gif": {"klipy_api_key_set": true, "effective_available": true},
@@ -899,7 +902,8 @@ fn deserialize_user_mutation_response() {
"premium_grace_ends_at": null, "premium_lifetime_sequence": null,
"suspicious_activity_flags": 0, "temp_banned_until": null,
"pending_deletion_at": null, "pending_bulk_message_deletion_at": null,
- "deletion_reason_code": null, "deletion_public_reason": null,
+ "deletion_reason_code": null, "deletion_public_reason": null, "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null, "deletion_scheduled_at": null,
"acls": [], "traits": [], "has_totp": false, "authenticator_types": [],
"last_active_at": null, "last_active_ip": null,
"last_active_ip_reverse": null, "last_active_location": null
diff --git a/fluxer_admin/tests/csrf_legacy_cookie.rs b/fluxer_admin/tests/csrf_legacy_cookie.rs
index 4f9158b0d..0af0fb5ec 100644
--- a/fluxer_admin/tests/csrf_legacy_cookie.rs
+++ b/fluxer_admin/tests/csrf_legacy_cookie.rs
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+#![recursion_limit = "256"]
+
use axum::{
Json, Router,
body::{Body, to_bytes},
@@ -273,6 +275,9 @@ fn admin_user() -> Value {
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"last_active_at": null,
"last_active_ip": null,
"last_active_ip_reverse": null,
diff --git a/fluxer_admin/tests/htmx_acceptance.rs b/fluxer_admin/tests/htmx_acceptance.rs
index f91d39811..b279f0be2 100644
--- a/fluxer_admin/tests/htmx_acceptance.rs
+++ b/fluxer_admin/tests/htmx_acceptance.rs
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+#![recursion_limit = "256"]
+
use axum::{
Json, Router,
body::{Body, to_bytes},
@@ -954,6 +956,9 @@ fn user(id: &str, username: &str) -> Value {
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"last_active_at": null,
"last_active_ip": null,
"last_active_ip_reverse": null,
diff --git a/fluxer_admin/tests/parity/fixtures/api/admin_user_me.json b/fluxer_admin/tests/parity/fixtures/api/admin_user_me.json
index 2416dbd43..c2aa3c01f 100644
--- a/fluxer_admin/tests/parity/fixtures/api/admin_user_me.json
+++ b/fluxer_admin/tests/parity/fixtures/api/admin_user_me.json
@@ -31,6 +31,9 @@
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"acls": ["*"],
"traits": [],
"has_totp": true,
diff --git a/fluxer_admin/tests/parity/fixtures/api/lookup_user.json b/fluxer_admin/tests/parity/fixtures/api/lookup_user.json
index 214cac527..7796d0142 100644
--- a/fluxer_admin/tests/parity/fixtures/api/lookup_user.json
+++ b/fluxer_admin/tests/parity/fixtures/api/lookup_user.json
@@ -32,6 +32,9 @@
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"acls": [],
"traits": [],
"has_totp": false,
diff --git a/fluxer_admin/tests/parity/fixtures/api/search_users.json b/fluxer_admin/tests/parity/fixtures/api/search_users.json
index 004ee4fd7..245a9a58f 100644
--- a/fluxer_admin/tests/parity/fixtures/api/search_users.json
+++ b/fluxer_admin/tests/parity/fixtures/api/search_users.json
@@ -32,6 +32,9 @@
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"acls": [],
"traits": [],
"has_totp": false,
diff --git a/fluxer_admin/tests/voice_restriction_writes.rs b/fluxer_admin/tests/voice_restriction_writes.rs
index 6280db981..06958d0a3 100644
--- a/fluxer_admin/tests/voice_restriction_writes.rs
+++ b/fluxer_admin/tests/voice_restriction_writes.rs
@@ -1,5 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+#![recursion_limit = "256"]
+
use axum::{
Json, Router,
body::{Body, to_bytes},
@@ -302,6 +304,9 @@ fn admin_user() -> Value {
"pending_bulk_message_deletion_at": null,
"deletion_reason_code": null,
"deletion_public_reason": null,
+ "deletion_audit_log_reason": null,
+ "deletion_scheduled_by": null,
+ "deletion_scheduled_at": null,
"last_active_at": null,
"last_active_ip": null,
"last_active_ip_reverse": null,
diff --git a/fluxer_api/package.json b/fluxer_api/package.json
index 2536f9e23..d6f31247a 100644
--- a/fluxer_api/package.json
+++ b/fluxer_api/package.json
@@ -50,7 +50,6 @@
"@pkgs/nats": "workspace:*",
"@pkgs/postgres": "workspace:*",
"@pkgs/rate_limit": "workspace:*",
- "@pkgs/sms": "workspace:*",
"@pkgs/virus_scan": "workspace:*",
"@pkgs/worker": "workspace:*",
"@simplewebauthn/server": "catalog:",
diff --git a/fluxer_api/pkgs/geoip/src/CassandraIpInfoRequestAudit.ts b/fluxer_api/pkgs/geoip/src/CassandraIpInfoRequestAudit.ts
index 5916076b1..f20efbc90 100644
--- a/fluxer_api/pkgs/geoip/src/CassandraIpInfoRequestAudit.ts
+++ b/fluxer_api/pkgs/geoip/src/CassandraIpInfoRequestAudit.ts
@@ -85,7 +85,7 @@ export function createCassandraIpInfoRequestAuditLogger(
http_status: event.httpStatus,
outcome: event.outcome,
available: event.available,
- risk_note: event.riskNote,
+ risk_note: event.note,
latency_ms: event.latencyMs,
response_ip: event.responseIp,
country_code: event.countryCode,
diff --git a/fluxer_api/pkgs/geoip/src/GeoipLookup.ts b/fluxer_api/pkgs/geoip/src/GeoipLookup.ts
index 223bcfe1a..cbf24c0b4 100644
--- a/fluxer_api/pkgs/geoip/src/GeoipLookup.ts
+++ b/fluxer_api/pkgs/geoip/src/GeoipLookup.ts
@@ -2,7 +2,7 @@
import {getRegionDisplayName} from '@fluxer/geo_utils/src/RegionFormatting';
import {getSameIpDecisionKey, isValidIp, normalizeIpString} from '@fluxer/ip_utils/src/IpAddress';
-import maxmind, {type AsnResponse, type CityResponse, type Reader} from 'maxmind';
+import maxmind, {type CityResponse, type Reader} from 'maxmind';
export interface GeoipResult {
countryCode: string | null;
@@ -17,33 +17,17 @@ export interface GeoipResult {
timeZone?: string | null;
}
-export interface GeoipAsnResult {
- normalizedIp: string | null;
- asn: number | null;
- asnOrg: string | null;
- available: boolean;
-}
-
type CacheEntry = {
result: GeoipResult;
expiresAt: number;
};
-type AsnCacheEntry = {
- result: GeoipAsnResult;
- expiresAt: number;
-};
-
const CACHE_TTL_MS = 10 * 60 * 1000;
const CACHE_MAX_ENTRIES = 10_000;
const geoipCache = new Map<string, CacheEntry>();
-const asnCache = new Map<string, AsnCacheEntry>();
let maxmindReader: Reader<CityResponse> | null = null;
let maxmindReaderPromise: Promise<Reader<CityResponse>> | null = null;
-let maxmindAsnReader: Reader<AsnResponse> | null = null;
-let maxmindAsnReaderPromise: Promise<Reader<AsnResponse>> | null = null;
-let maxmindAsnUnavailable = false;
function buildFallbackResult(normalizedIp: string): GeoipResult {
return {
@@ -60,15 +44,6 @@ function buildFallbackResult(normalizedIp: string): GeoipResult {
};
}
-function buildAsnFallbackResult(normalizedIp: string | null): GeoipAsnResult {
- return {
- normalizedIp: normalizedIp || null,
- asn: null,
- asnOrg: null,
- available: false,
- };
-}
-
async function ensureReader(dbPath: string): Promise<Reader<CityResponse>> {
if (maxmindReader) return maxmindReader;
if (!maxmindReaderPromise) {
@@ -86,24 +61,6 @@ async function ensureReader(dbPath: string): Promise<Reader<CityResponse>> {
return maxmindReaderPromise;
}
-async function ensureAsnReader(dbPath: string): Promise<Reader<AsnResponse>> {
- if (maxmindAsnReader) return maxmindAsnReader;
- if (!maxmindAsnReaderPromise) {
- maxmindAsnReaderPromise = maxmind
- .open<AsnResponse>(dbPath, {watchForUpdates: true, watchForUpdatesNonPersistent: true})
- .then((reader) => {
- maxmindAsnReader = reader;
- return reader;
- })
- .catch((error) => {
- maxmindAsnReaderPromise = null;
- maxmindAsnUnavailable = true;
- throw error;
- });
- }
- return maxmindAsnReaderPromise;
-}
-
function stateLabel(record?: CityResponse): string | null {
const subdivision = record?.subdivisions?.[0];
if (!subdivision) return null;
@@ -157,31 +114,6 @@ function setCachedGeoipResult(cacheKey: string, result: GeoipResult): void {
geoipCache.set(cacheKey, {result, expiresAt: Date.now() + CACHE_TTL_MS});
}
-function getCachedAsnResult(cacheKey: string, normalizedIp: string): GeoipAsnResult | null {
- const cached = asnCache.get(cacheKey);
- if (!cached) {
- return null;
- }
- if (Date.now() >= cached.expiresAt) {
- asnCache.delete(cacheKey);
- return null;
- }
- asnCache.delete(cacheKey);
- asnCache.set(cacheKey, cached);
- return {...cached.result, normalizedIp};
-}
-
-function setCachedAsnResult(cacheKey: string, result: GeoipAsnResult): void {
- asnCache.delete(cacheKey);
- if (asnCache.size >= CACHE_MAX_ENTRIES) {
- const oldestKey = asnCache.keys().next().value;
- if (oldestKey !== undefined) {
- asnCache.delete(oldestKey);
- }
- }
- asnCache.set(cacheKey, {result, expiresAt: Date.now() + CACHE_TTL_MS});
-}
-
async function lookupMaxmind(clean: string, dbPath: string): Promise<GeoipResult> {
try {
const reader = await ensureReader(dbPath);
@@ -206,24 +138,6 @@ async function lookupMaxmind(clean: string, dbPath: string): Promise<GeoipResult
}
}
-async function lookupMaxmindAsn(clean: string, dbPath: string): Promise<GeoipAsnResult> {
- try {
- const reader = await ensureAsnReader(dbPath);
- const record = reader.get(clean);
- if (!record) {
- return {normalizedIp: clean, asn: null, asnOrg: null, available: true};
- }
- return {
- normalizedIp: clean,
- asn: record.autonomous_system_number ?? null,
- asnOrg: record.autonomous_system_organization ?? null,
- available: true,
- };
- } catch {
- return buildAsnFallbackResult(clean);
- }
-}
-
async function resolveGeoip(clean: string, dbPath: string): Promise<GeoipResult> {
const cacheKey = getSameIpDecisionKey(clean) ?? clean;
const cached = getCachedGeoipResult(cacheKey, clean);
@@ -235,17 +149,6 @@ async function resolveGeoip(clean: string, dbPath: string): Promise<GeoipResult>
return result;
}
-async function resolveAsn(clean: string, dbPath: string): Promise<GeoipAsnResult> {
- const cacheKey = getSameIpDecisionKey(clean) ?? clean;
- const cached = getCachedAsnResult(cacheKey, clean);
- if (cached) {
- return cached;
- }
- const result = await lookupMaxmindAsn(clean, dbPath);
- setCachedAsnResult(cacheKey, result);
- return result;
-}
-
export async function lookupGeoipByIp(ip: string, dbPath: string | undefined): Promise<GeoipResult> {
if (!dbPath) {
return buildFallbackResult(ip);
@@ -257,25 +160,10 @@ export async function lookupGeoipByIp(ip: string, dbPath: string | undefined): P
return resolveGeoip(clean, dbPath);
}
-export async function lookupAsnByIp(ip: string, asnDbPath: string | undefined): Promise<GeoipAsnResult> {
- if (!asnDbPath || maxmindAsnUnavailable) {
- return buildAsnFallbackResult(null);
- }
- const clean = normalizeIpString(ip);
- if (!isValidIp(clean)) {
- return buildAsnFallbackResult(clean);
- }
- return resolveAsn(clean, asnDbPath);
-}
-
export function resetGeoipReadersForTesting(): void {
maxmindReader = null;
maxmindReaderPromise = null;
- maxmindAsnReader = null;
- maxmindAsnReaderPromise = null;
- maxmindAsnUnavailable = false;
geoipCache.clear();
- asnCache.clear();
}
export function formatGeoipLocation(result: GeoipResult, locale?: string | null): string | null {
diff --git a/fluxer_api/pkgs/geoip/src/GeoipStartup.ts b/fluxer_api/pkgs/geoip/src/GeoipStartup.ts
index 61129625c..349a078ea 100644
--- a/fluxer_api/pkgs/geoip/src/GeoipStartup.ts
+++ b/fluxer_api/pkgs/geoip/src/GeoipStartup.ts
@@ -9,26 +9,20 @@ import {pipeline} from 'node:stream/promises';
import {GetObjectCommand, S3Client} from '@aws-sdk/client-s3';
const GEOIP_DOWNLOAD_PATH_QUERY_PARAM = 'download_path';
-const GEOIP_ASN_DOWNLOAD_PATH_QUERY_PARAM = 'asn_download_path';
-const GEOIP_ASN_KEY_QUERY_PARAM = 'asn_key';
const DEFAULT_GEOIP_TEMPORARY_DIRECTORY = '/tmp/fluxer/geoip';
-const DEFAULT_GEOIP_ASN_DB_BASENAME = 'GeoLite2-ASN.mmdb';
type GeoipSourceMode = 'filesystem' | 's3';
interface GeoipFilesystemSourceConfig {
mode: 'filesystem';
maxmindDbPath?: string;
- maxmindAsnDbPath?: string;
}
interface GeoipS3SourceConfig {
mode: 's3';
maxmindDbPath: string;
- maxmindAsnDbPath?: string;
s3Bucket: string;
s3Key: string;
- s3AsnKey?: string;
}
type GeoipSourceConfig = GeoipFilesystemSourceConfig | GeoipS3SourceConfig;
@@ -50,7 +44,6 @@ interface GeoipStartupResult {
mode: GeoipSourceMode;
downloaded: boolean;
city?: GeoipDownloadedDatabase;
- asn?: GeoipDownloadedDatabase;
maxmindDbPath?: string;
bucket?: string;
key?: string;
@@ -83,14 +76,9 @@ export function resolveGeoipRuntimeSourceConfig(
const temporaryDirectory = options.temporaryDirectory ?? DEFAULT_GEOIP_TEMPORARY_DIRECTORY;
requireGeoipRuntimePathOptions(options.serviceName, temporaryDirectory);
const serviceDir = path.join(temporaryDirectory, options.serviceName);
- const resolvedCityPath = path.join(serviceDir, path.basename(sourceConfig.maxmindDbPath));
- const resolvedAsnPath = sourceConfig.s3AsnKey
- ? path.join(serviceDir, path.basename(sourceConfig.maxmindAsnDbPath ?? sourceConfig.s3AsnKey))
- : sourceConfig.maxmindAsnDbPath;
return {
...sourceConfig,
- maxmindDbPath: resolvedCityPath,
- maxmindAsnDbPath: resolvedAsnPath,
+ maxmindDbPath: path.join(serviceDir, path.basename(sourceConfig.maxmindDbPath)),
};
}
@@ -112,9 +100,6 @@ async function ensureS3Startup(
): Promise<GeoipStartupResult> {
const resolvedS3Config = requireGeoipS3ConnectionConfig(s3Config);
await fs.mkdir(path.dirname(geoip.maxmindDbPath), {recursive: true});
- if (geoip.maxmindAsnDbPath) {
- await fs.mkdir(path.dirname(geoip.maxmindAsnDbPath), {recursive: true});
- }
const client = new S3Client({
endpoint: resolvedS3Config.endpoint,
region: resolvedS3Config.region,
@@ -128,15 +113,10 @@ async function ensureS3Startup(
});
try {
const city = await downloadS3Object(client, geoip.s3Bucket, geoip.s3Key, geoip.maxmindDbPath);
- let asn: GeoipDownloadedDatabase | undefined;
- if (geoip.s3AsnKey && geoip.maxmindAsnDbPath) {
- asn = await downloadS3Object(client, geoip.s3Bucket, geoip.s3AsnKey, geoip.maxmindAsnDbPath);
- }
return {
mode: 's3',
downloaded: true,
city,
- asn,
maxmindDbPath: geoip.maxmindDbPath,
bucket: geoip.s3Bucket,
key: geoip.s3Key,
@@ -168,11 +148,9 @@ async function downloadS3Object(
}
function createGeoipFilesystemSourceConfig(rawValue: string | undefined): GeoipFilesystemSourceConfig {
- const maxmindDbPath = rawValue === '' ? undefined : rawValue;
return {
mode: 'filesystem',
- maxmindDbPath,
- maxmindAsnDbPath: maxmindDbPath ? path.join(path.dirname(maxmindDbPath), DEFAULT_GEOIP_ASN_DB_BASENAME) : undefined,
+ maxmindDbPath: rawValue === '' ? undefined : rawValue,
};
}
@@ -186,15 +164,11 @@ function parseGeoipS3SourceConfig(rawValue: string): GeoipS3SourceConfig {
if (!s3Key) {
throw new Error(`Invalid GeoIP S3 URL (missing object key): ${rawValue}`);
}
- const maxmindDbPath = resolveGeoipDownloadPath(sourceUrl, rawValue);
- const {s3AsnKey, maxmindAsnDbPath} = resolveGeoipAsnPaths(sourceUrl, maxmindDbPath, rawValue);
return {
mode: 's3',
- maxmindDbPath,
- maxmindAsnDbPath,
+ maxmindDbPath: resolveGeoipDownloadPath(sourceUrl, rawValue),
s3Bucket,
s3Key,
- s3AsnKey,
};
}
@@ -211,26 +185,6 @@ function resolveGeoipDownloadPath(sourceUrl: URL, rawValue: string): string {
return configuredDownloadPath;
}
-function resolveGeoipAsnPaths(
- sourceUrl: URL,
- cityDownloadPath: string,
- rawValue: string,
-): {
- s3AsnKey?: string;
- maxmindAsnDbPath?: string;
-} {
- const asnKey = sourceUrl.searchParams.get(GEOIP_ASN_KEY_QUERY_PARAM) ?? undefined;
- if (!asnKey) return {};
- const explicitAsnDownloadPath = sourceUrl.searchParams.get(GEOIP_ASN_DOWNLOAD_PATH_QUERY_PARAM);
- if (explicitAsnDownloadPath && !path.isAbsolute(explicitAsnDownloadPath)) {
- throw new Error(
- `GeoIP S3 URL query parameter "${GEOIP_ASN_DOWNLOAD_PATH_QUERY_PARAM}" must be an absolute path: ${rawValue}`,
- );
- }
- const maxmindAsnDbPath = explicitAsnDownloadPath ?? path.join(path.dirname(cityDownloadPath), path.basename(asnKey));
- return {s3AsnKey: asnKey, maxmindAsnDbPath};
-}
-
function requireGeoipS3ConnectionConfig(s3Config: GeoipS3ConnectionConfig | undefined): GeoipS3ConnectionConfig {
if (!s3Config) {
throw new Error('GeoIP is configured for S3 mode, but S3 configuration is missing.');
diff --git a/fluxer_api/pkgs/geoip/src/IpInfoService.ts b/fluxer_api/pkgs/geoip/src/IpInfoService.ts
index ae16d8ac7..f581355b2 100644
--- a/fluxer_api/pkgs/geoip/src/IpInfoService.ts
+++ b/fluxer_api/pkgs/geoip/src/IpInfoService.ts
@@ -13,7 +13,6 @@ const FAILURE_TTL_REQUEST_FAILED_SECONDS = 60;
const FAILURE_TTL_HTTP_ERROR_SECONDS = 300;
const FAILURE_TTL_QUOTA_SECONDS = 900;
const FAILURE_TTL_SCHEMA_MISMATCH_SECONDS = 600;
-const FAILURE_TTL_BACKGROUND_CAP_SECONDS = 120;
export interface IpInfoGeoBlock {
countryCode: string | null;
@@ -65,7 +64,7 @@ export interface IpInfoFlags {
export interface IpInfoLookupResult {
ip: string;
available: boolean;
- riskNote: string;
+ note: string;
geo: IpInfoGeoBlock;
asn: IpInfoAsnBlock;
mobile: IpInfoMobileBlock;
@@ -78,12 +77,6 @@ export interface IpInfoCache {
set<T>(key: string, value: T, ttlSeconds?: number): Promise<void>;
}
-export type IpInfoLookupPriority = 'critical' | 'standard' | 'background';
-
-export interface IpInfoLookupBudget {
- tryConsume(priority: IpInfoLookupPriority): Promise<boolean>;
-}
-
export interface CachedIpInfoFailure extends IpInfoLookupResult {
cachedFailure: true;
failureOutcome: 'http_error' | 'request_failed' | 'schema_mismatch';
@@ -91,26 +84,15 @@ export interface CachedIpInfoFailure extends IpInfoLookupResult {
cachedAtMs: number;
}
-export function resolveIpInfoLookupPriority(source: string | undefined): IpInfoLookupPriority {
- if (source === 'admin.ip_ban' || source === 'admin.scheduled_deletion_suspicious_ip') return 'critical';
- if (source === 'AbusiveIpAutoBanner') return 'background';
- return 'standard';
-}
-
export function isCachedIpInfoFailure(value: unknown): value is CachedIpInfoFailure {
return typeof value === 'object' && value !== null && (value as {available?: unknown}).available === false;
}
-function failureCacheTtlSeconds(
- outcome: CachedIpInfoFailure['failureOutcome'],
- httpStatus: number | null,
- priority: IpInfoLookupPriority,
-): number {
- let ttl = FAILURE_TTL_HTTP_ERROR_SECONDS;
- if (outcome === 'request_failed') ttl = FAILURE_TTL_REQUEST_FAILED_SECONDS;
- else if (outcome === 'schema_mismatch') ttl = FAILURE_TTL_SCHEMA_MISMATCH_SECONDS;
- else if (httpStatus === 402 || httpStatus === 403 || httpStatus === 429) ttl = FAILURE_TTL_QUOTA_SECONDS;
- return priority === 'background' ? Math.min(ttl, FAILURE_TTL_BACKGROUND_CAP_SECONDS) : ttl;
+function failureCacheTtlSeconds(outcome: CachedIpInfoFailure['failureOutcome'], httpStatus: number | null): number {
+ if (outcome === 'request_failed') return FAILURE_TTL_REQUEST_FAILED_SECONDS;
+ if (outcome === 'schema_mismatch') return FAILURE_TTL_SCHEMA_MISMATCH_SECONDS;
+ if (httpStatus === 402 || httpStatus === 403 || httpStatus === 429) return FAILURE_TTL_QUOTA_SECONDS;
+ return FAILURE_TTL_HTTP_ERROR_SECONDS;
}
export interface IpInfoLookupContext {
@@ -126,10 +108,10 @@ export interface IpInfoRequestAuditEvent {
source: string;
reason: string | null;
metadata?: Record<string, string | number | boolean | null>;
- outcome: 'http_success' | 'http_error' | 'request_failed' | 'schema_mismatch' | 'budget_shed';
+ outcome: 'http_success' | 'http_error' | 'request_failed' | 'schema_mismatch';
httpStatus: number | null;
available: boolean;
- riskNote: string;
+ note: string;
latencyMs: number;
requestUrl: string;
responseIp: string | null;
@@ -150,7 +132,6 @@ interface IpInfoServiceContext {
apiKey: string;
cache: IpInfoCache;
auditLogger?: IpInfoRequestAuditLogger;
- budget?: IpInfoLookupBudget;
}
export interface IpInfoService {
@@ -218,11 +199,10 @@ export function createIpInfoService(ctx: IpInfoServiceContext): IpInfoService {
return {
async lookup(ip: string, context?: IpInfoLookupContext): Promise<IpInfoLookupResult> {
const cacheKey = `${CACHE_KEY_PREFIX}${getSameIpDecisionKey(ip) ?? ip}`;
- const priority = resolveIpInfoLookupPriority(context?.source);
const cached = await ctx.cache.get<IpInfoLookupResult>(cacheKey);
if (cached !== null) {
if (isCachedIpInfoFailure(cached)) {
- return unavailable(ip, cached.riskNote);
+ return unavailable(ip, cached.note);
}
return {...cached, ip};
}
@@ -251,7 +231,7 @@ export function createIpInfoService(ctx: IpInfoServiceContext): IpInfoService {
outcome: params.outcome,
httpStatus: params.httpStatus,
available: params.result.available,
- riskNote: params.result.riskNote,
+ note: params.result.note,
latencyMs: Date.now() - startedAt,
requestUrl,
responseIp: params.result.available ? params.result.ip : null,
@@ -267,13 +247,6 @@ export function createIpInfoService(ctx: IpInfoServiceContext): IpInfoService {
return params.result;
};
const performLookup = async (): Promise<IpInfoLookupResult> => {
- if (ctx.budget && !(await ctx.budget.tryConsume(priority))) {
- return finalize({
- result: unavailable(ip, `IPInfo lookup shed (budget exhausted, priority: ${priority})`),
- outcome: 'budget_shed',
- httpStatus: null,
- });
- }
const finalizeFailure = async (params: {
result: IpInfoLookupResult;
outcome: CachedIpInfoFailure['failureOutcome'];
@@ -287,7 +260,7 @@ export function createIpInfoService(ctx: IpInfoServiceContext): IpInfoService {
cachedAtMs: Date.now(),
};
await ctx.cache
- .set(cacheKey, entry, failureCacheTtlSeconds(params.outcome, params.httpStatus, priority))
+ .set(cacheKey, entry, failureCacheTtlSeconds(params.outcome, params.httpStatus))
.catch(() => {});
return finalize(params);
};
@@ -361,7 +334,7 @@ function unavailable(ip: string, reason: string): IpInfoLookupResult {
return {
ip,
available: false,
- riskNote: reason,
+ note: reason,
geo: emptyGeo(),
asn: emptyAsn(),
mobile: emptyMobile(),
@@ -425,7 +398,7 @@ function parseIpInfoResponse(raw: RawIpInfoResponse): IpInfoLookupResult {
return {
ip: raw.ip,
available: true,
- riskNote: buildRiskNote(isAnonymous, anon),
+ note: describeAnonymity(isAnonymous, anon),
geo: {
countryCode: normalizeCountryCode(geo.country_code),
countryName: geo.country ?? null,
@@ -486,7 +459,7 @@ function parseAsnBlock(as: RawIpInfoResponse['as']): IpInfoAsnBlock {
};
}
-function buildRiskNote(isAnonymous: boolean, anon: RawIpInfoResponse['anonymous']): string {
+function describeAnonymity(isAnonymous: boolean, anon: RawIpInfoResponse['anonymous']): string {
if (!isAnonymous) {
return 'IPInfo: IP is not anonymous';
}
diff --git a/fluxer_api/pkgs/geoip/src/PostgresIpInfoKv.ts b/fluxer_api/pkgs/geoip/src/PostgresIpInfoKv.ts
index 759819f5c..19d65db69 100644
--- a/fluxer_api/pkgs/geoip/src/PostgresIpInfoKv.ts
+++ b/fluxer_api/pkgs/geoip/src/PostgresIpInfoKv.ts
@@ -118,7 +118,7 @@ export function createPostgresIpInfoRequestAuditLogger(options: PostgresIpInfoOp
http_status: event.httpStatus,
outcome: event.outcome,
available: event.available,
- risk_note: event.riskNote,
+ risk_note: event.note,
latency_ms: event.latencyMs,
response_ip: event.responseIp,
country_code: event.countryCode,
diff --git a/fluxer_api/pkgs/kv_client/src/IKVProvider.ts b/fluxer_api/pkgs/kv_client/src/IKVProvider.ts
index 82e774165..a29d4eca0 100644
--- a/fluxer_api/pkgs/kv_client/src/IKVProvider.ts
+++ b/fluxer_api/pkgs/kv_client/src/IKVProvider.ts
@@ -74,6 +74,8 @@ export interface IKVProvider {
rpush(key: string, ...values: Array<string>): Promise<number>;
lpop(key: string, count?: number): Promise<Array<string>>;
llen(key: string): Promise<number>;
+ lrange(key: string, start: number, stop: number): Promise<Array<string>>;
+ ltrim(key: string, start: number, stop: number): Promise<void>;
hset(key: string, field: string, value: string): Promise<number>;
hdel(key: string, ...fields: Array<string>): Promise<number>;
hget(key: string, field: string): Promise<string | null>;
diff --git a/fluxer_api/pkgs/kv_client/src/KVClient.ts b/fluxer_api/pkgs/kv_client/src/KVClient.ts
index 7fd1712bd..f77d5fad4 100644
--- a/fluxer_api/pkgs/kv_client/src/KVClient.ts
+++ b/fluxer_api/pkgs/kv_client/src/KVClient.ts
@@ -555,6 +555,14 @@ export class KVClient implements IKVProvider {
return await this.execute('llen', async () => this.client.llen(key));
}
+ async lrange(key: string, start: number, stop: number): Promise<Array<string>> {
+ return await this.execute('lrange', async () => this.client.lrange(key, start, stop));
+ }
+
+ async ltrim(key: string, start: number, stop: number): Promise<void> {
+ await this.execute('ltrim', async () => this.client.ltrim(key, start, stop));
+ }
+
async hset(key: string, field: string, value: string): Promise<number> {
return await this.execute('hset', async () => this.client.hset(key, field, value));
}
diff --git a/fluxer_api/pkgs/sms/package.json b/fluxer_api/pkgs/sms/package.json
deleted file mode 100644
index ff2b80833..000000000
--- a/fluxer_api/pkgs/sms/package.json
+++ /dev/null
@@ -1,24 +0,0 @@
-{
- "name": "@pkgs/sms",
- "version": "0.0.0",
- "private": true,
- "type": "module",
- "exports": {
- "./*": "./*"
- },
- "scripts": {
- "test": "vitest run",
- "test:watch": "vitest",
- "typecheck": "tsc --noEmit"
- },
- "dependencies": {
- "@fluxer/constants": "workspace:*",
- "@fluxer/errors": "workspace:*",
- "@fluxer/logger": "workspace:*"
- },
- "devDependencies": {
- "@types/node": "catalog:",
- "typescript": "catalog:ts7",
- "vitest": "catalog:"
- }
-}
diff --git a/fluxer_api/pkgs/sms/src/ISmsService.ts b/fluxer_api/pkgs/sms/src/ISmsService.ts
deleted file mode 100644
index a7c14e2eb..000000000
--- a/fluxer_api/pkgs/sms/src/ISmsService.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import type {SmsVerificationStartOptions, SmsVerificationStartResult} from '@pkgs/sms/src/SmsVerificationTypes';
-
-export interface ISmsService {
- startVerification(phone: string): Promise<void>;
- startVerificationWithResult(
- phone: string,
- options?: SmsVerificationStartOptions,
- ): Promise<SmsVerificationStartResult>;
- checkVerification(phone: string, code: string): Promise<boolean>;
- lookupPhone(phone: string): Promise<PhoneLookupResult | null>;
-}
diff --git a/fluxer_api/pkgs/sms/src/PhoneLookupTypes.ts b/fluxer_api/pkgs/sms/src/PhoneLookupTypes.ts
deleted file mode 100644
index 08c60a8d7..000000000
--- a/fluxer_api/pkgs/sms/src/PhoneLookupTypes.ts
+++ /dev/null
@@ -1,64 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-export type PhoneLineType =
- | 'mobile'
- | 'landline'
- | 'fixedVoip'
- | 'nonFixedVoip'
- | 'personal'
- | 'tollFree'
- | 'premium'
- | 'sharedCost'
- | 'uan'
- | 'voicemail'
- | 'pager'
- | 'unknown';
-
-export interface PhoneLookupResult {
- valid: boolean;
- lineType: PhoneLineType | null;
- countryCode: string | null;
- carrierName: string | null;
- smsPumpingRiskScore: number | null;
-}
-
-export const ACCEPTED_PHONE_LINE_TYPES: ReadonlySet<PhoneLineType> = new Set<PhoneLineType>(['mobile', 'personal']);
-export const VOIP_PHONE_LINE_TYPES: ReadonlySet<PhoneLineType> = new Set<PhoneLineType>(['fixedVoip', 'nonFixedVoip']);
-export const HARD_REJECT_PHONE_LINE_TYPES: ReadonlySet<PhoneLineType> = new Set<PhoneLineType>([
- 'landline',
- 'tollFree',
- 'premium',
- 'sharedCost',
- 'uan',
- 'voicemail',
- 'pager',
-]);
-const SMS_PUMPING_RISK_THRESHOLDS: Readonly<Record<string, number>> = {
- US: 100,
- CA: 100,
- GB: 70,
- DE: 70,
- FR: 70,
- IT: 70,
- ES: 70,
- NL: 70,
- SE: 70,
- NO: 70,
- DK: 70,
- FI: 70,
- AU: 70,
- NZ: 70,
- JP: 70,
- KR: 70,
- CH: 70,
- AT: 70,
- BE: 70,
- IE: 70,
- PT: 70,
-};
-const DEFAULT_SMS_PUMPING_RISK_THRESHOLD = 35;
-
-export function getSmsPumpingRiskThreshold(countryCode: string | null): number {
- if (countryCode === null) return DEFAULT_SMS_PUMPING_RISK_THRESHOLD;
- return SMS_PUMPING_RISK_THRESHOLDS[countryCode] ?? DEFAULT_SMS_PUMPING_RISK_THRESHOLD;
-}
diff --git a/fluxer_api/pkgs/sms/src/SmsService.ts b/fluxer_api/pkgs/sms/src/SmsService.ts
deleted file mode 100644
index d51aabfd2..000000000
--- a/fluxer_api/pkgs/sms/src/SmsService.ts
+++ /dev/null
@@ -1,34 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {ISmsService} from '@pkgs/sms/src/ISmsService';
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import type {ISmsProvider} from '@pkgs/sms/src/providers/ISmsProvider';
-import {UnavailableSmsProvider} from '@pkgs/sms/src/providers/UnavailableSmsProvider';
-import type {SmsVerificationStartOptions, SmsVerificationStartResult} from '@pkgs/sms/src/SmsVerificationTypes';
-
-export class SmsService implements ISmsService {
- private readonly provider: ISmsProvider;
-
- constructor(provider: ISmsProvider = new UnavailableSmsProvider()) {
- this.provider = provider;
- }
-
- async startVerification(phone: string): Promise<void> {
- await this.provider.startVerification(phone);
- }
-
- async startVerificationWithResult(
- phone: string,
- options?: SmsVerificationStartOptions,
- ): Promise<SmsVerificationStartResult> {
- return this.provider.startVerificationWithResult(phone, options);
- }
-
- async checkVerification(phone: string, code: string): Promise<boolean> {
- return this.provider.checkVerification(phone, code);
- }
-
- async lookupPhone(phone: string): Promise<PhoneLookupResult | null> {
- return this.provider.lookupPhone(phone);
- }
-}
diff --git a/fluxer_api/pkgs/sms/src/SmsVerificationTypes.ts b/fluxer_api/pkgs/sms/src/SmsVerificationTypes.ts
deleted file mode 100644
index 99e566b66..000000000
--- a/fluxer_api/pkgs/sms/src/SmsVerificationTypes.ts
+++ /dev/null
@@ -1,17 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-export type SmsVerificationStartChannel = 'sms' | 'auto';
-
-export interface SmsVerificationStartOptions {
- channel?: SmsVerificationStartChannel;
- deviceIp?: string;
- rateLimits?: Record<string, string>;
-}
-
-export interface SmsVerificationStartResult {
- channel: string;
-}
-
-export const SMS_VERIFICATION_START_SMS_RESULT: SmsVerificationStartResult = {
- channel: 'sms',
-};
diff --git a/fluxer_api/pkgs/sms/src/SmsVerificationUtils.ts b/fluxer_api/pkgs/sms/src/SmsVerificationUtils.ts
deleted file mode 100644
index 1a259c005..000000000
--- a/fluxer_api/pkgs/sms/src/SmsVerificationUtils.ts
+++ /dev/null
@@ -1,10 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {SMS_MASK_VISIBLE_PREFIX_LENGTH} from '@fluxer/constants/src/SmsVerificationConstants';
-
-export function maskPhoneNumber(phone: string): string {
- if (phone.length <= SMS_MASK_VISIBLE_PREFIX_LENGTH) {
- return `${phone}***`;
- }
- return `${phone.slice(0, SMS_MASK_VISIBLE_PREFIX_LENGTH)}***`;
-}
diff --git a/fluxer_api/pkgs/sms/src/__tests__/SmsService.test.ts b/fluxer_api/pkgs/sms/src/__tests__/SmsService.test.ts
deleted file mode 100644
index 01e703363..000000000
--- a/fluxer_api/pkgs/sms/src/__tests__/SmsService.test.ts
+++ /dev/null
@@ -1,100 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
-import {SmsVerificationUnavailableError} from '@fluxer/errors/src/domains/auth/SmsVerificationUnavailableError';
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import type {ISmsProvider} from '@pkgs/sms/src/providers/ISmsProvider';
-import {UnavailableSmsProvider} from '@pkgs/sms/src/providers/UnavailableSmsProvider';
-import {SmsService} from '@pkgs/sms/src/SmsService';
-import {SMS_VERIFICATION_START_SMS_RESULT, type SmsVerificationStartResult} from '@pkgs/sms/src/SmsVerificationTypes';
-import {describe, expect, it} from 'vitest';
-
-function createInMemoryProvider(): ISmsProvider & {
- verifications: Map<string, string>;
- startedVerifications: Array<string>;
-} {
- const verifications = new Map<string, string>();
- const startedVerifications: Array<string> = [];
- return {
- verifications,
- startedVerifications,
- async startVerification(phone: string): Promise<void> {
- startedVerifications.push(phone);
- verifications.set(phone, '123456');
- },
- async startVerificationWithResult(phone: string): Promise<SmsVerificationStartResult> {
- startedVerifications.push(phone);
- verifications.set(phone, '123456');
- return SMS_VERIFICATION_START_SMS_RESULT;
- },
- async checkVerification(phone: string, code: string): Promise<boolean> {
- const storedCode = verifications.get(phone);
- if (storedCode === code) {
- verifications.delete(phone);
- return true;
- }
- return false;
- },
- async lookupPhone(_phone: string): Promise<PhoneLookupResult | null> {
- return null;
- },
- };
-}
-
-describe('SmsService', () => {
- describe('with provider', () => {
- it('starts verification through provider', async () => {
- const provider = createInMemoryProvider();
- const service = new SmsService(provider);
- await service.startVerification('+15551234567');
- expect(provider.startedVerifications).toContain('+15551234567');
- expect(provider.verifications.has('+15551234567')).toBe(true);
- });
- it('checks verification through provider and returns true for valid code', async () => {
- const provider = createInMemoryProvider();
- const service = new SmsService(provider);
- await service.startVerification('+15551234567');
- const code = provider.verifications.get('+15551234567') ?? '';
- const result = await service.checkVerification('+15551234567', code);
- expect(result).toBe(true);
- });
- it('checks verification through provider and returns false for invalid code', async () => {
- const provider = createInMemoryProvider();
- const service = new SmsService(provider);
- await service.startVerification('+15551234567');
- const result = await service.checkVerification('+15551234567', 'wrong-code');
- expect(result).toBe(false);
- });
- it('returns false for verification check on non-existent phone', async () => {
- const provider = createInMemoryProvider();
- const service = new SmsService(provider);
- const result = await service.checkVerification('+15559999999', '123456');
- expect(result).toBe(false);
- });
- });
- describe('with unavailable provider', () => {
- it('silently completes startVerification when provider is unavailable', async () => {
- const service = new SmsService(new UnavailableSmsProvider());
- await expect(service.startVerification('+15551234567')).resolves.toBeUndefined();
- });
- it('throws SmsVerificationUnavailableError when checking verification', async () => {
- const service = new SmsService(new UnavailableSmsProvider());
- await expect(service.checkVerification('+15551234567', '123456')).rejects.toThrow(
- SmsVerificationUnavailableError,
- );
- });
- it('defaults to unavailable provider when no provider is injected', async () => {
- const service = new SmsService();
- await expect(service.checkVerification('+15551234567', '123456')).rejects.toThrow(
- SmsVerificationUnavailableError,
- );
- });
- it('exposes the correct api error code when checking verification', async () => {
- const service = new SmsService(new UnavailableSmsProvider());
- await expect(service.checkVerification('+15551234567', '123456')).rejects.toMatchObject({
- code: APIErrorCodes.SMS_VERIFICATION_UNAVAILABLE,
- message: APIErrorCodes.SMS_VERIFICATION_UNAVAILABLE,
- });
- });
- });
-});
diff --git a/fluxer_api/pkgs/sms/src/__tests__/TwilioSmsProvider.test.ts b/fluxer_api/pkgs/sms/src/__tests__/TwilioSmsProvider.test.ts
deleted file mode 100644
index de6500cff..000000000
--- a/fluxer_api/pkgs/sms/src/__tests__/TwilioSmsProvider.test.ts
+++ /dev/null
@@ -1,369 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {InvalidPhoneNumberError} from '@fluxer/errors/src/domains/auth/InvalidPhoneNumberError';
-import {SmsVerificationUnavailableError} from '@fluxer/errors/src/domains/auth/SmsVerificationUnavailableError';
-import {createMockLogger} from '@fluxer/logger/src/mock';
-import {TwilioSmsProvider, TwilioVerificationRateLimitError} from '@pkgs/sms/src/providers/TwilioSmsProvider';
-import {describe, expect, it} from 'vitest';
-
-interface TwilioRequest {
- url: string;
- authHeader: string;
- body: string;
-}
-
-interface TwilioLookupRequest {
- url: string;
- method: string | undefined;
- authHeader: string;
-}
-
-function getCapturedRequest(request: TwilioRequest | null): TwilioRequest {
- if (!request) {
- throw new Error('Expected Twilio request to be captured');
- }
- return request;
-}
-
-function getCapturedLookupRequest(request: TwilioLookupRequest | null): TwilioLookupRequest {
- if (!request) {
- throw new Error('Expected Twilio lookup request to be captured');
- }
- return request;
-}
-
-describe('TwilioSmsProvider', () => {
- it('calls Twilio Verify start endpoint with expected payload', async () => {
- let capturedRequest: TwilioRequest | null = null;
- const fetchStub: typeof fetch = async (_input, init) => {
- capturedRequest = {
- url: String(_input),
- authHeader: (init?.headers as Record<string, string>)?.Authorization,
- body: init?.body as string,
- };
- return new Response(JSON.stringify({success: true}), {status: 200});
- };
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: fetchStub,
- });
- const phone = '+15551234567';
- await provider.startVerification(phone);
- const request = getCapturedRequest(capturedRequest);
- expect(request.url).toBe('https://verify.twilio.com/v2/Services/VA123/Verifications');
- expect(request.authHeader).toBe(`Basic ${Buffer.from('AC123:twilio-secret').toString('base64')}`);
- expect(request.body).toContain('To=%2B15551234567');
- expect(request.body).toContain('Channel=sms');
- });
- it('can start verification with auto channel, device IP, and programmable rate limits', async () => {
- let capturedRequest: TwilioRequest | null = null;
- const fetchStub: typeof fetch = async (_input, init) => {
- capturedRequest = {
- url: String(_input),
- authHeader: (init?.headers as Record<string, string>)?.Authorization,
- body: init?.body as string,
- };
- return new Response(JSON.stringify({channel: 'auto'}), {status: 200});
- };
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: fetchStub,
- });
- const result = await provider.startVerificationWithResult('+15551234567', {
- channel: 'auto',
- deviceIp: '203.0.113.10',
- rateLimits: {
- fluxer_user_id: '123',
- fluxer_phone_prefix: '+1555',
- },
- });
- const request = getCapturedRequest(capturedRequest);
- expect(result).toEqual({channel: 'auto'});
- expect(request.body).toContain('Channel=auto');
- expect(request.body).toContain('DeviceIp=203.0.113.10');
- expect(request.body).toContain('RateLimits%5Bfluxer_user_id%5D=123');
- expect(request.body).toContain('RateLimits%5Bfluxer_phone_prefix%5D=%2B1555');
- });
- it('returns true when verification check is approved', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () => new Response(JSON.stringify({status: 'approved'}), {status: 200}),
- });
- const result = await provider.checkVerification('+15551234567', '123456');
- expect(result).toBe(true);
- });
- it('returns false when verification check is rejected', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () => new Response(JSON.stringify({status: 'pending'}), {status: 200}),
- });
- expect(await provider.checkVerification('+15551234567', '123456')).toBe(false);
- });
- it('throws InvalidPhoneNumberError for Twilio invalid phone code', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(JSON.stringify({code: 21211, message: 'Invalid To phone number'}), {status: 400}),
- });
- await expect(provider.startVerification('+15550000000')).rejects.toThrow(InvalidPhoneNumberError);
- });
- it('throws TwilioVerificationRateLimitError for Twilio max-send-attempt responses', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(JSON.stringify({code: 60203, message: 'Max send attempts reached'}), {status: 403}),
- });
- const error = await provider.startVerification('+15551234567').catch((err: unknown) => err);
- expect(error).toBeInstanceOf(TwilioVerificationRateLimitError);
- expect(error).toMatchObject({
- message: 'Too many verification texts were sent recently. Try again later.',
- twilioStatus: 403,
- twilioCode: 60203,
- cooldownScope: 'phone',
- cooldownMs: 600000,
- });
- });
- it('throws TwilioVerificationRateLimitError for Fraud Guard blocks', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(JSON.stringify({code: 60410, message: 'Blocked by Verify Fraud Guard'}), {status: 403}),
- });
- const error = await provider.startVerification('+15551234567').catch((err: unknown) => err);
- expect(error).toBeInstanceOf(TwilioVerificationRateLimitError);
- expect(error).toMatchObject({
- message: 'Phone verification is temporarily blocked for this destination. Try again later.',
- twilioStatus: 403,
- twilioCode: 60410,
- cooldownScope: 'phone',
- cooldownMs: 43200000,
- });
- });
- it('throws SmsVerificationUnavailableError for unexpected non-OK start responses', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () => new Response(JSON.stringify({code: 30001, message: 'Queue overflow'}), {status: 503}),
- });
- const error = await provider.startVerification('+15551234567').catch((err: unknown) => err);
- expect(error).toBeInstanceOf(SmsVerificationUnavailableError);
- });
- it('throws SmsVerificationUnavailableError when start verification request fails before a response', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () => {
- throw new TypeError('Failed to fetch');
- },
- });
- await expect(provider.startVerification('+15551234567')).rejects.toThrow(SmsVerificationUnavailableError);
- });
- it('throws TwilioVerificationRateLimitError for max verification-check attempts', async () => {
- const provider = new TwilioSmsProvider({
- config: {
- accountSid: 'AC123',
- authToken: 'twilio-secret',
- verifyServiceSid: 'VA123',
- },
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(JSON.stringify({code: 60202, message: 'Max check attempts reached'}), {status: 429}),
- });
- const error = await provider.checkVerification('+15551234567', '123456').catch((err: unknown) => err);
- expect(error).toBeInstanceOf(TwilioVerificationRateLimitError);
- expect(error).toMatchObject({
- message: 'Too many verification code checks were attempted. Request a new code later.',
- twilioStatus: 429,
- twilioCode: 60202,
- cooldownScope: 'phone',
- });
- });
- describe('lookupPhone', () => {
- const CONFIG = {accountSid: 'AC123', authToken: 'twilio-secret', verifyServiceSid: 'VA123'};
- it('sends a GET to Lookup v2 with Fields=line_type_intelligence and Basic auth', async () => {
- let capturedRequest: TwilioLookupRequest | null = null;
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async (input, init) => {
- capturedRequest = {
- url: String(input),
- method: init?.method,
- authHeader: (init?.headers as Record<string, string>)?.Authorization,
- };
- return new Response(
- JSON.stringify({
- valid: true,
- country_code: 'US',
- line_type_intelligence: {type: 'mobile', carrier_name: 'T-Mobile USA'},
- }),
- {status: 200},
- );
- },
- });
- const result = await provider.lookupPhone('+15551234567');
- const request = getCapturedLookupRequest(capturedRequest);
- expect(request.method).toBe('GET');
- expect(request.url).toBe(
- 'https://lookups.twilio.com/v2/PhoneNumbers/%2B15551234567?Fields=line_type_intelligence,sms_pumping_risk',
- );
- expect(request.authHeader).toBe(`Basic ${Buffer.from('AC123:twilio-secret').toString('base64')}`);
- expect(result).toEqual({
- valid: true,
- lineType: 'mobile',
- countryCode: 'US',
- carrierName: 'T-Mobile USA',
- smsPumpingRiskScore: null,
- });
- });
- it('returns nonFixedVoip for Twilio virtual-number responses', async () => {
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(
- JSON.stringify({
- valid: true,
- country_code: 'NL',
- line_type_intelligence: {type: 'nonFixedVoip', carrier_name: 'Twilio LLC'},
- }),
- {status: 200},
- ),
- });
- const result = await provider.lookupPhone('+3197058046509');
- expect(result?.valid).toBe(true);
- expect(result?.lineType).toBe('nonFixedVoip');
- });
- it('returns personal for +31970-style Dutch personal-number responses', async () => {
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(
- JSON.stringify({
- valid: true,
- country_code: 'NL',
- line_type_intelligence: {type: 'personal', carrier_name: null},
- }),
- {status: 200},
- ),
- });
- const result = await provider.lookupPhone('+31970123456');
- expect(result?.lineType).toBe('personal');
- });
- it('returns valid=false on 404 (phone not found)', async () => {
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async () => new Response('', {status: 404}),
- });
- const result = await provider.lookupPhone('+15550000000');
- expect(result).toEqual({
- valid: false,
- lineType: null,
- countryCode: null,
- carrierName: null,
- smsPumpingRiskScore: null,
- });
- });
- it('returns null (fail-closed trigger) on non-OK non-404 responses', async () => {
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(JSON.stringify({code: 20003, message: 'Authentication error'}), {status: 401}),
- });
- const result = await provider.lookupPhone('+15551234567');
- expect(result).toBeNull();
- });
- it('returns null on network failure', async () => {
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async () => {
- throw new TypeError('Failed to fetch');
- },
- });
- const result = await provider.lookupPhone('+15551234567');
- expect(result).toBeNull();
- });
- it('normalizes unknown Twilio line-type values to "unknown"', async () => {
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(
- JSON.stringify({
- valid: true,
- country_code: 'US',
- line_type_intelligence: {type: 'someBrandNewTwilioType', carrier_name: 'Test'},
- }),
- {status: 200},
- ),
- });
- const result = await provider.lookupPhone('+15551234567');
- expect(result?.lineType).toBe('unknown');
- });
- it('parses sms_pumping_risk_score when present', async () => {
- const provider = new TwilioSmsProvider({
- config: CONFIG,
- logger: createMockLogger(),
- fetchFn: async () =>
- new Response(
- JSON.stringify({
- valid: true,
- country_code: 'US',
- line_type_intelligence: {type: 'mobile', carrier_name: 'T-Mobile USA'},
- sms_pumping_risk: {sms_pumping_risk_score: 72},
- }),
- {status: 200},
- ),
- });
- const result = await provider.lookupPhone('+15551234567');
- expect(result?.smsPumpingRiskScore).toBe(72);
- });
- });
-});
diff --git a/fluxer_api/pkgs/sms/src/providers/ISmsProvider.ts b/fluxer_api/pkgs/sms/src/providers/ISmsProvider.ts
deleted file mode 100644
index 2fa1a9668..000000000
--- a/fluxer_api/pkgs/sms/src/providers/ISmsProvider.ts
+++ /dev/null
@@ -1,14 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import type {SmsVerificationStartOptions, SmsVerificationStartResult} from '@pkgs/sms/src/SmsVerificationTypes';
-
-export interface ISmsProvider {
- startVerification(phone: string): Promise<void>;
- startVerificationWithResult(
- phone: string,
- options?: SmsVerificationStartOptions,
- ): Promise<SmsVerificationStartResult>;
- checkVerification(phone: string, code: string): Promise<boolean>;
- lookupPhone(phone: string): Promise<PhoneLookupResult | null>;
-}
diff --git a/fluxer_api/pkgs/sms/src/providers/SmsProviderFactory.ts b/fluxer_api/pkgs/sms/src/providers/SmsProviderFactory.ts
deleted file mode 100644
index 0c11c0871..000000000
--- a/fluxer_api/pkgs/sms/src/providers/SmsProviderFactory.ts
+++ /dev/null
@@ -1,48 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {LoggerInterface} from '@fluxer/logger/src/LoggerInterface';
-import type {ISmsProvider} from '@pkgs/sms/src/providers/ISmsProvider';
-import {TestSmsProvider} from '@pkgs/sms/src/providers/TestSmsProvider';
-import {TwilioSmsProvider, type TwilioSmsProviderConfig} from '@pkgs/sms/src/providers/TwilioSmsProvider';
-import {UnavailableSmsProvider} from '@pkgs/sms/src/providers/UnavailableSmsProvider';
-
-interface BaseSmsProviderFactoryParams {
- logger?: LoggerInterface;
-}
-
-interface CreateUnavailableSmsProviderParams extends BaseSmsProviderFactoryParams {
- mode: 'unavailable';
-}
-
-interface CreateTestSmsProviderParams extends BaseSmsProviderFactoryParams {
- mode: 'test';
- verificationCode?: string;
-}
-
-interface CreateTwilioSmsProviderParams extends BaseSmsProviderFactoryParams {
- mode: 'twilio';
- config: TwilioSmsProviderConfig;
- fetchFn?: typeof fetch;
-}
-
-type CreateSmsProviderParams =
- | CreateUnavailableSmsProviderParams
- | CreateTestSmsProviderParams
- | CreateTwilioSmsProviderParams;
-
-export function createSmsProvider(params: CreateSmsProviderParams): ISmsProvider {
- if (params.mode === 'test') {
- return new TestSmsProvider({
- logger: params.logger,
- verificationCode: params.verificationCode,
- });
- }
- if (params.mode === 'twilio') {
- return new TwilioSmsProvider({
- config: params.config,
- logger: params.logger,
- fetchFn: params.fetchFn,
- });
- }
- return new UnavailableSmsProvider();
-}
diff --git a/fluxer_api/pkgs/sms/src/providers/TestSmsProvider.ts b/fluxer_api/pkgs/sms/src/providers/TestSmsProvider.ts
deleted file mode 100644
index dea92921d..000000000
--- a/fluxer_api/pkgs/sms/src/providers/TestSmsProvider.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {SMS_TEST_VERIFICATION_CODE} from '@fluxer/constants/src/SmsVerificationConstants';
-import {createLogger} from '@fluxer/logger/src/Logger';
-import type {LoggerInterface} from '@fluxer/logger/src/LoggerInterface';
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import type {ISmsProvider} from '@pkgs/sms/src/providers/ISmsProvider';
-import {SMS_VERIFICATION_START_SMS_RESULT, type SmsVerificationStartResult} from '@pkgs/sms/src/SmsVerificationTypes';
-import {maskPhoneNumber} from '@pkgs/sms/src/SmsVerificationUtils';
-
-interface TestSmsProviderOptions {
- logger?: LoggerInterface;
- verificationCode?: string;
-}
-
-export class TestSmsProvider implements ISmsProvider {
- private readonly logger: LoggerInterface;
- private readonly verificationCode: string;
-
- constructor({logger, verificationCode}: TestSmsProviderOptions = {}) {
- this.logger = logger ?? createLogger('@pkgs/sms/src', {environment: 'test'});
- this.verificationCode = verificationCode ?? SMS_TEST_VERIFICATION_CODE;
- }
-
- async startVerification(phone: string): Promise<void> {
- this.logger.info(
- `[TestSmsProvider] Mock verification started for ${maskPhoneNumber(phone)}. Use code: ${this.verificationCode}`,
- );
- }
-
- async startVerificationWithResult(phone: string): Promise<SmsVerificationStartResult> {
- await this.startVerification(phone);
- return SMS_VERIFICATION_START_SMS_RESULT;
- }
-
- async checkVerification(phone: string, code: string): Promise<boolean> {
- const isValid = code === this.verificationCode;
- this.logger.info(
- `[TestSmsProvider] Mock verification check for ${maskPhoneNumber(phone)} with code ${code}: ${isValid ? 'APPROVED' : 'REJECTED'}`,
- );
- return isValid;
- }
-
- async lookupPhone(phone: string): Promise<PhoneLookupResult | null> {
- this.logger.info(`[TestSmsProvider] Mock lookup for ${maskPhoneNumber(phone)} -> valid mobile`);
- return {
- valid: true,
- lineType: 'mobile',
- countryCode: null,
- carrierName: 'Test Carrier',
- smsPumpingRiskScore: null,
- };
- }
-}
diff --git a/fluxer_api/pkgs/sms/src/providers/TwilioSmsProvider.ts b/fluxer_api/pkgs/sms/src/providers/TwilioSmsProvider.ts
deleted file mode 100644
index dd4536e63..000000000
--- a/fluxer_api/pkgs/sms/src/providers/TwilioSmsProvider.ts
+++ /dev/null
@@ -1,512 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
-import {
- SMS_TWILIO_DEFAULT_LOOKUP_API_URL,
- SMS_TWILIO_DEFAULT_VERIFY_API_URL,
-} from '@fluxer/constants/src/SmsVerificationConstants';
-import {InvalidPhoneNumberError} from '@fluxer/errors/src/domains/auth/InvalidPhoneNumberError';
-import {SmsVerificationUnavailableError} from '@fluxer/errors/src/domains/auth/SmsVerificationUnavailableError';
-import {RateLimitError} from '@fluxer/errors/src/domains/core/RateLimitError';
-import {createLogger} from '@fluxer/logger/src/Logger';
-import type {LoggerInterface} from '@fluxer/logger/src/LoggerInterface';
-import type {PhoneLineType, PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import type {ISmsProvider} from '@pkgs/sms/src/providers/ISmsProvider';
-import type {SmsVerificationStartOptions, SmsVerificationStartResult} from '@pkgs/sms/src/SmsVerificationTypes';
-import {maskPhoneNumber} from '@pkgs/sms/src/SmsVerificationUtils';
-
-const TWILIO_INVALID_PHONE_ERROR_CODE = 21211;
-const TWILIO_TOO_MANY_REQUESTS_ERROR_CODE = 20429;
-const TWILIO_MAX_SEND_ATTEMPTS_ERROR_CODE = 60203;
-const TWILIO_MAX_CHECK_ATTEMPTS_ERROR_CODE = 60202;
-const TWILIO_CONCURRENT_REQUESTS_ERROR_CODE = 60212;
-const TWILIO_FRAUD_GUARD_BLOCK_ERROR_CODE = 60410;
-const TWILIO_FRAUD_PREVENTION_BLOCK_ERROR_CODE = 60412;
-const TWILIO_DEFAULT_BUSY_RETRY_AFTER_SECONDS = 60;
-const TWILIO_VERIFY_WINDOW_RETRY_AFTER_SECONDS = 10 * 60;
-const TWILIO_FRAUD_BLOCK_RETRY_AFTER_SECONDS = 12 * 60 * 60;
-
-interface TwilioErrorResponse {
- code?: number;
- message?: string;
-}
-
-interface TwilioResponse {
- ok: boolean;
- status: number;
- body: unknown;
-}
-
-type TwilioCooldownScope = 'account' | 'phone' | 'account_and_phone';
-
-interface StartVerificationSentryContext extends Record<string, unknown> {
- smsProvider: 'twilio';
- smsOperation: 'start_verification';
- twilioEndpoint: 'Verifications';
- phone: string;
- twilioStatus?: number;
- twilioCode?: number;
- twilioMessage?: string;
- twilioRequestError?: string;
-}
-
-interface TwilioLookupV2Response {
- valid: boolean;
- country_code?: string | null;
- line_type_intelligence?: {
- type?: string | null;
- carrier_name?: string | null;
- error_code?: number | null;
- } | null;
- sms_pumping_risk?: {
- sms_pumping_risk_score?: number | null;
- error_code?: number | null;
- } | null;
-}
-
-export interface TwilioSmsProviderConfig {
- accountSid: string;
- authToken: string;
- verifyServiceSid: string;
- verifyApiUrl?: string;
- lookupApiUrl?: string;
- lookupTimeoutMs?: number;
-}
-
-interface TwilioSmsProviderDependencies {
- config: TwilioSmsProviderConfig;
- logger?: LoggerInterface;
- fetchFn?: typeof fetch;
-}
-
-const DEFAULT_LOOKUP_TIMEOUT_MS = 3000;
-const VERIFY_TIMEOUT_MS = 10000;
-const KNOWN_LINE_TYPES: ReadonlySet<PhoneLineType> = new Set<PhoneLineType>([
- 'mobile',
- 'landline',
- 'fixedVoip',
- 'nonFixedVoip',
- 'personal',
- 'tollFree',
- 'premium',
- 'sharedCost',
- 'uan',
- 'voicemail',
- 'pager',
- 'unknown',
-]);
-
-function isRecord(value: unknown): value is Record<string, unknown> {
- return typeof value === 'object' && value !== null && !Array.isArray(value);
-}
-
-function isNullishString(value: unknown): value is string | null | undefined {
- return value == null || typeof value === 'string';
-}
-
-function isNullishInteger(value: unknown): value is number | null | undefined {
- return value == null || (typeof value === 'number' && Number.isSafeInteger(value));
-}
-
-function isTwilioLookupResponse(value: unknown): value is TwilioLookupV2Response {
- if (!isRecord(value) || typeof value.valid !== 'boolean' || !isNullishString(value.country_code)) return false;
- const line = value.line_type_intelligence;
- if (
- line != null &&
- (!isRecord(line) ||
- !isNullishString(line.type) ||
- !isNullishString(line.carrier_name) ||
- !isNullishInteger(line.error_code))
- ) {
- return false;
- }
- const risk = value.sms_pumping_risk;
- if (risk == null) return true;
- if (!isRecord(risk) || !isNullishInteger(risk.error_code)) return false;
- const score = risk.sms_pumping_risk_score;
- return isNullishInteger(score) && (score == null || (score >= 0 && score <= 100));
-}
-
-function parseTwilioError(value: unknown): TwilioErrorResponse | null {
- if (!isRecord(value)) return null;
- if (value.code !== undefined && (typeof value.code !== 'number' || !Number.isSafeInteger(value.code))) return null;
- if (value.message !== undefined && typeof value.message !== 'string') return null;
- return {code: value.code, message: value.message};
-}
-
-function normalizeLineType(raw: string | null | undefined): PhoneLineType | null {
- if (!raw) return null;
- return KNOWN_LINE_TYPES.has(raw as PhoneLineType) ? (raw as PhoneLineType) : 'unknown';
-}
-
-export class SmsVerificationStartError extends Error {
- readonly sentryContext: StartVerificationSentryContext;
-
- constructor(sentryContext: StartVerificationSentryContext, options?: ErrorOptions) {
- super('Failed to start SMS verification', options);
- this.name = 'SmsVerificationStartError';
- this.sentryContext = sentryContext;
- }
-}
-
-export class TwilioVerificationRateLimitError extends RateLimitError {
- readonly twilioCode?: number;
- readonly twilioStatus?: number;
- readonly cooldownScope: TwilioCooldownScope;
- readonly cooldownMs: number;
-
- constructor(args: {
- message: string;
- retryAfterSeconds: number;
- twilioCode?: number;
- twilioStatus?: number;
- cooldownScope: TwilioCooldownScope;
- cooldownMs?: number;
- scope?: 'shared' | 'user';
- }) {
- const retryAfterSeconds = Math.max(1, Math.ceil(args.retryAfterSeconds));
- super({
- code: APIErrorCodes.PHONE_RATE_LIMIT_EXCEEDED,
- message: args.message,
- retryAfter: retryAfterSeconds,
- retryAfterDecimal: retryAfterSeconds,
- limit: 1,
- resetTime: new Date(Date.now() + retryAfterSeconds * 1000),
- resetAfterDecimal: retryAfterSeconds,
- scope: args.scope ?? 'shared',
- });
- this.name = 'TwilioVerificationRateLimitError';
- this.twilioCode = args.twilioCode;
- this.twilioStatus = args.twilioStatus;
- this.cooldownScope = args.cooldownScope;
- this.cooldownMs = args.cooldownMs ?? retryAfterSeconds * 1000;
- }
-}
-
-export class TwilioSmsProvider implements ISmsProvider {
- private readonly verifyApiUrl: string;
- private readonly lookupApiUrl: string;
- private readonly lookupTimeoutMs: number;
- private readonly logger: LoggerInterface;
- private readonly config: TwilioSmsProviderConfig;
- private readonly fetchFn: typeof fetch;
-
- constructor({config, logger, fetchFn = fetch}: TwilioSmsProviderDependencies) {
- this.verifyApiUrl = config.verifyApiUrl ?? SMS_TWILIO_DEFAULT_VERIFY_API_URL;
- this.lookupApiUrl = config.lookupApiUrl ?? SMS_TWILIO_DEFAULT_LOOKUP_API_URL;
- this.lookupTimeoutMs = config.lookupTimeoutMs ?? DEFAULT_LOOKUP_TIMEOUT_MS;
- this.logger = logger ?? createLogger('@pkgs/sms/src');
- this.config = config;
- this.fetchFn = fetchFn;
- }
-
- async startVerification(phone: string): Promise<void> {
- await this.startVerificationWithResult(phone);
- }
-
- async startVerificationWithResult(
- phone: string,
- options: SmsVerificationStartOptions = {},
- ): Promise<SmsVerificationStartResult> {
- const requestedChannel = options.channel ?? 'sms';
- const requestBody: Record<string, string> = {
- To: phone,
- Channel: requestedChannel,
- };
- if (options.deviceIp) {
- requestBody.DeviceIp = options.deviceIp;
- }
- if (options.rateLimits) {
- for (const [key, value] of Object.entries(options.rateLimits)) {
- if (!key || !value) continue;
- requestBody[`RateLimits[${key}]`] = value;
- }
- }
- let response: TwilioResponse;
- try {
- response = await this.requestTwilio('Verifications', requestBody);
- } catch (error) {
- const sentryContext = this.createStartVerificationSentryContext(phone, {
- requestError: error,
- });
- this.logger.error(sentryContext, '[TwilioSmsProvider] Twilio request failed while starting SMS verification');
- throw new SmsVerificationUnavailableError();
- }
- if (response.ok) {
- const parsed = response.body;
- if (
- !isRecord(parsed) ||
- !isNullishString(parsed.channel) ||
- (parsed.status !== undefined && parsed.status !== 'pending' && parsed.status !== 'approved')
- ) {
- this.logger.error(
- {phone: maskPhoneNumber(phone), status: response.status},
- '[TwilioSmsProvider] Invalid verification start response',
- );
- throw new SmsVerificationUnavailableError();
- }
- return {
- channel: parsed.channel ?? requestedChannel,
- };
- }
- const body = parseTwilioError(response.body);
- if (body?.code === TWILIO_INVALID_PHONE_ERROR_CODE) {
- throw new InvalidPhoneNumberError();
- }
- const rateLimitError = this.createRateLimitError(response, body, 'Verifications');
- if (rateLimitError) {
- throw rateLimitError;
- }
- const sentryContext = this.createStartVerificationSentryContext(phone, {
- response,
- body,
- });
- this.logger.error(sentryContext, '[TwilioSmsProvider] Failed to start SMS verification');
- throw new SmsVerificationUnavailableError();
- }
-
- async checkVerification(phone: string, code: string): Promise<boolean> {
- let response: TwilioResponse;
- try {
- response = await this.requestTwilio('VerificationCheck', {
- To: phone,
- Code: code,
- });
- } catch (error) {
- this.logger.error(
- {error: error instanceof Error ? error.message : String(error), phone: maskPhoneNumber(phone)},
- '[TwilioSmsProvider] Twilio request failed while checking SMS verification',
- );
- throw new SmsVerificationUnavailableError();
- }
- if (!response.ok) {
- const body = parseTwilioError(response.body);
- const rateLimitError = this.createRateLimitError(response, body, 'VerificationCheck');
- if (rateLimitError) {
- throw rateLimitError;
- }
- if (response.status >= 500) {
- this.logger.error(
- {
- status: response.status,
- code: body?.code,
- message: body?.message,
- phone: maskPhoneNumber(phone),
- },
- '[TwilioSmsProvider] Verification check failed with provider error',
- );
- throw new SmsVerificationUnavailableError();
- }
- return false;
- }
- const body = response.body;
- if (!isRecord(body) || typeof body.status !== 'string') {
- this.logger.error(
- {phone: maskPhoneNumber(phone), status: response.status},
- '[TwilioSmsProvider] Invalid verification check response',
- );
- throw new SmsVerificationUnavailableError();
- }
- return body.status === 'approved';
- }
-
- async lookupPhone(phone: string): Promise<PhoneLookupResult | null> {
- const url = `${this.lookupApiUrl}/PhoneNumbers/${encodeURIComponent(phone)}?Fields=line_type_intelligence,sms_pumping_risk`;
- const auth = Buffer.from(`${this.config.accountSid}:${this.config.authToken}`).toString('base64');
- let response: Response;
- try {
- response = await this.fetchFn(url, {
- method: 'GET',
- headers: {Authorization: `Basic ${auth}`},
- signal: AbortSignal.timeout(this.lookupTimeoutMs),
- });
- } catch (error) {
- this.logger.warn(
- {error: error instanceof Error ? error.message : String(error), phone: maskPhoneNumber(phone)},
- '[TwilioSmsProvider] Lookup request failed (fail-open)',
- );
- return null;
- }
- if (response.status === 404) {
- await response.body?.cancel().catch(() => {
- this.logger.warn(
- {status: response.status},
- '[TwilioSmsProvider] Failed to cancel discarded lookup response body',
- );
- });
- return {
- valid: false,
- lineType: null,
- countryCode: null,
- carrierName: null,
- smsPumpingRiskScore: null,
- };
- }
- if (!response.ok) {
- const body = await this.parseErrorBody(response);
- this.logger.warn(
- {
- status: response.status,
- code: body?.code,
- message: body?.message,
- phone: maskPhoneNumber(phone),
- },
- '[TwilioSmsProvider] Lookup returned non-OK (fail-open)',
- );
- return null;
- }
- let parsed: unknown;
- try {
- parsed = await response.json();
- } catch (error) {
- this.logger.warn(
- {error: error instanceof Error ? error.message : String(error), phone: maskPhoneNumber(phone)},
- '[TwilioSmsProvider] Lookup response JSON parse failed (fail-open)',
- );
- return null;
- }
- if (!isTwilioLookupResponse(parsed)) {
- this.logger.warn({phone: maskPhoneNumber(phone)}, '[TwilioSmsProvider] Invalid lookup response (fail-open)');
- return null;
- }
- const countryCode = parsed.country_code ?? null;
- const carrierName = parsed.line_type_intelligence?.carrier_name ?? null;
- const ltiErrorCode = parsed.line_type_intelligence?.error_code ?? null;
- const sprErrorCode = parsed.sms_pumping_risk?.error_code ?? null;
- if (ltiErrorCode != null) {
- this.logger.warn(
- {phone: maskPhoneNumber(phone), countryCode, ltiErrorCode},
- '[TwilioSmsProvider] Lookup line_type_intelligence reported error_code',
- );
- }
- if (sprErrorCode != null) {
- this.logger.warn(
- {phone: maskPhoneNumber(phone), countryCode, sprErrorCode},
- '[TwilioSmsProvider] Lookup sms_pumping_risk reported error_code',
- );
- }
- return {
- valid: parsed.valid,
- lineType: normalizeLineType(parsed.line_type_intelligence?.type),
- countryCode,
- carrierName,
- smsPumpingRiskScore: parsed.sms_pumping_risk?.sms_pumping_risk_score ?? null,
- };
- }
-
- private async requestTwilio(
- endpoint: 'Verifications' | 'VerificationCheck',
- body: Record<string, string>,
- ): Promise<TwilioResponse> {
- const url = `${this.verifyApiUrl}/Services/${this.config.verifyServiceSid}/${endpoint}`;
- const auth = Buffer.from(`${this.config.accountSid}:${this.config.authToken}`).toString('base64');
- const response = await this.fetchFn(url, {
- method: 'POST',
- headers: {
- Authorization: `Basic ${auth}`,
- 'Content-Type': 'application/x-www-form-urlencoded',
- },
- body: new URLSearchParams(body).toString(),
- signal: AbortSignal.timeout(VERIFY_TIMEOUT_MS),
- });
- const parsed: unknown = await response.json().catch((error: unknown) => {
- if (response.ok) throw error;
- return null;
- });
- return {ok: response.ok, status: response.status, body: parsed};
- }
-
- private async parseErrorBody(response: Response): Promise<TwilioErrorResponse | null> {
- try {
- return parseTwilioError(await response.json());
- } catch {
- return null;
- }
- }
-
- private createStartVerificationSentryContext(
- phone: string,
- params: {
- response?: Pick<Response, 'status'>;
- body?: TwilioErrorResponse | null;
- requestError?: unknown;
- },
- ): StartVerificationSentryContext {
- const sentryContext: StartVerificationSentryContext = {
- smsProvider: 'twilio',
- smsOperation: 'start_verification',
- twilioEndpoint: 'Verifications',
- phone: maskPhoneNumber(phone),
- };
- if (params.response) {
- sentryContext.twilioStatus = params.response.status;
- }
- if (params.body?.code !== undefined) {
- sentryContext.twilioCode = params.body.code;
- }
- if (params.body?.message !== undefined) {
- sentryContext.twilioMessage = params.body.message;
- }
- if (params.requestError !== undefined) {
- sentryContext.twilioRequestError =
- params.requestError instanceof Error ? params.requestError.message : String(params.requestError);
- }
- return sentryContext;
- }
-
- private createRateLimitError(
- response: Pick<Response, 'status'>,
- body: TwilioErrorResponse | null,
- endpoint: 'Verifications' | 'VerificationCheck',
- ): TwilioVerificationRateLimitError | null {
- const twilioCode = body?.code;
- const twilioStatus = response.status;
- if (twilioCode === TWILIO_MAX_SEND_ATTEMPTS_ERROR_CODE) {
- return new TwilioVerificationRateLimitError({
- message: 'Too many verification texts were sent recently. Try again later.',
- retryAfterSeconds: TWILIO_VERIFY_WINDOW_RETRY_AFTER_SECONDS,
- twilioCode,
- twilioStatus,
- cooldownScope: 'phone',
- });
- }
- if (twilioCode === TWILIO_CONCURRENT_REQUESTS_ERROR_CODE) {
- return new TwilioVerificationRateLimitError({
- message: 'Too many verification requests are already in flight for this number. Try again later.',
- retryAfterSeconds: TWILIO_VERIFY_WINDOW_RETRY_AFTER_SECONDS,
- twilioCode,
- twilioStatus,
- cooldownScope: 'phone',
- });
- }
- if (twilioCode === TWILIO_MAX_CHECK_ATTEMPTS_ERROR_CODE && endpoint === 'VerificationCheck') {
- return new TwilioVerificationRateLimitError({
- message: 'Too many verification code checks were attempted. Request a new code later.',
- retryAfterSeconds: TWILIO_VERIFY_WINDOW_RETRY_AFTER_SECONDS,
- twilioCode,
- twilioStatus,
- cooldownScope: 'phone',
- });
- }
- if (twilioCode === TWILIO_FRAUD_GUARD_BLOCK_ERROR_CODE || twilioCode === TWILIO_FRAUD_PREVENTION_BLOCK_ERROR_CODE) {
- return new TwilioVerificationRateLimitError({
- message: 'Phone verification is temporarily blocked for this destination. Try again later.',
- retryAfterSeconds: TWILIO_FRAUD_BLOCK_RETRY_AFTER_SECONDS,
- twilioCode,
- twilioStatus,
- cooldownScope: 'phone',
- });
- }
- if (twilioCode === TWILIO_TOO_MANY_REQUESTS_ERROR_CODE || (twilioCode == null && twilioStatus === 429)) {
- return new TwilioVerificationRateLimitError({
- message: 'Phone verification is temporarily busy. Try again shortly.',
- retryAfterSeconds: TWILIO_DEFAULT_BUSY_RETRY_AFTER_SECONDS,
- twilioCode,
- twilioStatus,
- cooldownScope: 'account',
- scope: 'user',
- });
- }
- return null;
- }
-}
diff --git a/fluxer_api/pkgs/sms/src/providers/UnavailableSmsProvider.ts b/fluxer_api/pkgs/sms/src/providers/UnavailableSmsProvider.ts
deleted file mode 100644
index 532260a42..000000000
--- a/fluxer_api/pkgs/sms/src/providers/UnavailableSmsProvider.ts
+++ /dev/null
@@ -1,24 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {SmsVerificationUnavailableError} from '@fluxer/errors/src/domains/auth/SmsVerificationUnavailableError';
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import type {ISmsProvider} from '@pkgs/sms/src/providers/ISmsProvider';
-import {SMS_VERIFICATION_START_SMS_RESULT, type SmsVerificationStartResult} from '@pkgs/sms/src/SmsVerificationTypes';
-
-export class UnavailableSmsProvider implements ISmsProvider {
- async startVerification(_phone: string): Promise<void> {
- return;
- }
-
- async startVerificationWithResult(_phone: string): Promise<SmsVerificationStartResult> {
- return SMS_VERIFICATION_START_SMS_RESULT;
- }
-
- async checkVerification(_phone: string, _code: string): Promise<boolean> {
- throw new SmsVerificationUnavailableError();
- }
-
- async lookupPhone(_phone: string): Promise<PhoneLookupResult | null> {
- return null;
- }
-}
diff --git a/fluxer_api/pkgs/sms/tsconfig.json b/fluxer_api/pkgs/sms/tsconfig.json
deleted file mode 100644
index 97f2c7f13..000000000
--- a/fluxer_api/pkgs/sms/tsconfig.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
- "extends": "../../../tsconfigs/package.json",
- "compilerOptions": {
- "paths": {
- "@fluxer/*": ["../../../packages/*", "../../../packages/*/src/index.ts"],
- "@pkgs/*": ["../*"]
- }
- },
- "include": ["src/**/*"]
-}
diff --git a/fluxer_api/pkgs/sms/vitest.config.ts b/fluxer_api/pkgs/sms/vitest.config.ts
deleted file mode 100644
index f94671ff6..000000000
--- a/fluxer_api/pkgs/sms/vitest.config.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {defineConfig} from 'vitest/config';
-
-export default defineConfig({
- resolve: {tsconfigPaths: true},
- test: {
- globals: true,
- environment: 'node',
- include: ['**/*.{test,spec}.{ts,tsx}'],
- exclude: ['node_modules', 'dist'],
- coverage: {
- provider: 'v8',
- reporter: ['text', 'json', 'html'],
- exclude: ['**/*.test.tsx', '**/*.spec.tsx', 'node_modules/'],
- },
- },
-});
diff --git a/fluxer_api/src/api/ApiContext.ts b/fluxer_api/src/api/ApiContext.ts
index 1122ab3d8..e27488b24 100644
--- a/fluxer_api/src/api/ApiContext.ts
+++ b/fluxer_api/src/api/ApiContext.ts
@@ -1,8 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import type {InboundSmsChallengeService} from '@app/api/auth/services/InboundSmsChallengeService';
-import type {PhoneAttemptRiskService} from '@app/api/auth/services/PhoneAttemptRiskService';
-import type {IPhoneLookupRepository} from '@app/api/auth/services/PhoneLookupRepository';
import type {Config} from '@app/api/Config';
import type {IEmailDnsValidationService} from '@app/api/infrastructure/IEmailDnsValidationService';
import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
@@ -17,7 +14,6 @@ import type {ICacheService} from '@pkgs/cache/src/ICacheService';
import type {IEmailService} from '@pkgs/email/src/IEmailService';
import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
import type {IRateLimitService} from '@pkgs/rate_limit/src/IRateLimitService';
-import type {ISmsService} from '@pkgs/sms/src/ISmsService';
import type {IWorkerService} from '@pkgs/worker/src/contracts/IWorkerService';
export interface ApiServices {
@@ -28,14 +24,10 @@ export interface ApiServices {
media: IMediaService;
email: IEmailService;
emailDnsValidation: IEmailDnsValidationService;
- sms: ISmsService;
worker: IWorkerService<WorkerTaskName>;
snowflake: ISnowflakeService;
rateLimit: IRateLimitService;
contactChangeLog: UserContactChangeLogService;
- inboundSmsChallenge: InboundSmsChallengeService | null;
- phoneLookup: IPhoneLookupRepository | null;
- phoneAttemptRisk: PhoneAttemptRiskService;
botMfaMirror: BotMfaMirrorService;
userActivityBuffer: UserActivityBuffer;
config: typeof Config;
diff --git a/fluxer_api/src/api/App.ts b/fluxer_api/src/api/App.ts
index 4b8bffb69..fb88fab82 100644
--- a/fluxer_api/src/api/App.ts
+++ b/fluxer_api/src/api/App.ts
@@ -5,7 +5,7 @@ import {registerControllers} from '@app/api/app/ControllerRegistry';
import {configureMiddleware} from '@app/api/app/MiddlewarePipeline';
import type {APIConfig} from '@app/api/config/APIConfig';
import type {ILogger} from '@app/api/ILogger';
-import {recordHttpClientError} from '@app/api/middleware/AbusiveIpAutoBanner';
+import {recordRequestStatus} from '@app/api/middleware/RequestErrorTelemetry';
import type {HonoApp, HonoEnv} from '@app/api/types/HonoEnv';
import {AppErrorHandler, AppNotFoundHandler} from '@fluxer/errors/src/domains/core/ErrorHandlers';
import {IpBannedError} from '@fluxer/errors/src/domains/moderation/IpBannedError';
@@ -27,11 +27,11 @@ interface APIAppResult {
shutdown: () => Promise<void>;
}
-function AbuseAwareAppErrorHandler(err: Error, ctx: Context<HonoEnv>): Response | Promise<Response> {
+function TelemetryAwareAppErrorHandler(err: Error, ctx: Context<HonoEnv>): Response | Promise<Response> {
if (!(err instanceof IpBannedError)) {
const status = resolveErrorStatus(err);
if (status !== null && !ctx.get('user')) {
- recordHttpClientError(ctx.req.raw, status);
+ recordRequestStatus(ctx.req.raw, status);
}
}
return AppErrorHandler(err, ctx);
@@ -49,9 +49,8 @@ export async function createAPIApp(options: CreateAPIAppOptions): Promise<APIApp
trustClientIpHeader: config.proxy.trust_client_ip_header,
clientIpHeaderName: config.proxy.client_ip_header,
maxInflightRequests: config.maxInflightRequests,
- torExitBlockingEnabled: config.torExitList.enabled,
});
- routes.onError(AbuseAwareAppErrorHandler);
+ routes.onError(TelemetryAwareAppErrorHandler);
routes.notFound(AppNotFoundHandler);
registerControllers(routes, config);
const app = new Hono<HonoEnv>({strict: true});
@@ -67,7 +66,7 @@ export async function createAPIApp(options: CreateAPIAppOptions): Promise<APIApp
);
app.route('/v1', routes);
app.route('/', routes);
- app.onError(AbuseAwareAppErrorHandler);
+ app.onError(TelemetryAwareAppErrorHandler);
app.notFound(AppNotFoundHandler);
return {
app,
diff --git a/fluxer_api/src/api/BrandedTypes.ts b/fluxer_api/src/api/BrandedTypes.ts
index 81845e2e2..63db54961 100644
--- a/fluxer_api/src/api/BrandedTypes.ts
+++ b/fluxer_api/src/api/BrandedTypes.ts
@@ -39,7 +39,6 @@ type IpAuthorizationTicket = Brand<string, 'IpAuthorizationTicket'>;
type MfaTicket = Brand<string, 'MfaTicket'>;
export type WebhookToken = Brand<string, 'WebhookToken'>;
export type MfaBackupCode = Brand<string, 'MfaBackupCode'>;
-export type PhoneVerificationToken = Brand<string, 'PhoneVerificationToken'>;
export function createUserID<T extends bigint>(id: T extends BrandedValue ? never : T): UserID {
return brand<T, 'UserID'>(id);
diff --git a/fluxer_api/src/api/Config.test.ts b/fluxer_api/src/api/Config.test.ts
index bcf00f151..a36b44104 100644
--- a/fluxer_api/src/api/Config.test.ts
+++ b/fluxer_api/src/api/Config.test.ts
@@ -170,13 +170,12 @@ describe('buildAPIConfigFromMaster stripe legacy prices', () => {
function withOptionalOutboundLookups(
master: MasterConfig,
selfHosted: boolean,
- overrides: {torExitList?: boolean; breachedPasswordCheck?: boolean} = {},
+ overrides: {breachedPasswordCheck?: boolean} = {},
): MasterConfig {
return {
...master,
integrations: {
...master.integrations,
- tor_exit_list: {enabled: overrides.torExitList},
breached_password_check: {enabled: overrides.breachedPasswordCheck},
},
instance: {
@@ -192,31 +191,23 @@ describe('buildAPIConfigFromMaster optional outbound lookups', () => {
master = await loadConfig();
});
- it('keeps both lookups on when the instance is not self-hosted', () => {
+ it('keeps the lookup on when the instance is not self-hosted', () => {
const config = buildAPIConfigFromMaster(withOptionalOutboundLookups(master, false));
- expect(config.torExitList.enabled).toBe(true);
expect(config.breachedPasswordCheck.enabled).toBe(true);
});
- it('leaves both lookups off on a self-hosted instance', () => {
+ it('leaves the lookup off on a self-hosted instance', () => {
const config = buildAPIConfigFromMaster(withOptionalOutboundLookups(master, true));
- expect(config.torExitList.enabled).toBe(false);
expect(config.breachedPasswordCheck.enabled).toBe(false);
});
- it('lets a self-hosted operator switch each lookup on', () => {
- const config = buildAPIConfigFromMaster(
- withOptionalOutboundLookups(master, true, {torExitList: true, breachedPasswordCheck: true}),
- );
- expect(config.torExitList.enabled).toBe(true);
+ it('lets a self-hosted operator switch the lookup on', () => {
+ const config = buildAPIConfigFromMaster(withOptionalOutboundLookups(master, true, {breachedPasswordCheck: true}));
expect(config.breachedPasswordCheck.enabled).toBe(true);
});
- it('lets an operator switch each lookup off when the instance is not self-hosted', () => {
- const config = buildAPIConfigFromMaster(
- withOptionalOutboundLookups(master, false, {torExitList: false, breachedPasswordCheck: false}),
- );
- expect(config.torExitList.enabled).toBe(false);
+ it('lets an operator switch the lookup off when the instance is not self-hosted', () => {
+ const config = buildAPIConfigFromMaster(withOptionalOutboundLookups(master, false, {breachedPasswordCheck: false}));
expect(config.breachedPasswordCheck.enabled).toBe(false);
});
});
diff --git a/fluxer_api/src/api/Config.ts b/fluxer_api/src/api/Config.ts
index 86ace4d79..2847e1ec6 100644
--- a/fluxer_api/src/api/Config.ts
+++ b/fluxer_api/src/api/Config.ts
@@ -320,26 +320,12 @@ export function buildAPIConfigFromMaster(master: MasterConfig): APIConfig {
}
: undefined,
},
- sms: {
- enabled: master.integrations.sms.enabled,
- accountSid: master.integrations.sms.account_sid,
- authToken: master.integrations.sms.auth_token,
- verifyServiceSid: master.integrations.sms.verify_service_sid,
- inboundChallengeNumber: master.integrations.sms.inbound_challenge_number || undefined,
- inboundWebhookAuthToken: master.integrations.sms.inbound_webhook_auth_token || master.integrations.sms.auth_token,
- inboundWebhookPublicUrl: master.integrations.sms.inbound_webhook_public_url || undefined,
- },
- risk: {
- enabled: master.integrations.risk_integration.enabled,
- ipinfoApiKey: master.integrations.risk_integration.ipinfo_api_key || undefined,
- accountPolicyDsl: master.integrations.risk_integration.account_policy_dsl,
+ ipinfo: {
+ apiKey: master.integrations.ipinfo.api_key || undefined,
},
blocklistFeeds: {
enabled: master.integrations.blocklist_feeds.enabled ?? !master.instance.self_hosted,
},
- torExitList: {
- enabled: master.integrations.tor_exit_list.enabled ?? !master.instance.self_hosted,
- },
breachedPasswordCheck: {
enabled: master.integrations.breached_password_check.enabled ?? !master.instance.self_hosted,
},
@@ -484,23 +470,6 @@ export function buildAPIConfigFromMaster(master: MasterConfig): APIConfig {
configured: master.instance.setup.configured,
},
},
- abusePolicy: {
- inboundPhoneCountryCodes: master.instance.abuse_policy.inbound_phone_country_codes,
- phoneFlagging: {
- enabled: master.instance.abuse_policy.phone_flagging.enabled,
- exemptCountryCodes: master.instance.abuse_policy.phone_flagging.exempt_country_codes,
- },
- phoneVerification: {
- inboundRequiredPrefixes: master.instance.abuse_policy.phone_verification.inbound_required_prefixes,
- },
- directContactSpam: {
- enabled: master.instance.abuse_policy.direct_contact_spam.enabled,
- countryCodes: master.instance.abuse_policy.direct_contact_spam.country_codes,
- distinctTargetThreshold: master.instance.abuse_policy.direct_contact_spam.distinct_target_threshold,
- targetWindowMs: master.instance.abuse_policy.direct_contact_spam.target_window_ms,
- action: master.instance.abuse_policy.direct_contact_spam.action,
- },
- },
domain: {
baseDomain: master.domain.base_domain,
},
diff --git a/fluxer_api/src/api/CreateApiContext.ts b/fluxer_api/src/api/CreateApiContext.ts
index 650f3c51d..0fb5c7ffc 100644
--- a/fluxer_api/src/api/CreateApiContext.ts
+++ b/fluxer_api/src/api/CreateApiContext.ts
@@ -1,9 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {ApiContext, ApiServices, RequestScope} from '@app/api/ApiContext';
-import {CassandraPhoneLookupRepository} from '@app/api/auth/services/PhoneLookupRepository';
import {Config} from '@app/api/Config';
-import {getInboundSmsChallengeServiceInstance} from '@app/api/middleware/ServiceMiddleware';
import {
getGatewayService,
getKVClient,
@@ -17,9 +15,7 @@ import {
getContactChangeLogService,
getEmailDnsValidationService,
getEmailService,
- getPhoneAttemptRiskService,
getRateLimitService,
- getSmsService,
getUserActivityBuffer,
getUserRepository,
} from '@app/api/middleware/ServiceSingletons';
@@ -39,14 +35,10 @@ function buildApiServices(): ApiServices {
media: getMediaService(),
email: getEmailService(),
emailDnsValidation: getEmailDnsValidationService(),
- sms: getSmsService(),
worker: getWorkerService(),
snowflake: getSnowflakeService(),
rateLimit: getRateLimitService(),
contactChangeLog: getContactChangeLogService(),
- inboundSmsChallenge: getInboundSmsChallengeServiceInstance(),
- phoneLookup: new CassandraPhoneLookupRepository(),
- phoneAttemptRisk: getPhoneAttemptRiskService(),
botMfaMirror: getBotMfaMirrorService(),
userActivityBuffer: getUserActivityBuffer(),
config: Config,
diff --git a/fluxer_api/src/api/Tables.ts b/fluxer_api/src/api/Tables.ts
index 26f11f2fa..4bc90e8b3 100644
--- a/fluxer_api/src/api/Tables.ts
+++ b/fluxer_api/src/api/Tables.ts
@@ -13,7 +13,6 @@ import {
BANNED_EMAIL_COLUMNS,
BANNED_FILE_SHA_COLUMNS,
BANNED_IP_COLUMNS,
- BANNED_PHONE_PREFIX_COLUMNS,
BANNED_PHRASE_COLUMNS,
BANNED_PROFILE_SUBSTRING_COLUMNS,
BANNED_URL_COLUMNS,
@@ -22,15 +21,10 @@ import {
type BannedEmailRow,
type BannedFileShaRow,
type BannedIpRow,
- type BannedPhonePrefixRow,
type BannedPhraseRow,
type BannedProfileSubstringRow,
type BannedUrlDomainRow,
type BannedUrlRow,
- DISPOSABLE_EMAIL_DOMAIN_COLUMNS,
- type DisposableEmailDomainRow,
- SUSPICIOUS_EMAIL_DOMAIN_COLUMNS,
- type SuspiciousEmailDomainRow,
} from '@app/api/database/types/AdminArchiveTypes';
import {
ADMIN_API_KEY_BY_CREATOR_COLUMNS,
@@ -69,11 +63,7 @@ import {
PASSWORD_RESET_TOKEN_COLUMNS,
type PasswordChangeTicketRow,
type PasswordResetTokenRow,
- PHONE_TOKEN_COLUMNS,
- type PhoneTokenRow,
- USER_COUNTRY_HISTORY_COLUMNS,
USER_SSO_IDENTITY_COLUMNS,
- type UserCountryHistoryRow,
type UserSsoIdentityRow,
WEBAUTHN_CREDENTIAL_COLUMNS,
type WebAuthnCredentialRow,
@@ -260,40 +250,6 @@ import {
MESSAGE_REPORT_SUBMISSION_BY_REPORTER_COLUMNS,
type MessageReportSubmissionByReporterRow,
} from '@app/api/database/types/ReportTypes';
-import {
- INBOUND_SMS_CHALLENGE_BY_USER_COLUMNS,
- INBOUND_SMS_CHALLENGE_COLUMNS,
- type InboundSmsChallengeByUserRow,
- type InboundSmsChallengeRow,
- LATEST_RISK_CONTEXT_BY_USER_COLUMNS,
- type LatestRiskContextByUserRow,
- PHONE_LOOKUP_CACHE_COLUMNS,
- PHONE_VERIFICATION_ATTEMPT_COLUMNS,
- type PhoneLookupCacheRow,
- type PhoneVerificationAttemptRow,
- REGISTRATION_EVENT_BY_EMAIL_DOMAIN_COLUMNS,
- REGISTRATION_EVENT_BY_IP_COLUMNS,
- REGISTRATION_EVENT_BY_PLUS_ADDRESS_BASE_COLUMNS,
- REGISTRATION_EVENT_BY_SUBNET_COLUMNS,
- type RegistrationEventByEmailDomainRow,
- type RegistrationEventByIpRow,
- type RegistrationEventByPlusAddressBaseRow,
- type RegistrationEventBySubnetRow,
- RISK_ASSESSMENT_BY_USER_COLUMNS,
- RISK_ASSESSMENT_COLUMNS,
- RISK_OUTCOME_BY_ASN_COLUMNS,
- RISK_OUTCOME_BY_EMAIL_DOMAIN_COLUMNS,
- RISK_OUTCOME_BY_IP_COLUMNS,
- RISK_OUTCOME_BY_SUBNET_COLUMNS,
- type RiskAssessmentByUserRow,
- type RiskAssessmentRow,
- type RiskOutcomeByAsnRow,
- type RiskOutcomeByEmailDomainRow,
- type RiskOutcomeByIpRow,
- type RiskOutcomeBySubnetRow,
- SUSPICIOUS_IP_COLUMNS,
- type SuspiciousIpRow,
-} from '@app/api/database/types/RiskTypes';
import {
FAVORITE_MEME_COLUMNS,
type FavoriteMemeRow,
@@ -788,21 +744,6 @@ export const BannedEmails = defineTable<BannedEmailRow, 'email_lower'>({
columns: BANNED_EMAIL_COLUMNS,
primaryKey: ['email_lower'],
});
-export const BannedPhonePrefixes = defineTable<BannedPhonePrefixRow, 'prefix'>({
- name: 'banned_phone_prefixes',
- columns: BANNED_PHONE_PREFIX_COLUMNS,
- primaryKey: ['prefix'],
-});
-export const SuspiciousEmailDomains = defineTable<SuspiciousEmailDomainRow, 'domain'>({
- name: 'suspicious_email_domains',
- columns: SUSPICIOUS_EMAIL_DOMAIN_COLUMNS,
- primaryKey: ['domain'],
-});
-export const DisposableEmailDomains = defineTable<DisposableEmailDomainRow, 'domain'>({
- name: 'disposable_email_domains',
- columns: DISPOSABLE_EMAIL_DOMAIN_COLUMNS,
- primaryKey: ['domain'],
-});
export const BannedPhrases = defineTable<BannedPhraseRow, 'phrase'>({
name: 'banned_phrases',
columns: BANNED_PHRASE_COLUMNS,
@@ -888,12 +829,6 @@ export const EmailRevertTokens = defineTable<EmailRevertTokenRow, 'token_' | 'us
primaryKey: ['token_', 'user_id'],
defaultTtlSeconds: seconds('48 hours'),
});
-export const PhoneTokens = defineTable<PhoneTokenRow, 'token_'>({
- name: 'phone_tokens',
- columns: PHONE_TOKEN_COLUMNS,
- primaryKey: ['token_'],
- defaultTtlSeconds: seconds('30 days'),
-});
export const AuthSessions = defineTable<AuthSessionRow, 'session_id_hash'>({
name: 'auth_sessions',
columns: AUTH_SESSION_COLUMNS,
@@ -916,12 +851,6 @@ export const AuthSessionTombstones = defineTable<AuthSessionTombstoneRow, 'user_
primaryKey: ['user_id', 'session_id_hash'],
defaultTtlSeconds: seconds('30 days'),
});
-export const UserCountryHistory = defineTable<UserCountryHistoryRow, 'user_id' | 'country'>({
- name: 'user_country_history',
- columns: USER_COUNTRY_HISTORY_COLUMNS,
- primaryKey: ['user_id', 'country'],
- defaultTtlSeconds: seconds('365 days'),
-});
export const MfaBackupCodes = defineTable<MfaBackupCodeRow, 'user_id' | 'code'>({
name: 'mfa_backup_codes',
columns: MFA_BACKUP_CODE_COLUMNS,
@@ -1174,139 +1103,6 @@ export const NcmecUserWorkflows = defineTable<NcmecUserWorkflowRow, 'user_id'>({
columns: NCMEC_USER_WORKFLOW_COLUMNS,
primaryKey: ['user_id'],
});
-export const RegistrationEventsByIp = defineTable<RegistrationEventByIpRow, 'ip' | 'created_at' | 'user_id', 'ip'>({
- name: 'registration_events_by_ip',
- columns: REGISTRATION_EVENT_BY_IP_COLUMNS,
- primaryKey: ['ip', 'created_at', 'user_id'],
- partitionKey: ['ip'],
- defaultTtlSeconds: seconds('30 days'),
-});
-export const RegistrationEventsBySubnet = defineTable<
- RegistrationEventBySubnetRow,
- 'subnet' | 'created_at' | 'user_id',
- 'subnet'
->({
- name: 'registration_events_by_subnet',
- columns: REGISTRATION_EVENT_BY_SUBNET_COLUMNS,
- primaryKey: ['subnet', 'created_at', 'user_id'],
- partitionKey: ['subnet'],
- defaultTtlSeconds: seconds('30 days'),
-});
-export const RegistrationEventsByEmailDomain = defineTable<
- RegistrationEventByEmailDomainRow,
- 'email_domain' | 'created_at' | 'user_id',
- 'email_domain'
->({
- name: 'registration_events_by_email_domain',
- columns: REGISTRATION_EVENT_BY_EMAIL_DOMAIN_COLUMNS,
- primaryKey: ['email_domain', 'created_at', 'user_id'],
- partitionKey: ['email_domain'],
- defaultTtlSeconds: seconds('30 days'),
-});
-export const RegistrationEventsByPlusAddressBase = defineTable<
- RegistrationEventByPlusAddressBaseRow,
- 'plus_address_base' | 'created_at' | 'user_id',
- 'plus_address_base'
->({
- name: 'registration_events_by_plus_address_base',
- columns: REGISTRATION_EVENT_BY_PLUS_ADDRESS_BASE_COLUMNS,
- primaryKey: ['plus_address_base', 'created_at', 'user_id'],
- partitionKey: ['plus_address_base'],
- defaultTtlSeconds: seconds('30 days'),
-});
-export const LatestRiskContextByUser = defineTable<LatestRiskContextByUserRow, 'user_id'>({
- name: 'latest_risk_context_by_user',
- columns: LATEST_RISK_CONTEXT_BY_USER_COLUMNS,
- primaryKey: ['user_id'],
-});
-export const SuspiciousIps = defineTable<SuspiciousIpRow, 'ip'>({
- name: 'suspicious_ips',
- columns: SUSPICIOUS_IP_COLUMNS,
- primaryKey: ['ip'],
- defaultTtlSeconds: seconds('180 days'),
-});
-export const RiskOutcomesByIp = defineTable<RiskOutcomeByIpRow, 'ip' | 'created_at' | 'user_id' | 'outcome_code', 'ip'>(
- {
- name: 'risk_outcomes_by_ip',
- columns: RISK_OUTCOME_BY_IP_COLUMNS,
- primaryKey: ['ip', 'created_at', 'user_id', 'outcome_code'],
- partitionKey: ['ip'],
- defaultTtlSeconds: seconds('180 days'),
- },
-);
-export const RiskOutcomesBySubnet = defineTable<
- RiskOutcomeBySubnetRow,
- 'subnet' | 'created_at' | 'user_id' | 'outcome_code',
- 'subnet'
->({
- name: 'risk_outcomes_by_subnet',
- columns: RISK_OUTCOME_BY_SUBNET_COLUMNS,
- primaryKey: ['subnet', 'created_at', 'user_id', 'outcome_code'],
- partitionKey: ['subnet'],
- defaultTtlSeconds: seconds('180 days'),
-});
-export const RiskOutcomesByEmailDomain = defineTable<
- RiskOutcomeByEmailDomainRow,
- 'email_domain' | 'created_at' | 'user_id' | 'outcome_code',
- 'email_domain'
->({
- name: 'risk_outcomes_by_email_domain',
- columns: RISK_OUTCOME_BY_EMAIL_DOMAIN_COLUMNS,
- primaryKey: ['email_domain', 'created_at', 'user_id', 'outcome_code'],
- partitionKey: ['email_domain'],
- defaultTtlSeconds: seconds('180 days'),
-});
-export const RiskOutcomesByAsn = defineTable<
- RiskOutcomeByAsnRow,
- 'asn' | 'created_at' | 'user_id' | 'outcome_code',
- 'asn'
->({
- name: 'risk_outcomes_by_asn',
- columns: RISK_OUTCOME_BY_ASN_COLUMNS,
- primaryKey: ['asn', 'created_at', 'user_id', 'outcome_code'],
- partitionKey: ['asn'],
- defaultTtlSeconds: seconds('180 days'),
-});
-export const RiskAssessments = defineTable<RiskAssessmentRow, 'assessment_id'>({
- name: 'risk_assessments',
- columns: RISK_ASSESSMENT_COLUMNS,
- primaryKey: ['assessment_id'],
-});
-export const RiskAssessmentsByUser = defineTable<RiskAssessmentByUserRow, 'user_id' | 'created_at', 'user_id'>({
- name: 'risk_assessments_by_user',
- columns: RISK_ASSESSMENT_BY_USER_COLUMNS,
- primaryKey: ['user_id', 'created_at'],
- partitionKey: ['user_id'],
-});
-export const InboundSmsChallenges = defineTable<InboundSmsChallengeRow, 'challenge_code'>({
- name: 'inbound_sms_challenges',
- columns: INBOUND_SMS_CHALLENGE_COLUMNS,
- primaryKey: ['challenge_code'],
- defaultTtlSeconds: seconds('15 minutes'),
-});
-export const InboundSmsChallengesByUser = defineTable<
- InboundSmsChallengeByUserRow,
- 'user_id' | 'created_at',
- 'user_id'
->({
- name: 'inbound_sms_challenges_by_user',
- columns: INBOUND_SMS_CHALLENGE_BY_USER_COLUMNS,
- primaryKey: ['user_id', 'created_at'],
- partitionKey: ['user_id'],
- defaultTtlSeconds: seconds('15 minutes'),
-});
-export const PhoneLookupCache = defineTable<PhoneLookupCacheRow, 'phone'>({
- name: 'phone_lookup_cache',
- columns: PHONE_LOOKUP_CACHE_COLUMNS,
- primaryKey: ['phone'],
- defaultTtlSeconds: seconds('7 days'),
-});
-export const PhoneVerificationAttempts = defineTable<PhoneVerificationAttemptRow, 'attempt_id'>({
- name: 'phone_verification_attempts',
- columns: PHONE_VERIFICATION_ATTEMPT_COLUMNS,
- primaryKey: ['attempt_id'],
- defaultTtlSeconds: seconds('90 days'),
-});
export const BillingCustomers = defineTable<BillingCustomerRow, 'provider_id'>({
name: 'billing_customers',
columns: BILLING_CUSTOMER_COLUMNS,
diff --git a/fluxer_api/src/api/admin/AdminRepository.ts b/fluxer_api/src/api/admin/AdminRepository.ts
index 92bfcccc0..e5317a8b2 100644
--- a/fluxer_api/src/api/admin/AdminRepository.ts
+++ b/fluxer_api/src/api/admin/AdminRepository.ts
@@ -2,7 +2,7 @@
import type {AdminAuditLog, BannedIpEntry, BannedIpKind, IAdminRepository} from '@app/api/admin/IAdminRepository';
import {createUserID} from '@app/api/BrandedTypes';
-import {Config} from '@app/api/Config';
+import {isIpBanExempt} from '@app/api/ban/IpBanExemptions';
import {ContentBlocklistCategory} from '@app/api/constants/ContentModeration';
import {
deleteOneOrMany,
@@ -20,21 +20,16 @@ import type {
BannedUrlDomainRow,
BannedUrlRow,
} from '@app/api/database/types/AdminArchiveTypes';
-import {isAccountPolicyContactDomainReputationExempt} from '@app/api/risk/AccountPolicyService';
-import {isIpBanExempt} from '@app/api/risk/IpBanExemptions';
import {
AdminAuditLogs,
BannedAvatarHashes,
BannedEmails,
BannedFileShas,
BannedIps,
- BannedPhonePrefixes,
BannedPhrases,
BannedProfileSubstrings,
BannedUrlDomains,
BannedUrls,
- DisposableEmailDomains,
- SuspiciousEmailDomains,
} from '@app/api/Tables';
import {parseIpBanEntry, tryParseSingleIp} from '@app/api/utils/IpRangeUtils';
import {canonicalizeStoredPhrase} from '@app/api/utils/PhraseBlocklistNormalization';
@@ -51,20 +46,10 @@ const IS_EMAIL_BANNED_QUERY = BannedEmails.select({
where: BannedEmails.where.eq('email_lower'),
});
const LOAD_ALL_BANNED_EMAILS_QUERY = BannedEmails.select();
-const IS_EMAIL_DOMAIN_SUSPICIOUS_QUERY = SuspiciousEmailDomains.select({
- where: SuspiciousEmailDomains.where.eq('domain'),
-});
-const LOAD_ALL_SUSPICIOUS_EMAIL_DOMAINS_QUERY = SuspiciousEmailDomains.select();
-const IS_EMAIL_DOMAIN_DISPOSABLE_QUERY = DisposableEmailDomains.select({
- where: DisposableEmailDomains.where.eq('domain'),
-});
-const createLoadDisposableEmailDomainsQuery = (limit?: number) =>
- limit ? DisposableEmailDomains.select({limit}) : DisposableEmailDomains.select();
const IS_PHRASE_BANNED_QUERY = BannedPhrases.select({
where: BannedPhrases.where.eq('phrase'),
});
const LOAD_ALL_BANNED_PHRASES_QUERY = BannedPhrases.select();
-const LOAD_ALL_BANNED_PHONE_PREFIXES_QUERY = BannedPhonePrefixes.select();
const IS_URL_BANNED_QUERY = BannedUrls.select({
where: BannedUrls.where.eq('url_canonical'),
});
@@ -263,59 +248,6 @@ export class AdminRepository implements IAdminRepository {
return rows.map((row) => row.email_lower);
}
- async isEmailDomainSuspicious(domain: string): Promise<boolean> {
- const domainLower = domain.toLowerCase();
- if (isAccountPolicyContactDomainReputationExempt(domainLower)) return false;
- const result = await fetchOne<{
- domain: string;
- }>(IS_EMAIL_DOMAIN_SUSPICIOUS_QUERY.bind({domain: domainLower}));
- return !!result;
- }
-
- async addSuspiciousEmailDomain(domain: string): Promise<void> {
- const domainLower = domain.toLowerCase();
- await upsertOne(SuspiciousEmailDomains.insert({domain: domainLower}));
- }
-
- async removeSuspiciousEmailDomain(domain: string): Promise<void> {
- const domainLower = domain.toLowerCase();
- await deleteOneOrMany(SuspiciousEmailDomains.deleteByPk({domain: domainLower}));
- }
-
- async loadAllSuspiciousEmailDomains(): Promise<Array<string>> {
- const rows = await fetchMany<{
- domain: string;
- }>(LOAD_ALL_SUSPICIOUS_EMAIL_DOMAINS_QUERY.bind({}));
- return rows.map((row) => row.domain);
- }
-
- async isEmailDomainDisposable(domain: string): Promise<boolean> {
- if (!Config.blocklistFeeds.enabled) return false;
- const domainLower = domain.toLowerCase();
- if (isAccountPolicyContactDomainReputationExempt(domainLower)) return false;
- const result = await fetchOne<{
- domain: string;
- }>(IS_EMAIL_DOMAIN_DISPOSABLE_QUERY.bind({domain: domainLower}));
- return !!result;
- }
-
- async addDisposableEmailDomain(domain: string): Promise<void> {
- const domainLower = domain.toLowerCase();
- await upsertOne(DisposableEmailDomains.insert({domain: domainLower}));
- }
-
- async removeDisposableEmailDomain(domain: string): Promise<void> {
- const domainLower = domain.toLowerCase();
- await deleteOneOrMany(DisposableEmailDomains.deleteByPk({domain: domainLower}));
- }
-
- async listDisposableEmailDomains(limit?: number): Promise<Array<string>> {
- const rows = await fetchMany<{
- domain: string;
- }>(createLoadDisposableEmailDomainsQuery(limit).bind({}));
- return rows.map((row) => row.domain);
- }
-
async isPhraseBanned(phrase: string): Promise<boolean> {
const phraseLower = canonicalizeStoredPhrase(phrase);
const result = await fetchOne<{
@@ -341,13 +273,6 @@ export class AdminRepository implements IAdminRepository {
return rows.map((row) => row.phrase);
}
- async loadAllBannedPhonePrefixes(): Promise<Array<string>> {
- const rows = await fetchMany<{
- prefix: string;
- }>(LOAD_ALL_BANNED_PHONE_PREFIXES_QUERY.bind({}));
- return rows.map((row) => row.prefix);
- }
-
async isUrlBanned(url: string): Promise<boolean> {
const canonical = url.toLowerCase();
const result = await fetchOne<{
diff --git a/fluxer_api/src/api/admin/AdminService.ts b/fluxer_api/src/api/admin/AdminService.ts
index f87d5e2a0..588f82acc 100644
--- a/fluxer_api/src/api/admin/AdminService.ts
+++ b/fluxer_api/src/api/admin/AdminService.ts
@@ -37,8 +37,6 @@ import {
} from '@app/api/middleware/ServiceSingletons';
import type {IApplicationRepository} from '@app/api/oauth/repositories/IApplicationRepository';
import type {ReportService} from '@app/api/report/ReportService';
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import type {ISuspiciousIpRepository} from '@app/api/risk/SuspiciousIpRepository';
import type {UserService} from '@app/api/user/services/UserService';
import type {VoiceRepository} from '@app/api/voice/VoiceRepository';
import type {SendSystemDmResponse} from '@fluxer/schema/src/domains/admin/AdminSchemas';
@@ -81,10 +79,8 @@ export class AdminService {
private readonly bulkMessageDeletionQueue: KVBulkMessageDeletionQueueService,
private readonly applicationRepository: IApplicationRepository,
private readonly stripe: Stripe | null = null,
- private readonly riskHistoryRepository: Pick<IRiskHistoryRepository, 'recordOutcomeForUser'>,
private readonly jobLedger: IJobLedgerRepository,
private readonly ipInfoService: IpInfoService,
- private readonly suspiciousIpRepository: ISuspiciousIpRepository,
) {
const {users, gateway, worker, snowflake} = this.apiContext.services;
this.auditService = new AdminAuditService(this.adminRepository, snowflake, {
@@ -97,7 +93,6 @@ export class AdminService {
adminRepository: this.adminRepository,
auditService: this.auditService,
ipInfoService: this.ipInfoService,
- suspiciousIpRepository: this.suspiciousIpRepository,
});
this.userService = new AdminUserService({
apiContext: this.apiContext,
@@ -111,7 +106,6 @@ export class AdminService {
kvDeletionQueue: getKVAccountDeletionQueue(),
bulkMessageDeletionQueue: this.bulkMessageDeletionQueue,
stripe: this.stripe,
- riskHistoryRepository: this.riskHistoryRepository,
reportService: this.reportService,
});
this.guildServiceAggregate = new AdminGuildService({
diff --git a/fluxer_api/src/api/admin/IAdminRepository.ts b/fluxer_api/src/api/admin/IAdminRepository.ts
index f6892f6cd..5b0214260 100644
--- a/fluxer_api/src/api/admin/IAdminRepository.ts
+++ b/fluxer_api/src/api/admin/IAdminRepository.ts
@@ -59,22 +59,6 @@ export abstract class IAdminRepository {
abstract loadAllBannedEmails(): Promise<Array<string>>;
- abstract isEmailDomainSuspicious(domain: string): Promise<boolean>;
-
- abstract addSuspiciousEmailDomain(domain: string): Promise<void>;
-
- abstract removeSuspiciousEmailDomain(domain: string): Promise<void>;
-
- abstract loadAllSuspiciousEmailDomains(): Promise<Array<string>>;
-
- abstract isEmailDomainDisposable(domain: string): Promise<boolean>;
-
- abstract addDisposableEmailDomain(domain: string): Promise<void>;
-
- abstract removeDisposableEmailDomain(domain: string): Promise<void>;
-
- abstract listDisposableEmailDomains(limit?: number): Promise<Array<string>>;
-
abstract isPhraseBanned(phrase: string): Promise<boolean>;
abstract banPhrase(phrase: string): Promise<void>;
@@ -83,8 +67,6 @@ export abstract class IAdminRepository {
abstract loadAllBannedPhrases(): Promise<Array<string>>;
- abstract loadAllBannedPhonePrefixes(): Promise<Array<string>>;
-
abstract loadAllBannedIps(): Promise<Set<string>>;
abstract isUrlBanned(url: string): Promise<boolean>;
diff --git a/fluxer_api/src/api/admin/controllers/BanAdminController.ts b/fluxer_api/src/api/admin/controllers/BanAdminController.ts
index da85a2c41..e7e6b9c89 100644
--- a/fluxer_api/src/api/admin/controllers/BanAdminController.ts
+++ b/fluxer_api/src/api/admin/controllers/BanAdminController.ts
@@ -47,7 +47,6 @@ import {
BulkBanFileShasRequest,
BulkJobResponse,
CheckAvatarHashRequest,
- SuspiciousEmailDomainRequest,
} from '@fluxer/schema/src/domains/admin/AdminSchemas';
import {UserIdParam} from '@fluxer/schema/src/domains/common/CommonParamSchemas';
import type {ZodType} from 'zod';
@@ -76,17 +75,6 @@ const BLOCKLIST_CATALOG = [
supports_bulk_delete: false,
supports_update: false,
},
- {
- list_type: 'email-domain-suspicious' as const,
- description:
- 'Email domains flagged as suspicious. Registration is not blocked, but new accounts using the domain must verify a phone number before they can act on the platform. The list itself is not exposed to users.',
- value_field: 'domain',
- fields: [],
- scoped: false,
- supports_bulk_create: false,
- supports_bulk_delete: false,
- supports_update: false,
- },
{
list_type: 'phrase' as const,
description:
@@ -154,11 +142,6 @@ const BLOCKLIST_CATALOG = [
const BLOCKLIST_TYPE_ACLS: Record<AdminBlocklistListType, {add: string; check: string; remove: string}> = {
ip: {add: AdminACLs.BAN_IP_ADD, check: AdminACLs.BAN_IP_CHECK, remove: AdminACLs.BAN_IP_REMOVE},
email: {add: AdminACLs.BAN_EMAIL_ADD, check: AdminACLs.BAN_EMAIL_CHECK, remove: AdminACLs.BAN_EMAIL_REMOVE},
- 'email-domain-suspicious': {
- add: AdminACLs.SUSPICIOUS_EMAIL_DOMAIN_ADD,
- check: AdminACLs.SUSPICIOUS_EMAIL_DOMAIN_CHECK,
- remove: AdminACLs.SUSPICIOUS_EMAIL_DOMAIN_REMOVE,
- },
phrase: {add: AdminACLs.BAN_PHRASE_ADD, check: AdminACLs.BAN_PHRASE_CHECK, remove: AdminACLs.BAN_PHRASE_REMOVE},
url: {add: AdminACLs.BAN_URL_ADD, check: AdminACLs.BAN_URL_CHECK, remove: AdminACLs.BAN_URL_REMOVE},
'url-domain': {
@@ -186,7 +169,6 @@ const BLOCKLIST_TYPE_ACLS: Record<AdminBlocklistListType, {add: string; check: s
const BLOCKLIST_AUDIT_TARGET_TYPES: Record<AdminBlocklistListType, string> = {
ip: 'ip',
email: 'email',
- 'email-domain-suspicious': 'email_domain',
phrase: 'phrase',
url: 'url',
'url-domain': 'url_domain',
@@ -255,8 +237,6 @@ async function checkBlocklistEntry(
return bans.checkIpBan({ip: entryValue});
case 'email':
return bans.checkEmailBan({email: entryValue});
- case 'email-domain-suspicious':
- return bans.checkSuspiciousEmailDomain({domain: entryValue});
case 'phrase':
return bans.checkPhraseBan({phrase: entryValue});
case 'url':
@@ -375,13 +355,6 @@ export function BanAdminController(app: HonoApp) {
case 'email':
await bans.banEmail(await parseBlocklistBody(BanEmailRequest, raw), adminUserId, auditLogReason);
break;
- case 'email-domain-suspicious':
- await bans.addSuspiciousEmailDomain(
- await parseBlocklistBody(SuspiciousEmailDomainRequest, raw),
- adminUserId,
- auditLogReason,
- );
- break;
case 'phrase':
await bans.banPhrase(await parseBlocklistBody(BanPhraseRequest, raw), adminUserId, auditLogReason);
break;
@@ -624,9 +597,6 @@ export function BanAdminController(app: HonoApp) {
case 'email':
await bans.unbanEmail({email: entryValue}, adminUserId, auditLogReason);
break;
- case 'email-domain-suspicious':
- await bans.removeSuspiciousEmailDomain({domain: entryValue}, adminUserId, auditLogReason);
- break;
case 'phrase':
await bans.unbanPhrase({phrase: entryValue}, adminUserId, auditLogReason);
break;
diff --git a/fluxer_api/src/api/admin/controllers/InstanceConfigAdminController.ts b/fluxer_api/src/api/admin/controllers/InstanceConfigAdminController.ts
index ed7002043..bc6b7eae1 100644
--- a/fluxer_api/src/api/admin/controllers/InstanceConfigAdminController.ts
+++ b/fluxer_api/src/api/admin/controllers/InstanceConfigAdminController.ts
@@ -135,11 +135,6 @@ async function buildInstanceConfigResponse(): Promise<InstanceConfigResponse> {
youtube_enabled: policy.youtube_enabled,
bluesky_enabled: policy.bluesky_enabled,
},
- deferred_phone_gate: {
- enabled: policy.deferred_phone_gate_enabled,
- window_hours: policy.deferred_phone_gate_window_hours,
- member_threshold: policy.deferred_phone_gate_member_threshold,
- },
services_resolved: resolvedServices,
services_available: {
gif: integrations.gif.effective_available,
@@ -879,17 +874,6 @@ function planInstancePolicyPatch(
patch.bluesky_enabled = policy.services.bluesky_enabled ?? null;
}
}
- if (policy.deferred_phone_gate) {
- if (policy.deferred_phone_gate.enabled !== undefined) {
- patch.deferred_phone_gate_enabled = policy.deferred_phone_gate.enabled;
- }
- if (policy.deferred_phone_gate.window_hours !== undefined) {
- patch.deferred_phone_gate_window_hours = policy.deferred_phone_gate.window_hours;
- }
- if (policy.deferred_phone_gate.member_threshold !== undefined) {
- patch.deferred_phone_gate_member_threshold = policy.deferred_phone_gate.member_threshold;
- }
- }
return {patch, enablesSingleCommunity};
}
diff --git a/fluxer_api/src/api/admin/controllers/UserAdminController.ts b/fluxer_api/src/api/admin/controllers/UserAdminController.ts
index 7f03c5c1b..210b0e5a7 100644
--- a/fluxer_api/src/api/admin/controllers/UserAdminController.ts
+++ b/fluxer_api/src/api/admin/controllers/UserAdminController.ts
@@ -17,10 +17,12 @@ import {SearchUsersResponse} from '@fluxer/schema/src/domains/admin/AdminSchemas
import {
AdminAclListResponse,
AdminUserAclsRequest,
+ AdminUserBanNoteRequest,
AdminUserBanRequest,
AdminUserBotStatusRequest,
AdminUserChangeLogQuery,
AdminUserClearFieldsRequest,
+ AdminUserDeletionCancelRequest,
AdminUserDeletionScheduleRequest,
AdminUserDmChannelListQuery,
AdminUserDmChannelListResponse,
@@ -872,6 +874,30 @@ export function UserAdminController(app: HonoApp) {
);
},
);
+ app.post(
+ '/admin/users/:user_id/ban/notes',
+ RateLimitMiddleware(RateLimitConfigs.ADMIN_USER_MODIFY),
+ requireAdminACL(AdminACLs.USER_TEMP_BAN),
+ Validator('param', UserIdParam),
+ Validator('json', AdminUserBanNoteRequest),
+ OpenAPI({
+ operationId: 'annotate_admin_user_ban',
+ summary: 'Add a note to a user ban',
+ responseSchema: null,
+ statusCode: 204,
+ security: 'adminApiKey',
+ tags: 'Admin',
+ description:
+ 'Append a note to the current ban of a user. The note is recorded as the reason of a new annotate_ban audit log entry whose metadata names the ban audit log entry. Earlier entries are never changed. Requires USER_TEMP_BAN permission.',
+ }),
+ async (ctx) => {
+ const adminService = ctx.get('adminService');
+ const adminUserId = ctx.get('adminUserId');
+ const {user_id: userId} = ctx.req.valid('param');
+ await adminService.userService.banService.annotateBan({user_id: userId, ...ctx.req.valid('json')}, adminUserId);
+ return ctx.body(null, 204);
+ },
+ );
app.put(
'/admin/users/:user_id/deletion',
RateLimitMiddleware(RateLimitConfigs.ADMIN_USER_MODIFY),
@@ -886,7 +912,7 @@ export function UserAdminController(app: HonoApp) {
security: 'adminApiKey',
tags: 'Admin',
description:
- 'Schedule user account for deletion after grace period. Account will be fully deleted with all content unless cancellation is executed. Creates audit log entry. Requires USER_DELETE permission.',
+ 'Schedule user account for deletion after grace period. Account will be fully deleted with all content unless cancellation is executed. When a deletion is already scheduled, the request must name it in replace_pending_deletion_at or it returns 409. Records who scheduled the deletion. Creates audit log entry. Requires USER_DELETE permission.',
}),
async (ctx) => {
const adminService = ctx.get('adminService');
@@ -909,6 +935,7 @@ export function UserAdminController(app: HonoApp) {
RateLimitMiddleware(RateLimitConfigs.ADMIN_USER_MODIFY),
requireAdminACL(AdminACLs.USER_DELETE),
Validator('param', UserIdParam),
+ Validator('json', AdminUserDeletionCancelRequest),
OpenAPI({
operationId: 'cancel_admin_user_deletion',
summary: 'Cancel user deletion',
@@ -917,7 +944,7 @@ export function UserAdminController(app: HonoApp) {
security: 'adminApiKey',
tags: 'Admin',
description:
- 'Cancel a scheduled account deletion. User account restoration prevents data loss. Creates audit log entry. Requires USER_DELETE permission.',
+ 'Cancel the scheduled account deletion named by expected_pending_deletion_at. Returns 409 when a different deletion is pending and 400 when none is. The user is emailed only when notify_user is true, and the email never includes the audit log reason. Creates audit log entry recording the cancelled deletion. Requires USER_DELETE permission.',
}),
async (ctx) => {
const adminService = ctx.get('adminService');
@@ -927,7 +954,7 @@ export function UserAdminController(app: HonoApp) {
const {user_id: userId} = ctx.req.valid('param');
return ctx.json(
await adminService.userService.deletionService.cancelAccountDeletion(
- {user_id: userId},
+ {user_id: userId, ...ctx.req.valid('json')},
adminUserId,
auditLogReason,
adminUserAcls,
diff --git a/fluxer_api/src/api/admin/models/UserTypes.ts b/fluxer_api/src/api/admin/models/UserTypes.ts
index 5591f450a..fca8b9fb6 100644
--- a/fluxer_api/src/api/admin/models/UserTypes.ts
+++ b/fluxer_api/src/api/admin/models/UserTypes.ts
@@ -20,6 +20,7 @@ export async function mapUserToAdminResponse(
const canViewEmail = !acls || hasAcl(acls, AdminACLs.USER_VIEW_EMAIL);
const canViewDob = !acls || hasAcl(acls, AdminACLs.USER_VIEW_DOB);
const canViewIp = !acls || hasAcl(acls, AdminACLs.USER_VIEW_IP);
+ const canViewAuditLog = !acls || hasAcl(acls, AdminACLs.AUDIT_LOG_VIEW);
const lastActiveIpReverse =
canViewIp && user.lastActiveIp ? await getIpAddressReverse(user.lastActiveIp, cacheService) : null;
let lastActiveLocation: string | null = null;
@@ -65,6 +66,9 @@ export async function mapUserToAdminResponse(
pending_bulk_message_deletion_at: user.pendingBulkMessageDeletionAt?.toISOString() ?? null,
deletion_reason_code: user.deletionReasonCode,
deletion_public_reason: user.deletionPublicReason,
+ deletion_audit_log_reason: canViewAuditLog ? user.deletionAuditLogReason : null,
+ deletion_scheduled_by: user.deletionScheduledBy?.toString() ?? null,
+ deletion_scheduled_at: user.deletionScheduledAt?.toISOString() ?? null,
acls: user.acls ? Array.from(user.acls) : [],
traits: Array.from(user.traits).sort(),
has_totp: user.totpSecret !== null,
diff --git a/fluxer_api/src/api/admin/services/AdminAuditService.ts b/fluxer_api/src/api/admin/services/AdminAuditService.ts
index efca62d28..21fb2e8c9 100644
--- a/fluxer_api/src/api/admin/services/AdminAuditService.ts
+++ b/fluxer_api/src/api/admin/services/AdminAuditService.ts
@@ -65,6 +65,10 @@ export class AdminAuditService {
}
}
+ async findAuditLog(logId: bigint): Promise<AdminAuditLog | null> {
+ return this.adminRepository.getAuditLog(logId);
+ }
+
async getAuditLog(logId: bigint): Promise<AdminAuditLogResponse | null> {
const log = await this.adminRepository.getAuditLog(logId);
if (!log) {
diff --git a/fluxer_api/src/api/admin/services/AdminBanManagementService.ts b/fluxer_api/src/api/admin/services/AdminBanManagementService.ts
index 6c9638fce..0e87ace6e 100644
--- a/fluxer_api/src/api/admin/services/AdminBanManagementService.ts
+++ b/fluxer_api/src/api/admin/services/AdminBanManagementService.ts
@@ -4,6 +4,8 @@ import type {ApiContext} from '@app/api/ApiContext';
import type {IAdminRepository} from '@app/api/admin/IAdminRepository';
import type {AdminAuditService} from '@app/api/admin/services/AdminAuditService';
import {createUserID, type UserID} from '@app/api/BrandedTypes';
+import {getIpBanBlastRadiusVerdict, isSingleIpBanCandidate} from '@app/api/ban/IpBanCgnatGuard';
+import {isIpBanExempt} from '@app/api/ban/IpBanExemptions';
import {
BANNED_AVATAR_HASHES_REFRESH_CHANNEL,
BANNED_FILE_SHAS_REFRESH_CHANNEL,
@@ -23,14 +25,6 @@ import {ipBanCache} from '@app/api/middleware/IpBanMiddleware';
import {phraseBlocklistCache} from '@app/api/middleware/PhraseBlocklistCache';
import {profileSubstringBlocklistCache} from '@app/api/middleware/ProfileSubstringBlocklistCache';
import {urlBlocklistCache} from '@app/api/middleware/UrlBlocklistCache';
-import {
- getIpBanBlastRadiusVerdict,
- getSuspiciousIpSkipReason,
- isSingleIpBanCandidate,
-} from '@app/api/risk/IpBanCgnatGuard';
-import {isIpBanExempt} from '@app/api/risk/IpBanExemptions';
-import type {ISuspiciousIpRepository} from '@app/api/risk/SuspiciousIpRepository';
-import {tryParseSingleIp} from '@app/api/utils/IpRangeUtils';
import {canonicalizeStoredPhrase} from '@app/api/utils/PhraseBlocklistNormalization';
import {canonicalizeUrl} from '@app/api/utils/UrlNormalizer';
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
@@ -40,14 +34,13 @@ import {InputValidationError} from '@fluxer/errors/src/domains/core/InputValidat
import {NotFoundError} from '@fluxer/errors/src/domains/core/NotFoundError';
import {UnknownUserError} from '@fluxer/errors/src/domains/user/UnknownUserError';
import type {AdminBlocklistListType} from '@fluxer/schema/src/domains/admin/AdminBlocklistSchemas';
-import type {IpInfoLookupResult, IpInfoService} from '@pkgs/geoip/src/IpInfoService';
+import type {IpInfoService} from '@pkgs/geoip/src/IpInfoService';
interface AdminBanManagementServiceDeps {
apiContext: ApiContext;
adminRepository: IAdminRepository;
auditService: AdminAuditService;
ipInfoService: IpInfoService;
- suspiciousIpRepository: ISuspiciousIpRepository;
}
interface AdminBlocklistEntry {
@@ -207,86 +200,6 @@ export class AdminBanManagementService {
return {banned};
}
- async markSuspiciousIpForScheduledDeletion(
- data: {
- ip: string;
- sourceUserId: UserID;
- deletionReasonCode: number;
- },
- adminUserId: UserID,
- auditLogReason: string | null,
- ): Promise<void> {
- const parsed = tryParseSingleIp(data.ip);
- if (!parsed) {
- await this.deps.auditService.createAuditLog({
- adminUserId,
- targetType: 'ip',
- targetId: BigInt(0),
- action: 'mark_suspicious_ip_skipped_invalid',
- auditLogReason,
- metadata: new Map([['ip', data.ip]]),
- });
- return;
- }
- let info: IpInfoLookupResult;
- try {
- info = await this.deps.ipInfoService.lookup(parsed.canonical, {
- source: 'admin.scheduled_deletion_suspicious_ip',
- reason: 'pre_write_suspicious_ip_guard',
- metadata: {
- source_user_id: data.sourceUserId.toString(),
- deletion_reason_code: data.deletionReasonCode,
- },
- });
- } catch (error) {
- Logger.warn({error, ip: parsed.canonical}, 'IPInfo guard failed while marking suspicious IP');
- return;
- }
- const skipReason = getSuspiciousIpSkipReason(info);
- if (skipReason) {
- Logger.info({ip: parsed.canonical, skipReason}, 'Skipping suspicious IP marker from scheduled deletion');
- await this.deps.auditService.createAuditLog({
- adminUserId,
- targetType: 'ip',
- targetId: BigInt(0),
- action: `mark_suspicious_ip_skipped_${skipReason}`,
- auditLogReason,
- metadata: new Map([
- ['ip', parsed.canonical],
- ['source_user_id', data.sourceUserId.toString()],
- ['deletion_reason_code', data.deletionReasonCode.toString()],
- ['provider_name', info.anonymous.providerName ?? ''],
- ]),
- });
- return;
- }
- await this.deps.suspiciousIpRepository.markSuspiciousIp({
- ip: parsed.canonical,
- source: 'scheduled_deletion',
- reason: 'account_scheduled_for_deletion',
- sourceUserId: data.sourceUserId,
- deletionReasonCode: data.deletionReasonCode,
- providerName: info.anonymous.providerName,
- asn: info.asn.number,
- asnName: info.asn.name,
- asnType: info.asn.type,
- riskNote: info.riskNote,
- });
- await this.deps.auditService.createAuditLog({
- adminUserId,
- targetType: 'ip',
- targetId: BigInt(0),
- action: 'mark_suspicious_ip',
- auditLogReason,
- metadata: new Map([
- ['ip', parsed.canonical],
- ['source_user_id', data.sourceUserId.toString()],
- ['deletion_reason_code', data.deletionReasonCode.toString()],
- ['provider_name', info.anonymous.providerName ?? ''],
- ]),
- });
- }
-
private async shouldSkipIpBanForCgnat(ip: string): Promise<boolean> {
if (!isSingleIpBanCandidate(ip)) {
return false;
@@ -350,50 +263,6 @@ export class AdminBanManagementService {
return {banned};
}
- async addSuspiciousEmailDomain(
- data: {
- domain: string;
- },
- adminUserId: UserID,
- auditLogReason: string | null,
- ) {
- const {adminRepository} = this.deps;
- await adminRepository.addSuspiciousEmailDomain(data.domain);
- await this.createBlocklistAuditLog({
- adminUserId,
- targetType: 'email_domain',
- action: 'add_suspicious_email_domain',
- auditLogReason,
- metadata: new Map([['domain', data.domain]]),
- });
- }
-
- async removeSuspiciousEmailDomain(
- data: {
- domain: string;
- },
- adminUserId: UserID,
- auditLogReason: string | null,
- ) {
- const {adminRepository} = this.deps;
- await adminRepository.removeSuspiciousEmailDomain(data.domain);
- await this.createBlocklistAuditLog({
- adminUserId,
- targetType: 'email_domain',
- action: 'remove_suspicious_email_domain',
- auditLogReason,
- metadata: new Map([['domain', data.domain]]),
- });
- }
-
- async checkSuspiciousEmailDomain(data: {domain: string}): Promise<{
- banned: boolean;
- }> {
- const {adminRepository} = this.deps;
- const banned = await adminRepository.isEmailDomainSuspicious(data.domain);
- return {banned};
- }
-
async banPhrase(
data: {
phrase: string;
@@ -872,10 +741,6 @@ export class AdminBanManagementService {
const rows = await adminRepository.loadAllBannedEmails();
return rows.map((value) => createBlocklistEntry(listType, value));
}
- case 'email-domain-suspicious': {
- const rows = await adminRepository.loadAllSuspiciousEmailDomains();
- return rows.map((value) => createBlocklistEntry(listType, value));
- }
case 'phrase': {
const rows = await adminRepository.loadAllBannedPhrases();
return rows.map((value) => createBlocklistEntry(listType, value));
diff --git a/fluxer_api/src/api/admin/services/AdminUserBanService.ts b/fluxer_api/src/api/admin/services/AdminUserBanService.ts
index 2336fb147..8e988a440 100644
--- a/fluxer_api/src/api/admin/services/AdminUserBanService.ts
+++ b/fluxer_api/src/api/admin/services/AdminUserBanService.ts
@@ -6,9 +6,13 @@ import type {AdminAuditService} from '@app/api/admin/services/AdminAuditService'
import type {AdminUserUpdatePropagator} from '@app/api/admin/services/AdminUserUpdatePropagator';
import * as AuthSession from '@app/api/auth/AuthSession';
import {createUserID, type UserID} from '@app/api/BrandedTypes';
+import {emitAdminAction} from '@app/api/infrastructure/activity/AccountChangeEvents';
+import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
import {UserFlags} from '@fluxer/constants/src/UserConstants';
+import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';
+import {ConflictError} from '@fluxer/errors/src/domains/core/ConflictError';
import {UnknownUserError} from '@fluxer/errors/src/domains/user/UnknownUserError';
-import type {TempBanUserRequest} from '@fluxer/schema/src/domains/admin/AdminUserSchemas';
+import type {AdminUserBanNoteRequest, TempBanUserRequest} from '@fluxer/schema/src/domains/admin/AdminUserSchemas';
interface AdminUserBanServiceDeps {
apiContext: ApiContext;
@@ -70,11 +74,49 @@ export class AdminUserBanService {
['banned_until', tempBannedUntil.toISOString()],
]),
});
+ await emitAdminAction(adminUserId, userId, 'temp_ban', {durationHours: data.duration_hours});
return {
user: await mapUserToAdminResponse(updatedUser, cacheService, acls),
};
}
+ async annotateBan(data: AdminUserBanNoteRequest & {user_id: bigint}, adminUserId: UserID): Promise<void> {
+ const {users: userRepository} = this.deps.apiContext.services;
+ const {auditService} = this.deps;
+ const userId = createUserID(data.user_id);
+ const user = await userRepository.findUnique(userId);
+ if (!user) {
+ throw new UnknownUserError();
+ }
+ const banLog = await auditService.findAuditLog(data.ban_audit_log_id);
+ if (banLog?.action !== 'temp_ban' || banLog.targetType !== 'user' || banLog.targetId !== BigInt(userId)) {
+ throw new BadRequestError({
+ code: APIErrorCodes.INVALID_FORM_BODY,
+ message: 'ban_audit_log_id does not name a ban of this user',
+ });
+ }
+ const bannedUntil = user.tempBannedUntil;
+ if (
+ (user.flags & UserFlags.DISABLED) === 0n ||
+ !bannedUntil ||
+ bannedUntil.getTime() <= Date.now() ||
+ banLog.metadata.get('banned_until') !== bannedUntil.toISOString()
+ ) {
+ throw new ConflictError({
+ code: APIErrorCodes.CONFLICT,
+ message: 'ban_audit_log_id does not name the current ban of this user',
+ });
+ }
+ await auditService.createAuditLog({
+ adminUserId,
+ targetType: 'user',
+ targetId: BigInt(userId),
+ action: 'annotate_ban',
+ auditLogReason: data.note,
+ metadata: new Map([['ban_audit_log_id', data.ban_audit_log_id.toString()]]),
+ });
+ }
+
async unbanUser(
data: {
user_id: bigint;
@@ -110,6 +152,7 @@ export class AdminUserBanService {
auditLogReason,
metadata: new Map(),
});
+ await emitAdminAction(adminUserId, userId, 'unban');
return {
user: await mapUserToAdminResponse(updatedUser, cacheService, acls),
};
diff --git a/fluxer_api/src/api/admin/services/AdminUserDeletionService.ts b/fluxer_api/src/api/admin/services/AdminUserDeletionService.ts
index e7809a4f7..2de4eb447 100644
--- a/fluxer_api/src/api/admin/services/AdminUserDeletionService.ts
+++ b/fluxer_api/src/api/admin/services/AdminUserDeletionService.ts
@@ -8,18 +8,26 @@ import type {AdminUserUpdatePropagator} from '@app/api/admin/services/AdminUserU
import * as AuthSession from '@app/api/auth/AuthSession';
import {createReportID, createUserID, type UserID} from '@app/api/BrandedTypes';
import type {BillingRepository} from '@app/api/billing/repositories/BillingRepository';
+import {emitAdminAction} from '@app/api/infrastructure/activity/AccountChangeEvents';
import type {KVAccountDeletionQueueService} from '@app/api/infrastructure/KVAccountDeletionQueueService';
import {Logger} from '@app/api/Logger';
import type {User} from '@app/api/models/User';
+import type {OAuth2TokenRepository} from '@app/api/oauth/repositories/OAuth2TokenRepository';
import {ReportStatus} from '@app/api/report/IReportRepository';
import type {ReportService} from '@app/api/report/ReportService';
import {getReportSearchService} from '@app/api/SearchFactory';
import {clearPendingDeletion, reschedulePendingDeletion} from '@app/api/user/services/PendingDeletionCoordinator';
+import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
import {DeletionReasons} from '@fluxer/constants/src/Core';
import {UserFlags} from '@fluxer/constants/src/UserConstants';
+import {ConflictError} from '@fluxer/errors/src/domains/core/ConflictError';
+import {NoPendingDeletionError} from '@fluxer/errors/src/domains/core/NoPendingDeletionError';
import {ReportAlreadyResolvedError} from '@fluxer/errors/src/domains/moderation/ReportAlreadyResolvedError';
import {UnknownUserError} from '@fluxer/errors/src/domains/user/UnknownUserError';
-import type {ScheduleAccountDeletionRequest} from '@fluxer/schema/src/domains/admin/AdminUserSchemas';
+import type {
+ AdminUserDeletionCancelRequest,
+ ScheduleAccountDeletionRequest,
+} from '@fluxer/schema/src/domains/admin/AdminUserSchemas';
import type Stripe from 'stripe';
interface AdminUserDeletionServiceDeps {
@@ -31,11 +39,26 @@ interface AdminUserDeletionServiceDeps {
kvDeletionQueue: KVAccountDeletionQueueService;
stripe: Stripe | null;
billingRepository: BillingRepository;
+ oauth2Tokens: Pick<OAuth2TokenRepository, 'deleteAllAccessTokensForUser' | 'deleteAllRefreshTokensForUser'>;
}
const minUserRequestedDeletionDays = 14;
const minStandardDeletionDays = 60;
+function describePendingDeletion(user: User, prefix: string): Array<[string, string]> {
+ if (!user.pendingDeletionAt) return [];
+ return [
+ [`${prefix}_pending_deletion_at`, user.pendingDeletionAt.toISOString()],
+ [`${prefix}_scheduled_by`, user.deletionScheduledBy?.toString() ?? ''],
+ [`${prefix}_scheduled_at`, user.deletionScheduledAt?.toISOString() ?? ''],
+ [`${prefix}_reason_code`, user.deletionReasonCode?.toString() ?? ''],
+ ];
+}
+
+function sameInstant(left: Date, right: string): boolean {
+ return left.getTime() === new Date(right).getTime();
+}
+
export function resolveDeletionDays(reasonCode: number, requestedDays: number): number {
const minDays =
reasonCode === DeletionReasons.USER_REQUESTED ? minUserRequestedDeletionDays : minStandardDeletionDays;
@@ -70,8 +93,18 @@ export class AdminUserDeletionService {
if (!user) {
throw new UnknownUserError();
}
+ if (
+ user.pendingDeletionAt &&
+ (!data.replace_pending_deletion_at || !sameInstant(user.pendingDeletionAt, data.replace_pending_deletion_at))
+ ) {
+ throw new ConflictError({
+ code: APIErrorCodes.CONFLICT,
+ message: 'A deletion is already scheduled for this account',
+ });
+ }
const daysUntilDeletion = resolveDeletionDays(data.reason_code, data.days_until_deletion);
- const pendingDeletionAt = new Date();
+ const scheduledAt = new Date();
+ const pendingDeletionAt = new Date(scheduledAt);
pendingDeletionAt.setDate(pendingDeletionAt.getDate() + daysUntilDeletion);
const updatedUser = await userRepository.updateDeletionSchedule(user, {
flags: user.flags | UserFlags.DELETED,
@@ -79,6 +112,8 @@ export class AdminUserDeletionService {
deletion_reason_code: data.reason_code,
deletion_public_reason: data.public_reason ?? null,
deletion_audit_log_reason: auditLogReason,
+ deletion_scheduled_by: adminUserId,
+ deletion_scheduled_at: scheduledAt,
});
await reschedulePendingDeletion({
userId,
@@ -89,6 +124,8 @@ export class AdminUserDeletionService {
deletionQueue: this.deps.kvDeletionQueue,
});
await AuthSession.terminateAllUserSessions(this.deps.apiContext, userId);
+ await this.deps.oauth2Tokens.deleteAllAccessTokensForUser(userId);
+ await this.deps.oauth2Tokens.deleteAllRefreshTokensForUser(userId);
const {stripe, billingRepository} = this.deps;
if (user.stripeSubscriptionId && stripe) {
try {
@@ -158,17 +195,16 @@ export class AdminUserDeletionService {
metadata: new Map([
['days', daysUntilDeletion.toString()],
['reason_code', data.reason_code.toString()],
+ ['pending_deletion_at', pendingDeletionAt.toISOString()],
+ ...describePendingDeletion(user, 'replaced'),
]),
});
+ let knownIps: ReadonlySet<string> = new Set();
if (data.reason_code !== DeletionReasons.USER_REQUESTED) {
- await this.banIdentifiersForScheduledDeletion({
- user,
- adminUserId,
- auditLogReason,
- deletionReasonCode: data.reason_code,
- });
+ knownIps = await this.banIdentifiersForScheduledDeletion({user, adminUserId, auditLogReason});
await this.resolvePendingReportsAgainstUser({user, adminUserId});
}
+ await emitAdminAction(adminUserId, userId, 'schedule_deletion', {reasonCode: data.reason_code, ips: knownIps});
await updatePropagator.propagateUserUpdate({userId, oldUser: user, updatedUser: updatedUser});
if (user.email) {
try {
@@ -190,9 +226,7 @@ export class AdminUserDeletionService {
}
async cancelAccountDeletion(
- data: {
- user_id: bigint;
- },
+ data: AdminUserDeletionCancelRequest & {user_id: bigint},
adminUserId: UserID,
auditLogReason: string | null,
acls: ReadonlySet<string>,
@@ -204,6 +238,15 @@ export class AdminUserDeletionService {
if (!user) {
throw new UnknownUserError();
}
+ if (!user.pendingDeletionAt) {
+ throw new NoPendingDeletionError();
+ }
+ if (!sameInstant(user.pendingDeletionAt, data.expected_pending_deletion_at)) {
+ throw new ConflictError({
+ code: APIErrorCodes.CONFLICT,
+ message: 'The pending deletion does not match expected_pending_deletion_at',
+ });
+ }
const updatedUser = await userRepository.updateDeletionSchedule(user, {
flags: user.flags & ~UserFlags.DELETED & ~UserFlags.SELF_DELETED,
pending_deletion_at: null,
@@ -218,8 +261,8 @@ export class AdminUserDeletionService {
deletionQueue: this.deps.kvDeletionQueue,
});
await updatePropagator.propagateUserUpdate({userId, oldUser: user, updatedUser: updatedUser});
- if (user.email) {
- await emailService.sendUnbanNotification(user.email, user.username, auditLogReason || null, user.locale);
+ if (data.notify_user && user.email) {
+ await emailService.sendUnbanNotification(user.email, user.username, null, user.locale);
}
await auditService.createAuditLog({
adminUserId,
@@ -227,8 +270,12 @@ export class AdminUserDeletionService {
targetId: BigInt(userId),
action: 'cancel_deletion',
auditLogReason,
- metadata: new Map(),
+ metadata: new Map([
+ ...describePendingDeletion(user, 'cancelled'),
+ ['notify_user', data.notify_user ? 'true' : 'false'],
+ ]),
});
+ await emitAdminAction(adminUserId, userId, 'cancel_deletion');
return {
user: await mapUserToAdminResponse(updatedUser, cacheService, acls),
};
@@ -238,9 +285,8 @@ export class AdminUserDeletionService {
user: User;
adminUserId: UserID;
auditLogReason: string | null;
- deletionReasonCode: number;
- }): Promise<void> {
- const {user, adminUserId, auditLogReason, deletionReasonCode} = params;
+ }): Promise<ReadonlySet<string>> {
+ const {user, adminUserId, auditLogReason} = params;
const {users: userRepository} = this.deps.apiContext.services;
const {banManagementService} = this.deps;
const reason = auditLogReason ?? 'auto-enforcement on scheduled deletion';
@@ -251,52 +297,35 @@ export class AdminUserDeletionService {
Logger.warn({error, userId: user.id.toString()}, 'Failed to auto-ban email on scheduled deletion');
}
}
- const ipsToReview = new Set<string>();
+ const knownIps = new Set<string>();
if (user.lastActiveIp) {
- ipsToReview.add(user.lastActiveIp);
+ knownIps.add(user.lastActiveIp);
}
try {
const authorizedIps = await userRepository.getAuthorizedIps(user.id);
for (const {ip} of authorizedIps) {
- if (ip) ipsToReview.add(ip);
+ if (ip) knownIps.add(ip);
}
} catch (error) {
- Logger.warn({error, userId: user.id.toString()}, 'Failed to list authorized IPs for scheduled deletion review');
+ Logger.warn({error, userId: user.id.toString()}, 'Failed to list authorized IPs for scheduled deletion');
}
try {
const sessions = await userRepository.listAuthSessions(user.id);
for (const session of sessions) {
- if (session.clientIp) ipsToReview.add(session.clientIp);
+ if (session.clientIp) knownIps.add(session.clientIp);
}
} catch (error) {
- Logger.warn({error, userId: user.id.toString()}, 'Failed to list auth sessions for scheduled deletion review');
+ Logger.warn({error, userId: user.id.toString()}, 'Failed to list auth sessions for scheduled deletion');
}
try {
const tombstones = await userRepository.listAuthSessionTombstones(user.id);
for (const tombstone of tombstones) {
- if (tombstone.clientIp) ipsToReview.add(tombstone.clientIp);
+ if (tombstone.clientIp) knownIps.add(tombstone.clientIp);
}
} catch (error) {
- Logger.warn(
- {error, userId: user.id.toString()},
- 'Failed to list auth session tombstones for scheduled deletion review',
- );
- }
- for (const ip of ipsToReview) {
- try {
- await banManagementService.markSuspiciousIpForScheduledDeletion(
- {
- ip,
- sourceUserId: user.id,
- deletionReasonCode,
- },
- adminUserId,
- reason,
- );
- } catch (error) {
- Logger.warn({error, userId: user.id.toString(), ip}, 'Failed to mark suspicious IP on scheduled deletion');
- }
+ Logger.warn({error, userId: user.id.toString()}, 'Failed to list auth session tombstones for scheduled deletion');
}
+ return knownIps;
}
private async resolvePendingReportsAgainstUser(params: {user: User; adminUserId: UserID}): Promise<void> {
diff --git a/fluxer_api/src/api/admin/services/AdminUserSecurityService.ts b/fluxer_api/src/api/admin/services/AdminUserSecurityService.ts
index 63851b518..d07fd915c 100644
--- a/fluxer_api/src/api/admin/services/AdminUserSecurityService.ts
+++ b/fluxer_api/src/api/admin/services/AdminUserSecurityService.ts
@@ -11,10 +11,9 @@ import * as AuthUtility from '@app/api/auth/AuthUtility';
import {visibleWebAuthnCredentials} from '@app/api/auth/services/PasskeyRelyingParty';
import {createPasswordResetToken, createUserID, type UserID} from '@app/api/BrandedTypes';
import type {UserRow} from '@app/api/database/types/UserTypes';
+import {emitAdminAction} from '@app/api/infrastructure/activity/AccountChangeEvents';
import {Logger} from '@app/api/Logger';
import {getInstanceConfigRepository} from '@app/api/middleware/ServiceSingletons';
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import type {HistoricalOutcomeCode} from '@app/api/risk/RiskHistoryTypes';
import {mapWebAuthnCredentialToResponse} from '@app/api/user/UserMappers';
import {resolveAssignedTraits} from '@app/api/user/UserTraits';
import {getIpAddressReverse, getLocationLabelFromIp} from '@app/api/utils/IpUtils';
@@ -23,7 +22,6 @@ import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
import {
ADMIN_PHONE_TOGGLE_CLEARABLE_FLAGS,
- ALL_SUSPICIOUS_ACTIVITY_FLAGS,
DEFERRABLE_PHONE_FLAGS,
DEFERRED_PHONE_ON_COMMUNITY_JOIN,
PHONE_GATE_PROMOTED_FROM_DEFERRAL,
@@ -54,7 +52,6 @@ interface AdminUserSecurityServiceDeps {
apiContext: ApiContext;
auditService: AdminAuditService;
updatePropagator: AdminUserUpdatePropagator;
- riskHistoryRepository: Pick<IRiskHistoryRepository, 'recordOutcomeForUser'>;
}
interface FlagAuditMetadataParams {
@@ -158,6 +155,7 @@ export class AdminUserSecurityService {
newFlags,
}),
});
+ await emitAdminAction(adminUserId, userId, 'update_flags');
return {
user: await mapUserToAdminResponse(updatedUser, cacheService, acls),
};
@@ -433,6 +431,7 @@ export class AdminUserSecurityService {
],
),
});
+ await emitAdminAction(adminUserId, userId, 'set_phone_verified');
return {
user: await mapUserToAdminResponse(updatedUser, cacheService, acls),
};
@@ -471,12 +470,6 @@ export class AdminUserSecurityService {
user.toRow(),
);
await updatePropagator.propagateUserUpdate({userId, oldUser: user, updatedUser: updatedUser});
- if (
- (currentFlags & ALL_SUSPICIOUS_ACTIVITY_FLAGS) !== (newFlags & ALL_SUSPICIOUS_ACTIVITY_FLAGS) &&
- (newFlags & ALL_SUSPICIOUS_ACTIVITY_FLAGS) !== 0
- ) {
- await this.recordRiskOutcomes(userId, ['challenged'], 'admin_update_suspicious_activity_flags');
- }
await auditService.createAuditLog({
adminUserId,
targetType: 'user',
@@ -485,6 +478,7 @@ export class AdminUserSecurityService {
auditLogReason,
metadata: new Map([['flags', data.flags.toString()]]),
});
+ await emitAdminAction(adminUserId, userId, 'set_suspicious_flags');
return {
user: await mapUserToAdminResponse(updatedUser, cacheService, acls),
};
@@ -514,11 +508,6 @@ export class AdminUserSecurityService {
);
await AuthSession.terminateAllUserSessions(this.deps.apiContext, userId);
await updatePropagator.propagateUserUpdate({userId, oldUser: user, updatedUser: updatedUser});
- await this.recordRiskOutcomes(
- userId,
- data.flags !== 0 ? ['challenged', 'disabled_suspicious'] : ['disabled_suspicious'],
- 'admin_disable_suspicious_activity',
- );
if (user.email) {
await emailService.sendAccountDisabledForSuspiciousActivityEmail(user.email, user.username, null, user.locale);
}
@@ -530,6 +519,7 @@ export class AdminUserSecurityService {
auditLogReason,
metadata: new Map([['flags', data.flags.toString()]]),
});
+ await emitAdminAction(adminUserId, userId, 'disable_suspicious');
return {
user: await mapUserToAdminResponse(updatedUser, cacheService, acls),
};
@@ -720,24 +710,4 @@ export class AdminUserSecurityService {
}),
};
}
-
- private async recordRiskOutcomes(
- userId: UserID,
- outcomeCodes: ReadonlyArray<HistoricalOutcomeCode>,
- source: string,
- ): Promise<void> {
- if (outcomeCodes.length === 0) {
- return;
- }
- try {
- await this.deps.riskHistoryRepository.recordOutcomeForUser({
- userId: userId.toString(),
- occurredAt: new Date(),
- source,
- outcomeCodes,
- });
- } catch (error) {
- Logger.warn({error, userId, source}, 'Failed to persist admin risk history outcome');
- }
- }
}
diff --git a/fluxer_api/src/api/admin/services/AdminUserService.ts b/fluxer_api/src/api/admin/services/AdminUserService.ts
index f557b133d..7a4438446 100644
--- a/fluxer_api/src/api/admin/services/AdminUserService.ts
+++ b/fluxer_api/src/api/admin/services/AdminUserService.ts
@@ -19,8 +19,8 @@ import type {KVAccountDeletionQueueService} from '@app/api/infrastructure/KVAcco
import type {KVBulkMessageDeletionQueueService} from '@app/api/infrastructure/KVBulkMessageDeletionQueueService';
import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import {getBillingRepository} from '@app/api/middleware/ServiceRegistry';
+import {OAuth2TokenRepository} from '@app/api/oauth/repositories/OAuth2TokenRepository';
import type {ReportService} from '@app/api/report/ReportService';
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
import type {IUserRepository} from '@app/api/user/IUserRepository';
import type {UserContactChangeLogService} from '@app/api/user/services/UserContactChangeLogService';
import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
@@ -46,7 +46,6 @@ interface AdminUserServiceDeps {
kvDeletionQueue: KVAccountDeletionQueueService;
bulkMessageDeletionQueue: KVBulkMessageDeletionQueueService;
stripe: Stripe | null;
- riskHistoryRepository: Pick<IRiskHistoryRepository, 'recordOutcomeForUser'>;
reportService: ReportService;
}
@@ -94,7 +93,6 @@ export class AdminUserService {
apiContext: deps.apiContext,
auditService: deps.auditService,
updatePropagator: this.updatePropagator,
- riskHistoryRepository: deps.riskHistoryRepository,
});
this.banService = new AdminUserBanService({
apiContext: deps.apiContext,
@@ -110,6 +108,7 @@ export class AdminUserService {
kvDeletionQueue: deps.kvDeletionQueue,
stripe: deps.stripe,
billingRepository: getBillingRepository(),
+ oauth2Tokens: new OAuth2TokenRepository(),
});
this.contactChangeLogService = contactChangeLog;
}
diff --git a/fluxer_api/src/api/admin/services/guild/AdminGuildMembershipService.ts b/fluxer_api/src/api/admin/services/guild/AdminGuildMembershipService.ts
index acd09237a..b9af21746 100644
--- a/fluxer_api/src/api/admin/services/guild/AdminGuildMembershipService.ts
+++ b/fluxer_api/src/api/admin/services/guild/AdminGuildMembershipService.ts
@@ -44,7 +44,6 @@ export class AdminGuildMembershipService {
throw new UnknownUserError();
}
await guildService.members.addUserToGuild({
- skipRiskGate: true,
userId,
guildId,
sendJoinMessage,
diff --git a/fluxer_api/src/api/admin/tests/AdminBanManagementIpDecline.test.ts b/fluxer_api/src/api/admin/tests/AdminBanManagementIpDecline.test.ts
index 89884d3d5..e381dec67 100644
--- a/fluxer_api/src/api/admin/tests/AdminBanManagementIpDecline.test.ts
+++ b/fluxer_api/src/api/admin/tests/AdminBanManagementIpDecline.test.ts
@@ -5,10 +5,9 @@ import type {IAdminRepository} from '@app/api/admin/IAdminRepository';
import type {AdminAuditService} from '@app/api/admin/services/AdminAuditService';
import {AdminBanManagementService} from '@app/api/admin/services/AdminBanManagementService';
import {createUserID} from '@app/api/BrandedTypes';
+import {resetIpBanExemptionsForTesting} from '@app/api/ban/IpBanExemptions';
import {getConfig} from '@app/api/Config';
import {ipBanCache} from '@app/api/middleware/IpBanMiddleware';
-import {resetIpBanExemptionsForTesting} from '@app/api/risk/IpBanExemptions';
-import type {ISuspiciousIpRepository} from '@app/api/risk/SuspiciousIpRepository';
import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
import {BadRequestError} from '@fluxer/errors/src/domains/core/BadRequestError';
import type {IpInfoLookupResult, IpInfoService} from '@pkgs/geoip/src/IpInfoService';
@@ -28,7 +27,7 @@ function ipInfoResult(overrides: Partial<IpInfoLookupResult> = {}): IpInfoLookup
return {
ip: CARRIER_IP,
available: true,
- riskNote: 'test',
+ note: 'test',
geo: {
countryCode: 'US',
countryName: 'United States',
@@ -101,7 +100,6 @@ function createBanManagementService(lookup: (ip: string) => Promise<IpInfoLookup
adminRepository: adminRepository as unknown as IAdminRepository,
auditService: auditService as unknown as AdminAuditService,
ipInfoService: ipInfoService as unknown as IpInfoService,
- suspiciousIpRepository: {} as unknown as ISuspiciousIpRepository,
});
return {service, bannedIps, auditCalls};
}
diff --git a/fluxer_api/src/api/admin/tests/AdminBanNotes.test.ts b/fluxer_api/src/api/admin/tests/AdminBanNotes.test.ts
new file mode 100644
index 000000000..cf6ef9b00
--- /dev/null
+++ b/fluxer_api/src/api/admin/tests/AdminBanNotes.test.ts
@@ -0,0 +1,102 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import type {AdminAuditLog} from '@app/api/admin/IAdminRepository';
+import {createTestAccount, setUserACLs, type TestAccount} from '@app/api/auth/tests/AuthTestUtils';
+import {decodeHeaderUtf8} from '@app/api/middleware/AuditLogMiddleware';
+import {getAdminRepository} from '@app/api/middleware/ServiceSingletons';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {HTTP_STATUS} from '@app/api/test/TestConstants';
+import {createBuilder} from '@app/api/test/TestRequestBuilder';
+import {afterEach, beforeEach, describe, expect, test} from 'vitest';
+
+function asReceivedHeader(value: string): string {
+ return Buffer.from(value, 'utf8').toString('latin1');
+}
+
+async function auditLogsFor(targetUserId: string, action: string): Promise<Array<AdminAuditLog>> {
+ const logs = await getAdminRepository().listAllAuditLogsPaginated(1000);
+ return logs.filter((log) => log.action === action && log.targetId.toString() === targetUserId);
+}
+
+describe('decodeHeaderUtf8', () => {
+ test('reads UTF-8 bytes that arrived as a latin1 string', () => {
+ expect(decodeHeaderUtf8(asReceivedHeader('§ 4.2 räksmörgås 日本'))).toBe('§ 4.2 räksmörgås 日本');
+ });
+
+ test('keeps ASCII and latin1 text that is not UTF-8', () => {
+ expect(decodeHeaderUtf8('Batch 12')).toBe('Batch 12');
+ expect(decodeHeaderUtf8('café')).toBe('café');
+ });
+});
+
+describe('Admin ban reasons and notes', () => {
+ let harness: ApiTestHarness;
+ let admin: TestAccount;
+ beforeEach(async () => {
+ harness = await createApiTestHarness();
+ admin = await setUserACLs(harness, await createTestAccount(harness), ['admin:authenticate', 'user:temp_ban']);
+ });
+ afterEach(async () => {
+ await harness?.shutdown();
+ });
+
+ async function ban(target: TestAccount, reason: string): Promise<AdminAuditLog> {
+ await createBuilder(harness, admin.token)
+ .put(`/admin/users/${target.userId}/ban`)
+ .header('X-Audit-Log-Reason', asReceivedHeader(reason))
+ .body({duration_hours: 24})
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ const [log] = await auditLogsFor(target.userId, 'temp_ban');
+ return log!;
+ }
+
+ test('stores a UTF-8 ban reason as sent', async () => {
+ const target = await createTestAccount(harness);
+ const log = await ban(target, '§ 3 Regel – wiederholt');
+ expect(log.auditLogReason).toBe('§ 3 Regel – wiederholt');
+ });
+
+ test('appends a note to the current ban without changing the ban entry', async () => {
+ const target = await createTestAccount(harness);
+ const banLog = await ban(target, 'Original reason');
+ await createBuilder(harness, admin.token)
+ .post(`/admin/users/${target.userId}/ban/notes`)
+ .body({ban_audit_log_id: banLog.logId.toString(), note: 'Also sent § 4 links'})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ const [note] = await auditLogsFor(target.userId, 'annotate_ban');
+ expect(note?.auditLogReason).toBe('Also sent § 4 links');
+ expect(note?.adminUserId.toString()).toBe(admin.userId);
+ expect(Object.fromEntries(note!.metadata)).toEqual({ban_audit_log_id: banLog.logId.toString()});
+ const [unchanged] = await auditLogsFor(target.userId, 'temp_ban');
+ expect(unchanged?.auditLogReason).toBe('Original reason');
+ });
+
+ test('refuses a note that names another user ban', async () => {
+ const target = await createTestAccount(harness);
+ const other = await createTestAccount(harness);
+ await ban(target, 'Target ban');
+ const otherBan = await ban(other, 'Other ban');
+ await createBuilder(harness, admin.token)
+ .post(`/admin/users/${target.userId}/ban/notes`)
+ .body({ban_audit_log_id: otherBan.logId.toString(), note: 'Wrong ban'})
+ .expect(HTTP_STATUS.BAD_REQUEST)
+ .execute();
+ expect(await auditLogsFor(target.userId, 'annotate_ban')).toHaveLength(0);
+ });
+
+ test('refuses a note once the ban has been lifted', async () => {
+ const target = await createTestAccount(harness);
+ const banLog = await ban(target, 'Lifted ban');
+ await createBuilder(harness, admin.token)
+ .delete(`/admin/users/${target.userId}/ban`)
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ await createBuilder(harness, admin.token)
+ .post(`/admin/users/${target.userId}/ban/notes`)
+ .body({ban_audit_log_id: banLog.logId.toString(), note: 'Too late'})
+ .expect(HTTP_STATUS.CONFLICT)
+ .execute();
+ });
+});
diff --git a/fluxer_api/src/api/admin/tests/AdminDeletionQueue.test.ts b/fluxer_api/src/api/admin/tests/AdminDeletionQueue.test.ts
index e859109d1..ddf2d093c 100644
--- a/fluxer_api/src/api/admin/tests/AdminDeletionQueue.test.ts
+++ b/fluxer_api/src/api/admin/tests/AdminDeletionQueue.test.ts
@@ -1,9 +1,17 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {randomInt} from 'node:crypto';
-import {createTestAccount, setUserACLs} from '@app/api/auth/tests/AuthTestUtils';
+import {
+ clearTestEmails,
+ createTestAccount,
+ findLastTestEmail,
+ listTestEmails,
+ setUserACLs,
+ type TestAccount,
+} from '@app/api/auth/tests/AuthTestUtils';
+import {createUserID} from '@app/api/BrandedTypes';
import {setInjectedIpInfoService} from '@app/api/middleware/ServiceMiddleware';
-import {CassandraSuspiciousIpRepository} from '@app/api/risk/SuspiciousIpRepository';
+import {getAdminRepository} from '@app/api/middleware/ServiceSingletons';
import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
import {HTTP_STATUS} from '@app/api/test/TestConstants';
import {createBuilder} from '@app/api/test/TestRequestBuilder';
@@ -20,7 +28,7 @@ function ipInfoResult(ip: string, overrides: Partial<IpInfoLookupResult> = {}):
return {
ip,
available: true,
- riskNote: 'test',
+ note: 'test',
geo: {
countryCode: 'US',
countryName: 'United States',
@@ -105,7 +113,11 @@ describe('Admin Deletion Queue', () => {
}>(harness, `${admin.token}`)
.put(`/admin/users/${targetUser.userId}/deletion`)
.header('x-forwarded-for', adminIp)
- .body({reason_code: 2, days_until_deletion: 62})
+ .body({
+ reason_code: 2,
+ days_until_deletion: 62,
+ replace_pending_deletion_at: firstSchedule.user.pending_deletion_at,
+ })
.execute();
const firstDate = firstSchedule.user.pending_deletion_at.slice(0, 10);
const secondDate = secondSchedule.user.pending_deletion_at.slice(0, 10);
@@ -144,6 +156,7 @@ describe('Admin Deletion Queue', () => {
}>(harness, `${admin.token}`)
.delete(`/admin/users/${targetUser.userId}/deletion`)
.header('x-forwarded-for', adminIp)
+ .body({expected_pending_deletion_at: schedule.user.pending_deletion_at})
.execute();
expect(await harness.kvProvider.zcard('deletion_queue')).toBe(0);
expect(
@@ -172,7 +185,7 @@ describe('Admin Deletion Queue', () => {
expect(ipBan.banned).toBe(false);
expect(emailBan.banned).toBe(false);
});
- test('moderation scheduled deletion bans email and marks IP suspicious without banning it', async () => {
+ test('moderation scheduled deletion bans email without banning the IP', async () => {
const adminIp = createUniqueTestIp();
const targetIp = createUniqueTestIp();
const admin = await createTestAccount(harness, {ipAddress: adminIp});
@@ -189,87 +202,8 @@ describe('Admin Deletion Queue', () => {
const emailBan = await createBuilder<{banned: boolean}>(harness, `${admin.token}`)
.get(`/admin/blocklists/email/entries/${encodeURIComponent(targetUser.email)}`)
.execute();
- const suspiciousIp = await new CassandraSuspiciousIpRepository().findActiveByIp(targetIp);
expect(ipBan.banned).toBe(false);
expect(emailBan.banned).toBe(true);
- expect(suspiciousIp?.source).toBe('scheduled_deletion');
- expect(suspiciousIp?.sourceUserId).toBe(targetUser.userId);
- });
- test('moderation scheduled deletion does not mark trusted paid VPN IPs suspicious', async () => {
- const adminIp = createUniqueTestIp();
- const targetIp = createUniqueTestIp();
- const admin = await createTestAccount(harness, {ipAddress: adminIp});
- const targetUser = await createTestAccount(harness, {ipAddress: targetIp});
- setInjectedIpInfoService({
- async lookup(ip: string) {
- return ipInfoResult(ip, {
- anonymous: {
- isAnonymous: true,
- providerName: 'Example Privacy Relay LLC',
- isVpn: true,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- percentDaysSeen: null,
- },
- });
- },
- });
- await setUserACLs(harness, admin, ['admin:authenticate', 'user:delete', 'ban:ip:check', 'ban:email:check']);
- await createBuilder(harness, `${admin.token}`)
- .put(`/admin/users/${targetUser.userId}/deletion`)
- .header('x-forwarded-for', adminIp)
- .body({reason_code: DeletionReasons.SPAM, days_until_deletion: 60})
- .execute();
- const ipBan = await createBuilder<{banned: boolean}>(harness, `${admin.token}`)
- .get(`/admin/blocklists/ip/entries/${encodeURIComponent(targetIp)}`)
- .execute();
- const suspiciousIp = await new CassandraSuspiciousIpRepository().findActiveByIp(targetIp);
- expect(ipBan.banned).toBe(false);
- expect(suspiciousIp).toBeNull();
- });
- test('moderation scheduled deletion does not mark mobile carrier IPs suspicious', async () => {
- const adminIp = createUniqueTestIp();
- const targetIp = createUniqueTestIp();
- const admin = await createTestAccount(harness, {ipAddress: adminIp});
- const targetUser = await createTestAccount(harness, {ipAddress: targetIp});
- setInjectedIpInfoService({
- async lookup(ip: string) {
- return ipInfoResult(ip, {
- asn: {
- asn: 'AS64501',
- number: 64501,
- name: 'Test Mobile',
- domain: null,
- type: 'mobile',
- },
- mobile: {
- name: 'Test Mobile',
- mcc: '001',
- mnc: '01',
- },
- flags: {
- isAnycast: false,
- isHosting: false,
- isMobile: true,
- isSatellite: false,
- },
- });
- },
- });
- await setUserACLs(harness, admin, ['admin:authenticate', 'user:delete', 'ban:ip:check', 'ban:email:check']);
- await createBuilder(harness, `${admin.token}`)
- .put(`/admin/users/${targetUser.userId}/deletion`)
- .header('x-forwarded-for', adminIp)
- .body({reason_code: DeletionReasons.SPAM, days_until_deletion: 60})
- .execute();
- const ipBan = await createBuilder<{banned: boolean}>(harness, `${admin.token}`)
- .get(`/admin/blocklists/ip/entries/${encodeURIComponent(targetIp)}`)
- .execute();
- const suspiciousIp = await new CassandraSuspiciousIpRepository().findActiveByIp(targetIp);
- expect(ipBan.banned).toBe(false);
- expect(suspiciousIp).toBeNull();
});
test('rejects a scheduled deletion reason code outside the registry', async () => {
const admin = await createTestAccount(harness);
@@ -317,4 +251,155 @@ describe('Admin Deletion Queue', () => {
.executeWithResponse();
expect(json.errors.some((entry) => entry.path === 'reason_code')).toBe(true);
});
+
+ describe('naming the deletion', () => {
+ interface ScheduledUser {
+ user: {
+ pending_deletion_at: string | null;
+ deletion_scheduled_by: string | null;
+ deletion_scheduled_at: string | null;
+ deletion_audit_log_reason: string | null;
+ };
+ }
+
+ async function scheduleAs(admin: TestAccount, target: TestAccount, reasonCode: number, reason: string) {
+ return createBuilder<ScheduledUser>(harness, admin.token)
+ .put(`/admin/users/${target.userId}/deletion`)
+ .header('X-Audit-Log-Reason', reason)
+ .body({reason_code: reasonCode, days_until_deletion: 60})
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ }
+
+ async function createAdmin(acls: Array<string> = []): Promise<TestAccount> {
+ return setUserACLs(harness, await createTestAccount(harness), ['admin:authenticate', 'user:delete', ...acls]);
+ }
+
+ test('records who scheduled the deletion and shows the private reason to audit log viewers', async () => {
+ const admin = await createAdmin(['audit_log:view']);
+ const target = await createTestAccount(harness);
+ const scheduled = await scheduleAs(admin, target, DeletionReasons.SPAM, 'Batch review');
+ expect(scheduled.user.deletion_scheduled_by).toBe(admin.userId);
+ expect(scheduled.user.deletion_scheduled_at).not.toBeNull();
+ expect(scheduled.user.deletion_audit_log_reason).toBe('Batch review');
+ const other = await createAdmin(['user:lookup']);
+ const viewed = await createBuilder<{users: Array<ScheduledUser['user']>}>(harness, other.token)
+ .get(`/admin/users/${target.userId}`)
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ expect(viewed.users[0]?.deletion_scheduled_by).toBe(admin.userId);
+ expect(viewed.users[0]?.deletion_audit_log_reason).toBeNull();
+ });
+
+ test('a second schedule without naming the pending deletion is refused and keeps it', async () => {
+ const first = await createAdmin();
+ const second = await createAdmin();
+ const target = await createTestAccount(harness);
+ const scheduled = await scheduleAs(first, target, DeletionReasons.SPAM, 'First review');
+ await createBuilder(harness, second.token)
+ .put(`/admin/users/${target.userId}/deletion`)
+ .body({reason_code: DeletionReasons.SPAM, days_until_deletion: 60})
+ .expect(HTTP_STATUS.CONFLICT)
+ .execute();
+ await createBuilder(harness, first.token)
+ .put(`/admin/users/${target.userId}/deletion`)
+ .body({reason_code: DeletionReasons.OTHER, days_until_deletion: 60})
+ .expect(HTTP_STATUS.CONFLICT)
+ .execute();
+ const user = await new UserRepository().findUnique(createUserID(BigInt(target.userId)));
+ expect(user?.pendingDeletionAt?.toISOString()).toBe(scheduled.user.pending_deletion_at);
+ expect(user?.deletionScheduledBy?.toString()).toBe(first.userId);
+ });
+
+ test('replacing a named deletion records the deletion it replaced', async () => {
+ const first = await createAdmin();
+ const second = await createAdmin();
+ const target = await createTestAccount(harness);
+ const scheduled = await scheduleAs(first, target, DeletionReasons.SPAM, 'First review');
+ const replaced = await createBuilder<ScheduledUser>(harness, second.token)
+ .put(`/admin/users/${target.userId}/deletion`)
+ .body({
+ reason_code: DeletionReasons.OTHER,
+ days_until_deletion: 90,
+ replace_pending_deletion_at: scheduled.user.pending_deletion_at,
+ })
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ expect(replaced.user.deletion_scheduled_by).toBe(second.userId);
+ const logs = await getAdminRepository().listAllAuditLogsPaginated(1000);
+ const log = logs.find(
+ (entry) =>
+ entry.action === 'schedule_deletion' &&
+ entry.targetId.toString() === target.userId &&
+ entry.adminUserId.toString() === second.userId,
+ );
+ expect(log?.metadata.get('replaced_pending_deletion_at')).toBe(scheduled.user.pending_deletion_at);
+ expect(log?.metadata.get('replaced_scheduled_by')).toBe(first.userId);
+ expect(log?.metadata.get('replaced_reason_code')).toBe(DeletionReasons.SPAM.toString());
+ expect(log?.metadata.get('pending_deletion_at')).toBe(replaced.user.pending_deletion_at);
+ });
+
+ test('cancel requires the pending deletion it cancels', async () => {
+ const admin = await createAdmin();
+ const target = await createTestAccount(harness);
+ await scheduleAs(admin, target, DeletionReasons.SPAM, 'Review');
+ await createBuilder(harness, admin.token)
+ .delete(`/admin/users/${target.userId}/deletion`)
+ .expect(HTTP_STATUS.BAD_REQUEST)
+ .execute();
+ await createBuilder(harness, admin.token)
+ .delete(`/admin/users/${target.userId}/deletion`)
+ .body({expected_pending_deletion_at: new Date(Date.now() + 86_400_000).toISOString()})
+ .expect(HTTP_STATUS.CONFLICT)
+ .execute();
+ const user = await new UserRepository().findUnique(createUserID(BigInt(target.userId)));
+ expect(user?.pendingDeletionAt).not.toBeNull();
+ expect(await harness.kvProvider.zcard('deletion_queue')).toBe(1);
+ });
+
+ test('cancel refuses when nothing is pending', async () => {
+ const admin = await createAdmin();
+ const target = await createTestAccount(harness);
+ await createBuilder(harness, admin.token)
+ .delete(`/admin/users/${target.userId}/deletion`)
+ .body({expected_pending_deletion_at: new Date().toISOString()})
+ .expect(HTTP_STATUS.BAD_REQUEST, 'NO_PENDING_DELETION')
+ .execute();
+ });
+
+ test('cancel records whose deletion it cancelled and emails only on request', async () => {
+ const scheduler = await createAdmin();
+ const canceller = await createAdmin();
+ const target = await createTestAccount(harness);
+ const scheduled = await scheduleAs(scheduler, target, DeletionReasons.SPAM, 'Review');
+ await clearTestEmails(harness);
+ await createBuilder(harness, canceller.token)
+ .delete(`/admin/users/${target.userId}/deletion`)
+ .header('X-Audit-Log-Reason', 'Private cancel note')
+ .body({expected_pending_deletion_at: scheduled.user.pending_deletion_at})
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ expect(
+ findLastTestEmail(await listTestEmails(harness, {recipient: target.email}), 'unban_notification'),
+ ).toBeNull();
+ const logs = await getAdminRepository().listAllAuditLogsPaginated(1000);
+ const log = logs.find(
+ (entry) => entry.action === 'cancel_deletion' && entry.targetId.toString() === target.userId,
+ );
+ expect(log?.metadata.get('cancelled_pending_deletion_at')).toBe(scheduled.user.pending_deletion_at);
+ expect(log?.metadata.get('cancelled_scheduled_by')).toBe(scheduler.userId);
+ expect(log?.metadata.get('cancelled_reason_code')).toBe(DeletionReasons.SPAM.toString());
+ expect(log?.metadata.get('notify_user')).toBe('false');
+ const rescheduled = await scheduleAs(scheduler, target, DeletionReasons.SPAM, 'Review again');
+ await createBuilder(harness, canceller.token)
+ .delete(`/admin/users/${target.userId}/deletion`)
+ .header('X-Audit-Log-Reason', 'Private cancel note')
+ .body({expected_pending_deletion_at: rescheduled.user.pending_deletion_at, notify_user: true})
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ const email = findLastTestEmail(await listTestEmails(harness, {recipient: target.email}), 'unban_notification');
+ expect(email).not.toBeNull();
+ expect(JSON.stringify(email)).not.toContain('Private cancel note');
+ });
+ });
});
diff --git a/fluxer_api/src/api/admin/tests/AdminSyntheticUserServiceGuards.test.ts b/fluxer_api/src/api/admin/tests/AdminSyntheticUserServiceGuards.test.ts
index 526cd520f..3606b7ae0 100644
--- a/fluxer_api/src/api/admin/tests/AdminSyntheticUserServiceGuards.test.ts
+++ b/fluxer_api/src/api/admin/tests/AdminSyntheticUserServiceGuards.test.ts
@@ -80,7 +80,6 @@ describe('service level guards for synthetic accounts', () => {
guildId: GUILD_ID,
skipBanCheck: true,
skipGuildLimitCheck: true,
- skipRiskGate: true,
requestCache: new Map(),
} as never,
unusableDependency() as never,
diff --git a/fluxer_api/src/api/admin/tests/audit_coverage/BanAdminAuditCases.ts b/fluxer_api/src/api/admin/tests/audit_coverage/BanAdminAuditCases.ts
index d6a362d19..5e9829da1 100644
--- a/fluxer_api/src/api/admin/tests/audit_coverage/BanAdminAuditCases.ts
+++ b/fluxer_api/src/api/admin/tests/audit_coverage/BanAdminAuditCases.ts
@@ -37,7 +37,7 @@ export const BanAdminAuditCases: ReadonlyArray<AdminAuditCoverageCase> = [
action: 'list_blocklists',
targetType: 'blocklist',
targetId: '0',
- metadata: {result_count: '9'},
+ metadata: {result_count: '8'},
},
};
},
diff --git a/fluxer_api/src/api/admin/tests/audit_coverage/UserWriteAdminAuditCases.ts b/fluxer_api/src/api/admin/tests/audit_coverage/UserWriteAdminAuditCases.ts
index d5b85fd91..f05c091bb 100644
--- a/fluxer_api/src/api/admin/tests/audit_coverage/UserWriteAdminAuditCases.ts
+++ b/fluxer_api/src/api/admin/tests/audit_coverage/UserWriteAdminAuditCases.ts
@@ -20,7 +20,7 @@ import {
} from '@app/api/auth/tests/WebAuthnTestUtils';
import {createUserID} from '@app/api/BrandedTypes';
import {createFriendship} from '@app/api/channel/tests/ChannelTestUtils';
-import {getUserRepository} from '@app/api/middleware/ServiceSingletons';
+import {getAdminRepository, getUserRepository} from '@app/api/middleware/ServiceSingletons';
import type {User} from '@app/api/models/User';
import {createBuilder} from '@app/api/test/TestRequestBuilder';
import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
@@ -340,6 +340,34 @@ export const UserWriteAdminAuditCases: ReadonlyArray<AdminAuditCoverageCase> = [
};
},
},
+ {
+ method: 'POST',
+ route: '/admin/users/:user_id/ban/notes',
+ auditLogReason: 'Coverage ban note',
+ async prepare(context) {
+ const target = await createTestAccount(context.harness);
+ await adminBuilder(context)
+ .put(`/admin/users/${target.userId}/ban`)
+ .body({duration_hours: 24, reason: 'Coverage ban'})
+ .execute();
+ const banLog = (await getAdminRepository().listAllAuditLogsPaginated(1000)).find(
+ (log) => log.action === 'temp_ban' && log.targetId.toString() === target.userId,
+ );
+ return {
+ request: {
+ path: `/admin/users/${target.userId}/ban/notes`,
+ body: {ban_audit_log_id: banLog!.logId.toString(), note: 'Coverage ban note'},
+ expectStatus: 204,
+ },
+ expected: {
+ action: 'annotate_ban',
+ targetType: 'user',
+ targetId: target.userId,
+ metadata: {ban_audit_log_id: banLog!.logId.toString()},
+ },
+ };
+ },
+ },
{
method: 'PUT',
route: '/admin/users/:user_id/deletion',
@@ -354,7 +382,11 @@ export const UserWriteAdminAuditCases: ReadonlyArray<AdminAuditCoverageCase> = [
action: 'schedule_deletion',
targetType: 'user',
targetId: target.userId,
- metadata: {days: '30', reason_code: DeletionReasons.USER_REQUESTED.toString()},
+ metadata: {
+ days: '30',
+ reason_code: DeletionReasons.USER_REQUESTED.toString(),
+ pending_deletion_at: expect.any(String),
+ },
},
};
},
@@ -368,13 +400,23 @@ export const UserWriteAdminAuditCases: ReadonlyArray<AdminAuditCoverageCase> = [
.put(`/admin/users/${target.userId}/deletion`)
.body({reason_code: DeletionReasons.USER_REQUESTED, days_until_deletion: 30})
.execute();
+ const pendingDeletionAt = (await loadUser(target)).pendingDeletionAt!.toISOString();
return {
- request: {path: `/admin/users/${target.userId}/deletion`},
+ request: {
+ path: `/admin/users/${target.userId}/deletion`,
+ body: {expected_pending_deletion_at: pendingDeletionAt},
+ },
expected: {
action: 'cancel_deletion',
targetType: 'user',
targetId: target.userId,
- metadata: {},
+ metadata: {
+ cancelled_pending_deletion_at: pendingDeletionAt,
+ cancelled_scheduled_by: context.admin.userId,
+ cancelled_scheduled_at: expect.any(String),
+ cancelled_reason_code: DeletionReasons.USER_REQUESTED.toString(),
+ notify_user: 'false',
+ },
},
};
},
diff --git a/fluxer_api/src/api/app/APILifecycle.ts b/fluxer_api/src/api/app/APILifecycle.ts
index 0a978f3e9..9582b59cd 100644
--- a/fluxer_api/src/api/app/APILifecycle.ts
+++ b/fluxer_api/src/api/app/APILifecycle.ts
@@ -2,15 +2,27 @@
import {randomUUID} from 'node:crypto';
import {ensureDeletionQueueState} from '@app/api/app/DeletionQueueStartup';
+import {renderPhoneRpcMetrics, setPhoneRpcConnection} from '@app/api/auth/PhoneVerificationClient';
import type {APIConfig} from '@app/api/config/APIConfig';
import {hasDatabaseQueryExecutor, setDatabaseQueryExecutor} from '@app/api/database/CassandraQueryExecution';
import {ensurePostgresKvSchema, PostgresKvQueryExecutor} from '@app/api/database/PostgresKvQueryExecutor';
import {GuildDataRepository} from '@app/api/guild/repositories/GuildDataRepository';
import type {ILogger} from '@app/api/ILogger';
+import {
+ jetStreamActivityPublisher,
+ renderActivityMetrics,
+ shutdownActivityEvents,
+ startActivityEvents,
+} from '@app/api/infrastructure/activity/ActivityEvents';
+import {
+ renderSharedListMetrics,
+ startSharedListWatch,
+ stopSharedListWatch,
+} from '@app/api/infrastructure/activity/SharedLists';
import {shutdownStorageChangeFeed} from '@app/api/infrastructure/StorageServiceFactory';
import {JobLedgerRepository} from '@app/api/jobs/JobLedgerRepository';
-import {startAbuseReplicationSubscriber, stopAbuseReplicationSubscriber} from '@app/api/middleware/AbusiveIpAutoBanner';
import {ipBanCache} from '@app/api/middleware/IpBanMiddleware';
+import {startRequestErrorTelemetry, stopRequestErrorTelemetry} from '@app/api/middleware/RequestErrorTelemetry';
import {initializeServiceSingletons, shutdownReportService} from '@app/api/middleware/ServiceMiddleware';
import {
closeOwnedKVClient,
@@ -29,7 +41,6 @@ import {
shutdownInstanceConfigRepository,
shutdownServiceSingletons,
} from '@app/api/middleware/ServiceSingletons';
-import {torExitListCache} from '@app/api/middleware/TorExitListCache';
import {ensureApnsSigningKey} from '@app/api/push/ApnsPushService';
import {initializeSearch, shutdownSearch} from '@app/api/SearchFactory';
import {warmupAdminSearchIndexes} from '@app/api/search/SearchWarmup';
@@ -37,12 +48,20 @@ import {VisionarySlotInitializer} from '@app/api/stripe/VisionarySlotInitializer
import {VoiceDataInitializer} from '@app/api/voice/VoiceDataInitializer';
import {JetStreamWorkerQueue} from '@app/api/worker/JetStreamWorkerQueue';
import {WorkerService} from '@app/api/worker/WorkerService';
+import {registerMetricsSection} from '@fluxer/hono/src/middleware/Metrics';
+import type {JetStreamClient} from '@nats-io/jetstream';
import {initCassandra, shutdownCassandra} from '@pkgs/cassandra/src/Client';
import {ensureGeoipDatabaseOnStartup} from '@pkgs/geoip/src/GeoipStartup';
import {JetStreamConnectionManager} from '@pkgs/nats/src/JetStreamConnectionManager';
import {getDefaultPostgresClient, initPostgres, shutdownPostgres} from '@pkgs/postgres/src/Client';
let jsConnectionManager: JetStreamConnectionManager | null = null;
+const unregisterMetricsSections: Array<() => void> = [];
+
+export function getActivityJetStream(): JetStreamClient | null {
+ if (!jsConnectionManager || jsConnectionManager.isClosed()) return null;
+ return jsConnectionManager.getJetStreamClient();
+}
interface RefreshCacheLifecycle {
initialize(): Promise<void>;
@@ -103,11 +122,10 @@ export function createInitializer(config: APIConfig, logger: ILogger): () => Pro
{
maxmind_db_path: geoipStartupResult.maxmindDbPath,
city: geoipStartupResult.city,
- asn: geoipStartupResult.asn,
s3_bucket: geoipStartupResult.bucket,
s3_key: geoipStartupResult.key,
},
- 'GeoIP databases downloaded from S3',
+ 'GeoIP database downloaded from S3',
);
}
if (config.database.backend === 'postgres' && !hasDatabaseQueryExecutor()) {
@@ -135,13 +153,6 @@ export function createInitializer(config: APIConfig, logger: ILogger): () => Pro
const kvClient = getKVClient();
ipBanCache.setRefreshSubscriber(kvClient);
await initializeRefreshCache(ipBanCache, 'IP ban cache', logger);
- await startAbuseReplicationSubscriber(kvClient);
- logger.info('Abusive-IP auto-banner replication started');
- if (config.torExitList.enabled) {
- torExitListCache.setKvClient(kvClient);
- await torExitListCache.initialize();
- logger.info('Tor exit list cache initialized');
- }
const {urlBlocklistCache} = await import('@app/api/middleware/UrlBlocklistCache');
urlBlocklistCache.setRefreshSubscriber(kvClient);
const {getStorageService} = await import('@app/api/middleware/ServiceSingletons');
@@ -172,6 +183,22 @@ export function createInitializer(config: APIConfig, logger: ILogger): () => Pro
await workerQueue.ensureStream();
setInjectedWorkerService(new WorkerService(workerQueue, getSnowflakeService(), new JobLedgerRepository()));
logger.info('JetStream worker service initialized');
+ const connection = jsConnectionManager;
+ await startActivityEvents({
+ publisher: jetStreamActivityPublisher(connection.getJetStreamClient()),
+ kv: kvClient,
+ jsm: await connection.getJetStreamManager(),
+ spoolWhileMissing: !config.instance.selfHosted,
+ });
+ startRequestErrorTelemetry();
+ startSharedListWatch(connection.getJetStreamClient());
+ setPhoneRpcConnection(() => (connection.isClosed() ? null : connection.getConnection()));
+ unregisterMetricsSections.push(
+ registerMetricsSection(renderActivityMetrics),
+ registerMetricsSection(renderSharedListMetrics),
+ registerMetricsSection(renderPhoneRpcMetrics),
+ );
+ logger.info('Activity events initialized');
}
await ensureDeletionQueueState(getKVAccountDeletionQueue(), logger);
logger.info('Initializing search indexes...');
@@ -253,6 +280,11 @@ export function createShutdown(config: APIConfig, logger: ILogger): () => Promis
} catch (error) {
logger.error({error}, 'Error shutting down voice resources');
}
+ stopRequestErrorTelemetry();
+ stopSharedListWatch();
+ setPhoneRpcConnection(null);
+ for (const unregister of unregisterMetricsSections.splice(0)) unregister();
+ await shutdownActivityEvents();
if (jsConnectionManager) {
try {
await jsConnectionManager.drain();
@@ -269,12 +301,6 @@ export function createShutdown(config: APIConfig, logger: ILogger): () => Promis
} catch (error) {
logger.error({error}, 'Error shutting down search service');
}
- try {
- await stopAbuseReplicationSubscriber();
- logger.info('Abusive-IP auto-banner replication stopped');
- } catch (error) {
- logger.error({error}, 'Error stopping abusive-IP auto-banner replication');
- }
await Promise.all([
shutdownRefreshCaches(logger),
shutdownServiceSingletons()
@@ -285,12 +311,6 @@ export function createShutdown(config: APIConfig, logger: ILogger): () => Promis
logger.error({error}, 'Error shutting down service singletons');
}),
]);
- try {
- await torExitListCache.shutdown();
- logger.info('Tor exit list cache shut down');
- } catch (error) {
- logger.error({error}, 'Error shutting down Tor exit list cache');
- }
try {
await shutdownInstanceConfigRepository();
logger.info('Instance config repository shut down');
diff --git a/fluxer_api/src/api/app/ControllerRegistry.ts b/fluxer_api/src/api/app/ControllerRegistry.ts
index 63353a257..ed423b8d7 100644
--- a/fluxer_api/src/api/app/ControllerRegistry.ts
+++ b/fluxer_api/src/api/app/ControllerRegistry.ts
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {registerAdminControllers} from '@app/api/admin/controllers/index';
+import {getActivityJetStream} from '@app/api/app/APILifecycle';
import {AttachmentController} from '@app/api/attachment/AttachmentController';
import {AuthController} from '@app/api/auth/AuthController';
import {OriginHandoffController} from '@app/api/auth/OriginHandoffController';
import {PasskeyBridgeController} from '@app/api/auth/PasskeyBridgeController';
import {BlueskyOAuthController} from '@app/api/bluesky/BlueskyOAuthController';
-import {Config} from '@app/api/Config';
import {ChannelController} from '@app/api/channel/ChannelController';
import type {APIConfig} from '@app/api/config/APIConfig';
import {ConnectionController} from '@app/api/connection/ConnectionController';
@@ -21,17 +21,12 @@ import {GifController} from '@app/api/gif/GifController';
import {GuildController} from '@app/api/guild/GuildController';
import {InstanceController} from '@app/api/instance/InstanceController';
import {InviteController} from '@app/api/invite/InviteController';
-import {Logger} from '@app/api/Logger';
-import {getInboundSmsChallengeServiceInstance, getUserRepositoryInstance} from '@app/api/middleware/ServiceMiddleware';
-import {getGatewayService} from '@app/api/middleware/ServiceRegistry';
-import {getCacheService} from '@app/api/middleware/ServiceSingletons';
import {OAuth2ApplicationsController} from '@app/api/oauth/OAuth2ApplicationsController';
import {OAuth2Controller} from '@app/api/oauth/OAuth2Controller';
import {OpenAPIController} from '@app/api/openapi/OpenAPIController';
import {PremiumController} from '@app/api/premium/PremiumController';
import {ReadStateController} from '@app/api/read_state/ReadStateController';
import {ReportController} from '@app/api/report/ReportController';
-import {installTwilioInboundSmsWebhook} from '@app/api/risk/TwilioInboundSmsWebhook';
import {InternalRpcController} from '@app/api/rpc/InternalRpcController';
import {SearchController} from '@app/api/search/controllers/SearchController';
import {StripeController} from '@app/api/stripe/StripeController';
@@ -40,6 +35,7 @@ import {ThemeController} from '@app/api/theme/ThemeController';
import type {HonoApp} from '@app/api/types/HonoEnv';
import {UnfurlController} from '@app/api/unfurl/UnfurlController';
import {UserController} from '@app/api/user/controllers/UserController';
+import {installSmsWebhookForwarder} from '@app/api/webhook/SmsWebhookForwarder';
import {WebhookController} from '@app/api/webhook/WebhookController';
export function registerControllers(routes: HonoApp, config: APIConfig): void {
@@ -72,9 +68,7 @@ export function registerControllers(routes: HonoApp, config: APIConfig): void {
TestHarnessController(routes);
}
UserController(routes);
- if (config.sms.enabled) {
- registerInboundSmsWebhook(routes);
- }
+ installSmsWebhookForwarder(routes, getActivityJetStream);
WebhookController(routes);
OAuth2Controller(routes);
OAuth2ApplicationsController(routes);
@@ -84,24 +78,3 @@ export function registerControllers(routes: HonoApp, config: APIConfig): void {
}
StripeController(routes);
}
-
-function registerInboundSmsWebhook(routes: HonoApp): void {
- const authToken = Config.sms.inboundWebhookAuthToken;
- const publicWebhookUrl = Config.sms.inboundWebhookPublicUrl;
- if (!authToken || !publicWebhookUrl) {
- Logger.warn(
- {},
- 'Twilio inbound SMS webhook not configured (need integrations.sms.inbound_webhook_auth_token + integrations.sms.inbound_webhook_public_url); skipping installation',
- );
- return;
- }
- installTwilioInboundSmsWebhook(routes, {
- authToken,
- publicWebhookUrl,
- inboundSmsChallengeService: getInboundSmsChallengeServiceInstance(),
- userRepository: getUserRepositoryInstance(),
- gatewayService: getGatewayService(),
- cacheService: getCacheService(),
- });
- Logger.info({publicWebhookUrl}, 'Twilio inbound SMS webhook installed');
-}
diff --git a/fluxer_api/src/api/app/MiddlewarePipeline.ts b/fluxer_api/src/api/app/MiddlewarePipeline.ts
index 4021b0a31..f3595f606 100644
--- a/fluxer_api/src/api/app/MiddlewarePipeline.ts
+++ b/fluxer_api/src/api/app/MiddlewarePipeline.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {ILogger} from '@app/api/ILogger';
-import {ClientErrorAbuseSignalMiddleware} from '@app/api/middleware/AbusiveIpAutoBanner';
+import {ActivityContextMiddleware} from '@app/api/infrastructure/activity/ActivityMeta';
import {AuditLogMiddleware} from '@app/api/middleware/AuditLogMiddleware';
import {ConcurrencyLimitMiddleware} from '@app/api/middleware/ConcurrencyLimitMiddleware';
import ContentFilterMiddleware from '@app/api/middleware/ContentFilterMiddleware';
@@ -9,9 +9,9 @@ import {GuildAvailabilityMiddleware} from '@app/api/middleware/GuildAvailability
import {IpBanMiddleware} from '@app/api/middleware/IpBanMiddleware';
import {LocaleMiddleware} from '@app/api/middleware/LocaleMiddleware';
import {RequestCacheMiddleware} from '@app/api/middleware/RequestCacheMiddleware';
+import {RequestErrorTelemetry} from '@app/api/middleware/RequestErrorTelemetry';
import {RequireClientIpMiddleware} from '@app/api/middleware/RequireClientIpMiddleware';
import {ServiceMiddleware} from '@app/api/middleware/ServiceMiddleware';
-import {TorExitMiddleware} from '@app/api/middleware/TorExitMiddleware';
import {TrustedClientIpHeaderMiddleware} from '@app/api/middleware/TrustedClientIpHeaderMiddleware';
import {UserMiddleware} from '@app/api/middleware/UserMiddleware';
import type {HonoApp} from '@app/api/types/HonoEnv';
@@ -29,19 +29,10 @@ interface MiddlewarePipelineOptions {
trustClientIpHeader: boolean;
clientIpHeaderName?: string;
maxInflightRequests: number;
- torExitBlockingEnabled: boolean;
}
export function configureMiddleware(routes: HonoApp, options: MiddlewarePipelineOptions): void {
- const {
- logger,
- nodeEnv,
- corsOrigins,
- trustClientIpHeader,
- clientIpHeaderName,
- maxInflightRequests,
- torExitBlockingEnabled,
- } = options;
+ const {logger, nodeEnv, corsOrigins, trustClientIpHeader, clientIpHeaderName, maxInflightRequests} = options;
const resolvedHeader = resolveClientIpHeaderName(clientIpHeaderName);
routes.use('/webhooks/:webhook_id/:token', cors({origins: '*'}));
routes.use('/webhooks/:webhook_id/:token/messages/:message_id', cors({origins: '*'}));
@@ -85,7 +76,7 @@ export function configureMiddleware(routes: HonoApp, options: MiddlewarePipeline
skip: ['/_health'],
}),
);
- routes.use(ClientErrorAbuseSignalMiddleware);
+ routes.use(RequestErrorTelemetry);
routes.use(RequestCacheMiddleware);
if (nodeEnv === 'production') {
routes.use('*', async (ctx, next) => {
@@ -109,11 +100,9 @@ export function configureMiddleware(routes: HonoApp, options: MiddlewarePipeline
}),
);
}
- if (torExitBlockingEnabled) {
- routes.use(TorExitMiddleware);
- }
routes.use(AuditLogMiddleware);
routes.use(RequireClientIpMiddleware());
+ routes.use(ActivityContextMiddleware);
routes.use(ServiceMiddleware);
routes.use(UserMiddleware);
routes.use(ContentFilterMiddleware);
diff --git a/fluxer_api/src/api/app/tests/MiddlewarePipeline.test.ts b/fluxer_api/src/api/app/tests/MiddlewarePipeline.test.ts
deleted file mode 100644
index 0ef8e1140..000000000
--- a/fluxer_api/src/api/app/tests/MiddlewarePipeline.test.ts
+++ /dev/null
@@ -1,32 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {configureMiddleware} from '@app/api/app/MiddlewarePipeline';
-import {TorExitMiddleware} from '@app/api/middleware/TorExitMiddleware';
-import {NoopLogger} from '@app/api/test/mocks/NoopLogger';
-import type {HonoEnv} from '@app/api/types/HonoEnv';
-import {Hono} from 'hono';
-import {describe, expect, it} from 'vitest';
-
-function registeredHandlers(torExitBlockingEnabled: boolean): Array<unknown> {
- const routes = new Hono<HonoEnv>({strict: true});
- configureMiddleware(routes, {
- logger: new NoopLogger(),
- nodeEnv: 'test',
- corsOrigins: ['http://localhost:3000'],
- trustClientIpHeader: true,
- clientIpHeaderName: 'x-forwarded-for',
- maxInflightRequests: 100,
- torExitBlockingEnabled,
- });
- return routes.routes.map((route) => route.handler);
-}
-
-describe('tor exit blocking in the middleware pipeline', () => {
- it('registers the tor exit middleware when the switch is on', () => {
- expect(registeredHandlers(true)).toContain(TorExitMiddleware);
- });
-
- it('leaves the tor exit middleware unregistered when the switch is off', () => {
- expect(registeredHandlers(false)).not.toContain(TorExitMiddleware);
- });
-});
diff --git a/fluxer_api/src/api/app/tests/ProductionClientIpPipeline.test.ts b/fluxer_api/src/api/app/tests/ProductionClientIpPipeline.test.ts
index 5f9aa01a5..9450e0586 100644
--- a/fluxer_api/src/api/app/tests/ProductionClientIpPipeline.test.ts
+++ b/fluxer_api/src/api/app/tests/ProductionClientIpPipeline.test.ts
@@ -21,7 +21,6 @@ function createProductionApp(): Hono<HonoEnv> {
trustClientIpHeader: true,
clientIpHeaderName: CLIENT_IP_HEADER_NAME,
maxInflightRequests: 100,
- torExitBlockingEnabled: false,
});
routes.onError(AppErrorHandler);
routes.notFound(AppNotFoundHandler);
diff --git a/fluxer_api/src/api/auth/AuthLogin.ts b/fluxer_api/src/api/auth/AuthLogin.ts
index c0c3664d9..0bcfcd22d 100644
--- a/fluxer_api/src/api/auth/AuthLogin.ts
+++ b/fluxer_api/src/api/auth/AuthLogin.ts
@@ -14,6 +14,7 @@ import {
createUserID,
} from '@app/api/BrandedTypes';
import {getContentMessage} from '@app/api/content_i18n/ContentI18n';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
import type {KVAccountDeletionQueueService} from '@app/api/infrastructure/KVAccountDeletionQueueService';
import {
REGISTRATION_PENDING_APPROVAL_TRAIT,
@@ -107,6 +108,16 @@ function getTokenCacheKey(token: string): string {
return `ip-auth-token:${token}`;
}
+function emitLogin(user: User, ok: boolean, details: {failure?: string; mfa?: boolean; newIp?: boolean} = {}): void {
+ void emitActivity('login', user.id.toString(), {
+ user_id: user.id.toString(),
+ ok,
+ failure: details.failure ?? null,
+ mfa: details.mfa ?? false,
+ new_ip: details.newIp ?? false,
+ });
+}
+
export async function resendIpAuthorization(
ctx: ApiContext,
ticket: string,
@@ -179,6 +190,7 @@ export async function completeIpAuthorization(
AuthUtility.assertNonBotUser(ctx, user);
await users.createAuthorizedIp(user.id, payload.origin.ip);
const [sessionToken] = await AuthSession.createAuthSession(ctx, {user, origin: payload.origin});
+ emitLogin(user, true, {newIp: true});
await cache.delete(cacheKey);
await cache.delete(getTokenCacheKey(token));
return {token: sessionToken, user_id: user.id.toString(), ticket: tokenMapping.ticket};
@@ -222,6 +234,7 @@ export async function login(
AuthUtility.assertNonBotUser(ctx, user);
if (!user.passwordHash) {
await AuthPassword.verifyPassword(ctx, {password: data.password, passwordHash: DUMMY_ARGON2_HASH});
+ emitLogin(user, false, {failure: 'no_password'});
throw InputValidationError.fromCodes([
{path: 'email', code: ValidationErrorCodes.INVALID_EMAIL_OR_PASSWORD},
{path: 'password', code: ValidationErrorCodes.INVALID_EMAIL_OR_PASSWORD},
@@ -232,39 +245,17 @@ export async function login(
passwordHash: user.passwordHash,
});
if (!isMatch) {
+ emitLogin(user, false, {failure: 'bad_password'});
throw InputValidationError.fromCodes([
{path: 'email', code: ValidationErrorCodes.INVALID_EMAIL_OR_PASSWORD},
{path: 'password', code: ValidationErrorCodes.INVALID_EMAIL_OR_PASSWORD},
]);
}
- let currentUser = await AuthUtility.handleBanStatus(ctx, user);
- if ((currentUser.flags & UserFlags.DISABLED) !== 0n && !currentUser.tempBannedUntil) {
- const updatedFlags = currentUser.flags & ~UserFlags.DISABLED;
- currentUser = await users.patchUpsert(
- currentUser.id,
- {
- flags: updatedFlags,
- },
- currentUser.toRow(),
- );
- Logger.info({userId: currentUser.id}, 'Auto-undisabled user on login');
- }
- if ((currentUser.flags & UserFlags.SELF_DELETED) !== 0n) {
- const pendingDeletionAt = currentUser.pendingDeletionAt;
- const updatedFlags = currentUser.flags & ~UserFlags.SELF_DELETED;
- currentUser = await users.updateDeletionSchedule(currentUser, {
- flags: updatedFlags,
- pending_deletion_at: null,
- deletion_reason_code: null,
- deletion_public_reason: null,
- deletion_audit_log_reason: null,
- });
- if (pendingDeletionAt) {
- await users.removePendingDeletion(currentUser.id, pendingDeletionAt);
- }
- await kvDeletionQueue.removeFromQueue(currentUser.id);
- Logger.info({userId: currentUser.id}, 'Auto-cancelled deletion on login');
- }
+ const currentUser = await AuthUtility.reactivateOnSignIn(
+ ctx,
+ await AuthUtility.handleBanStatus(ctx, user),
+ kvDeletionQueue,
+ );
if (currentUser.traits.has(REGISTRATION_PENDING_APPROVAL_TRAIT)) {
throw new RegistrationPendingApprovalError();
}
@@ -275,8 +266,10 @@ export async function login(
currentUser.authenticatorTypes.has(UserAuthenticatorTypes.TOTP) ||
currentUser.authenticatorTypes.has(UserAuthenticatorTypes.WEBAUTHN);
const isAppStoreReviewer = (currentUser.flags & UserFlags.APP_STORE_REVIEWER) !== 0n;
+ let newIp = false;
if (!hasMfa && !isAppStoreReviewer) {
const isIpAuthorized = await users.checkIpAuthorized(currentUser.id, clientIp);
+ newIp = !isIpAuthorized;
if (!isIpAuthorized) {
const instanceConfigRepository = getInstanceConfigRepository();
const [integrationsConfig, effectiveEmailConfig] = await Promise.all([
@@ -318,6 +311,7 @@ export async function login(
clientLocation,
currentUser.locale,
);
+ emitLogin(currentUser, false, {failure: 'ip_authorization_required', newIp: true});
throw new IpAuthorizationRequiredError({
ticket,
email: currentUser.email!,
@@ -345,6 +339,7 @@ export async function login(
user: currentUser,
origin: AuthSession.resolveSessionOrigin(ctx, request),
});
+ emitLogin(currentUser, true, {newIp});
return {
user_id: currentUser.id.toString(),
token,
@@ -428,7 +423,9 @@ export async function completeMfaLogin(
await cache.delete(`mfa-ticket:${ticket}`);
await rateLimit.resetLimit(`mfa:ticket:${ticket}`);
await rateLimit.resetLimit(`mfa:user:${user.id}`);
- return createLoginSession(ctx, user, request);
+ const session = await createLoginSession(ctx, user, request);
+ emitLogin(user, true, {mfa: true});
+ return session;
}
export async function loginMfaWebAuthn(
diff --git a/fluxer_api/src/api/auth/AuthPhone.ts b/fluxer_api/src/api/auth/AuthPhone.ts
index be36171e9..c7968576a 100644
--- a/fluxer_api/src/api/auth/AuthPhone.ts
+++ b/fluxer_api/src/api/auth/AuthPhone.ts
@@ -1,51 +1,25 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {ApiContext} from '@app/api/ApiContext';
-import {phonePrefixBanCache} from '@app/api/auth/PhonePrefixBanCache';
-import {requiresInboundPhoneVerification} from '@app/api/auth/PhoneVerificationPrefixPolicy';
-import {PhoneVerificationReuseStore} from '@app/api/auth/PhoneVerificationReuseStore';
-import type {IssuedChallenge} from '@app/api/auth/services/InboundSmsChallengeService';
-import type {PhoneAttemptInboundReason, PhoneAttemptRejectReason} from '@app/api/auth/services/PhoneLookupRepository';
+import {
+ errorForPhoneReply,
+ getPhoneVerificationClient,
+ type PhoneRpcRequestInfo,
+} from '@app/api/auth/PhoneVerificationClient';
import type {UserID} from '@app/api/BrandedTypes';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import type {Challenge, PhoneChannel} from '@app/api/infrastructure/activity/Contract.generated';
import {Logger} from '@app/api/Logger';
+import {getAdminRepository} from '@app/api/middleware/ServiceSingletons';
import type {User} from '@app/api/models/User';
-import {mapUserToPartialResponse, mapUserToPrivateResponse} from '@app/api/user/UserMappers';
-import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
-import {PHONE_ADD_CLEARABLE_FLAGS, UserFlags} from '@fluxer/constants/src/UserConstants';
+import {accountStateDepsFromContext, applyPhoneVerified, outcomeOf} from '@app/api/user/services/AccountStateApplier';
+import {UserFlags} from '@fluxer/constants/src/UserConstants';
import {BotUserAuthEndpointAccessDeniedError} from '@fluxer/errors/src/domains/auth/BotUserAuthEndpointAccessDeniedError';
import {InvalidPhoneNumberError} from '@fluxer/errors/src/domains/auth/InvalidPhoneNumberError';
-import {InvalidPhoneVerificationCodeError} from '@fluxer/errors/src/domains/auth/InvalidPhoneVerificationCodeError';
-import {PhoneAlreadyUsedError} from '@fluxer/errors/src/domains/auth/PhoneAlreadyUsedError';
-import {PhoneCountryNotSupportedError} from '@fluxer/errors/src/domains/auth/PhoneCountryNotSupportedError';
-import {PhoneInboundVerificationRequiredError} from '@fluxer/errors/src/domains/auth/PhoneInboundVerificationRequiredError';
-import {PhoneLookupUnavailableError} from '@fluxer/errors/src/domains/auth/PhoneLookupUnavailableError';
-import {PhoneNumberNotInServiceError} from '@fluxer/errors/src/domains/auth/PhoneNumberNotInServiceError';
-import {PhoneNumberNotMobileError} from '@fluxer/errors/src/domains/auth/PhoneNumberNotMobileError';
-import {PhoneVerificationNeedsReviewError} from '@fluxer/errors/src/domains/auth/PhoneVerificationNeedsReviewError';
import {PhoneVerificationRequiredError} from '@fluxer/errors/src/domains/auth/PhoneVerificationRequiredError';
import {SmsVerificationUnavailableError} from '@fluxer/errors/src/domains/auth/SmsVerificationUnavailableError';
-import {CaptchaVerificationRequiredError} from '@fluxer/errors/src/domains/core/CaptchaVerificationRequiredError';
-import {RateLimitError} from '@fluxer/errors/src/domains/core/RateLimitError';
import {UnknownUserError} from '@fluxer/errors/src/domains/user/UnknownUserError';
-import type {FluxerError} from '@fluxer/errors/src/FluxerError';
import {PHONE_E164_REGEX} from '@fluxer/schema/src/primitives/UserValidators';
-import type {RateLimitResult, RateLimitScope} from '@pkgs/rate_limit/src/IRateLimitService';
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import {
- ACCEPTED_PHONE_LINE_TYPES,
- getSmsPumpingRiskThreshold,
- HARD_REJECT_PHONE_LINE_TYPES,
- VOIP_PHONE_LINE_TYPES,
-} from '@pkgs/sms/src/PhoneLookupTypes';
-import {SmsVerificationStartError, TwilioVerificationRateLimitError} from '@pkgs/sms/src/providers/TwilioSmsProvider';
-import type {SmsVerificationStartOptions} from '@pkgs/sms/src/SmsVerificationTypes';
-
-const MINUTE_MS = 60_000;
-const HOUR_MS = 60 * MINUTE_MS;
-const DAY_MS = 24 * HOUR_MS;
-const ACCOUNT_SMS_SEND_LIMIT = {maxAttempts: 3, windowMs: 6 * HOUR_MS};
-const PHONE_SMS_SEND_LIMIT = {maxAttempts: 3, windowMs: 5 * DAY_MS};
-const TWILIO_PHONE_PREFIX_RATE_LIMIT_LENGTH = 6;
type PhoneVerificationStartResult =
| {channel: 'sms'}
@@ -54,578 +28,111 @@ type PhoneVerificationStartResult =
challengeCode: string;
ourNumber: string;
expiresAt: Date;
- reason: PhoneAttemptInboundReason;
};
-interface SendPhoneVerificationOptions {
- clientIp?: string;
- channel?: 'sms' | 'inbound_challenge';
-}
-
-function assertNonBotUser(user: User): void {
- if (user.isBot) {
- throw new BotUserAuthEndpointAccessDeniedError();
- }
-}
-
-function reuseStoreFor(ctx: ApiContext): PhoneVerificationReuseStore {
- return new PhoneVerificationReuseStore(ctx.services.cache);
-}
-
-export async function startInboundPhoneChallenge(ctx: ApiContext, userId: UserID): Promise<IssuedChallenge> {
- const {inboundSmsChallenge, users, config} = ctx.services;
- const ourNumber = config.sms.inboundChallengeNumber;
- if (!inboundSmsChallenge || !ourNumber) {
- Logger.warn(
- {userId: String(userId)},
- 'Inbound SMS challenge requested but FLUXER_SMS_INBOUND_CHALLENGE_NUMBER is unset',
- );
- throw new SmsVerificationUnavailableError();
- }
- const user = await users.findUnique(userId);
- if (!user) throw new UnknownUserError();
- assertNonBotUser(user);
- return inboundSmsChallenge.issueChallenge({userId, ourNumber});
-}
-
-class PhoneInboundChallengeRequiredError extends Error {
- constructor(readonly reason: PhoneAttemptInboundReason) {
- super(`Phone verification must be completed via inbound challenge: ${reason}`);
- this.name = 'PhoneInboundChallengeRequiredError';
- }
-}
-
-interface ValidatePhoneOptions {
- inboundCapable?: boolean;
+interface IssuedChallenge {
+ challengeCode: string;
+ ourNumber: string;
+ expiresAt: Date;
}
-async function validatePhoneOrThrow(ctx: ApiContext, phone: string, options: ValidatePhoneOptions = {}): Promise<void> {
- assertPhoneFormatOrThrow(phone);
- const {phoneLookup, sms} = ctx.services;
- const cached = (await phoneLookup?.getCachedLookup(phone)) ?? null;
- const lookup = cached ?? (await sms.lookupPhone(phone));
- const cacheHit = cached !== null;
- if (!cacheHit && lookup) {
- await phoneLookup?.setCachedLookup(phone, lookup);
- }
- const verdict = computePhoneVerdict(lookup, phone);
- await phoneLookup?.recordAttempt({
- phone,
- lookup,
- verdict: verdict.verdict,
- rejectReason: verdict.verdict === 'reject' ? verdict.rejectReason : null,
- inboundReason: verdict.verdict === 'require_inbound' ? verdict.inboundReason : null,
- lookupCacheHit: cacheHit,
- });
- if (verdict.verdict === 'reject') {
- if (verdict.rejectReason === 'lookup_unavailable') {
- Logger.error({phone}, 'Phone lookup unavailable — rejecting attachment (fail-closed)');
- } else {
- Logger.info(
- {
- phone,
- rejectReason: verdict.rejectReason,
- lineType: lookup?.lineType ?? null,
- carrier: lookup?.carrierName ?? null,
- country: lookup?.countryCode ?? null,
- smsPumpingRiskScore: lookup?.smsPumpingRiskScore ?? null,
- lookupCacheHit: cacheHit,
- },
- 'Phone verification rejected at gate',
- );
- }
- throw errorForPhoneRejectReason(verdict.rejectReason);
- }
- if (verdict.verdict === 'require_inbound') {
- Logger.info(
- {
- phone,
- inboundReason: verdict.inboundReason,
- lineType: lookup?.lineType ?? null,
- country: lookup?.countryCode ?? null,
- },
- 'Phone verification routed to inbound challenge',
- );
- if (options.inboundCapable) {
- throw new PhoneInboundChallengeRequiredError(verdict.inboundReason);
- }
- throw new PhoneInboundVerificationRequiredError();
- }
+interface SendPhoneVerificationOptions {
+ clientIp: string;
+ channel?: PhoneChannel;
}
-function assertPhoneFormatOrThrow(phone: string): void {
+function assertPhoneFormat(phone: string): void {
if (!PHONE_E164_REGEX.test(phone)) {
throw new InvalidPhoneNumberError();
}
- if (phonePrefixBanCache.isBlocked(phone)) {
- throw new PhoneCountryNotSupportedError();
- }
}
-async function issueInboundChallengeOrThrow(
- ctx: ApiContext,
- userId: UserID,
- phone: string,
- reason: PhoneAttemptInboundReason,
-): Promise<PhoneVerificationStartResult> {
- try {
- const challenge = await startInboundPhoneChallenge(ctx, userId);
- return {
- channel: 'inbound_challenge',
- challengeCode: challenge.challengeCode,
- ourNumber: challenge.ourNumber,
- expiresAt: challenge.expiresAt,
- reason,
- };
- } catch (error) {
- Logger.error({phone, userId: String(userId), reason, error}, 'Inbound phone challenge required but unavailable');
- throw new SmsVerificationUnavailableError();
- }
+async function loadRequestingUser(ctx: ApiContext, userId: UserID): Promise<User> {
+ const user = await ctx.services.users.findUnique(userId);
+ if (!user) throw new UnknownUserError();
+ if (user.isBot) throw new BotUserAuthEndpointAccessDeniedError();
+ return user;
}
-export async function sendPhoneVerificationCode(
- ctx: ApiContext,
- phone: string,
- userId: UserID | null,
- options: SendPhoneVerificationOptions = {},
-): Promise<PhoneVerificationStartResult> {
- assertPhoneFormatOrThrow(phone);
- const {users, sms} = ctx.services;
- let requestingUser: User | null = null;
- if (userId) {
- requestingUser = await users.findUnique(userId);
- if (requestingUser) {
- assertNonBotUser(requestingUser);
- }
- }
- const accountForcedInbound =
- requestingUser !== null && (requestingUser.flags & UserFlags.FORCE_INBOUND_PHONE_VERIFICATION) !== 0n;
- const prefixForcedInbound =
- userId !== null && requestingUser !== null && shouldRequireInboundPhoneChallenge(phone, requestingUser);
- const requireInbound = options.channel === 'inbound_challenge' || accountForcedInbound || prefixForcedInbound;
- if (requireInbound && userId) {
- const inboundReason: PhoneAttemptInboundReason = accountForcedInbound ? 'account_forced' : 'expensive_destination';
- return await issueInboundChallengeOrThrow(ctx, userId, phone, inboundReason);
- }
- const riskInput = {
- userId: userId ? userId.toString() : null,
- clientIp: options.clientIp ?? null,
- phone,
- };
- const preRisk = await ctx.services.phoneAttemptRisk.evaluate(riskInput);
- if (preRisk.decision === 'hard_block') {
- Logger.warn({...riskInput, reason: preRisk.reason}, 'phone_attempt_risk hard_block at send');
- throw createPhoneRateLimitError(
- {
- retryAfter: 24 * 60 * 60,
- retryAfterDecimal: 24 * 60 * 60,
- limit: 1,
- resetTime: new Date(Date.now() + 24 * 60 * 60 * 1000),
- resetAfterDecimal: 24 * 60 * 60,
- },
- 'user',
- );
- }
- if (preRisk.decision === 'require_inbound' && userId) {
- return await issueInboundChallengeOrThrow(ctx, userId, phone, 'behavioural_risk');
- }
- if (preRisk.decision === 'require_captcha') {
- throw new CaptchaVerificationRequiredError();
- }
- await throwIfProviderCooldownActive(ctx, phone, userId);
- let rejectedAttempt = false;
- let lookupCountry: string | null = null;
- try {
- try {
- await validatePhoneOrThrow(ctx, phone, {inboundCapable: userId !== null});
- } catch (error) {
- if (error instanceof PhoneInboundChallengeRequiredError && userId !== null) {
- await ctx.services.phoneAttemptRisk.record({...riskInput, rejected: false});
- return await issueInboundChallengeOrThrow(ctx, userId, phone, error.reason);
- }
- rejectedAttempt = !(error instanceof PhoneLookupUnavailableError);
- throw error;
- }
- const cached = await ctx.services.phoneLookup?.getCachedLookup(phone);
- lookupCountry = cached?.countryCode ?? null;
- if (await reuseStoreFor(ctx).hasReachedVerificationLimit(phone)) {
- rejectedAttempt = true;
- throw new PhoneAlreadyUsedError();
- }
- await enforceSmsSendProtections(ctx, phone, requestingUser);
- try {
- const startOptions = buildVerificationStartOptions(phone, userId, options);
- await sms.startVerificationWithResult(phone, startOptions);
- return {channel: 'sms'};
- } catch (error) {
- if (error instanceof TwilioVerificationRateLimitError) {
- rejectedAttempt = true;
- await recordProviderCooldown(ctx, phone, userId, error);
- throw error;
- }
- if (error instanceof SmsVerificationStartError) {
- rejectedAttempt = true;
- Logger.warn(
- {phone, userId: userId ? String(userId) : null, context: error.sentryContext},
- 'Phone verification send unavailable',
- );
- throw new SmsVerificationUnavailableError();
- }
- rejectedAttempt = true;
- throw error;
- }
- } finally {
- try {
- await ctx.services.phoneAttemptRisk.record({
- ...riskInput,
- countryCode: lookupCountry,
- rejected: rejectedAttempt,
- });
- } catch (error) {
- Logger.warn({error}, 'phone_attempt_risk record failed (non-fatal)');
- }
- }
+function requestInfo(ctx: ApiContext, userId: UserID, phone: string): PhoneRpcRequestInfo {
+ return {userId: userId.toString(), phone, requestId: ctx.request.requestId};
}
-function buildVerificationStartOptions(
- phone: string,
- userId: UserID | null,
- options: SendPhoneVerificationOptions,
-): SmsVerificationStartOptions {
- const rateLimits: Record<string, string> = {
- fluxer_phone_prefix: getRateLimitPhonePrefix(phone),
- };
- if (userId) {
- rateLimits.fluxer_user_id = userId.toString();
- }
- if (options.clientIp) {
- rateLimits.fluxer_client_ip = options.clientIp;
- }
+function toIssuedChallenge(challenge: Challenge): IssuedChallenge {
return {
- rateLimits,
+ challengeCode: challenge.challenge_code,
+ ourNumber: challenge.our_number,
+ expiresAt: new Date(challenge.expires_at_ms),
};
}
-function shouldRequireInboundPhoneChallenge(phone: string, user: User): boolean {
- if (user.hasVerifiedPhone) return false;
- return requiresInboundPhoneVerification(phone);
-}
-
-function getRateLimitPhonePrefix(phone: string): string {
- return phone.slice(0, TWILIO_PHONE_PREFIX_RATE_LIMIT_LENGTH);
-}
-
-export async function verifyPhoneCode(ctx: ApiContext, phone: string, code: string, userId: UserID): Promise<void> {
- await validatePhoneOrThrow(ctx, phone);
- const {sms} = ctx.services;
- let isValid: boolean;
- try {
- isValid = await sms.checkVerification(phone, code);
- } catch (error) {
- if (error instanceof TwilioVerificationRateLimitError) {
- await recordProviderCooldown(ctx, phone, userId, error);
- }
- throw error;
- }
- if (!isValid) {
- throw new InvalidPhoneVerificationCodeError();
- }
- await attachVerifiedPhoneToAccount(ctx, userId, phone);
-}
-
-async function attachVerifiedPhoneToAccount(ctx: ApiContext, userId: UserID, phone: string): Promise<void> {
- const {users, gateway, contactChangeLog} = ctx.services;
- if (!(await reuseStoreFor(ctx).claimVerificationSlot(phone))) {
- throw new PhoneAlreadyUsedError();
- }
- const user = await users.findUnique(userId);
- if (!user) {
- throw new PhoneVerificationRequiredError();
- }
- assertNonBotUser(user);
- if (user.flags & UserFlags.DELETED) {
- throw new PhoneVerificationRequiredError();
- }
- const updates: {flags?: bigint; has_verified_phone: boolean; suspicious_activity_flags?: number} = {
- has_verified_phone: true,
- };
- const shouldClearSpammerFlag = (user.flags & UserFlags.SPAMMER) === UserFlags.SPAMMER;
- if (shouldClearSpammerFlag) {
- updates.flags = user.flags & ~UserFlags.SPAMMER;
- }
- if (user.suspiciousActivityFlags !== null && user.suspiciousActivityFlags !== 0) {
- const newFlags = user.suspiciousActivityFlags & ~PHONE_ADD_CLEARABLE_FLAGS;
- if (newFlags !== user.suspiciousActivityFlags) {
- updates.suspicious_activity_flags = newFlags;
- }
- }
- const updatedUser = await users.patchUpsert(userId, updates, user.toRow());
- await contactChangeLog.recordDiff({
- oldUser: user,
- newUser: updatedUser,
- reason: 'user_requested',
- actorUserId: userId,
- });
- await gateway.dispatchPresence({
- userId,
- event: 'USER_UPDATE',
- data: mapUserToPrivateResponse(updatedUser),
- });
- if (shouldClearSpammerFlag) {
- await dispatchForcedGuildMemberUpdates(ctx, updatedUser);
- }
-}
-
-async function dispatchForcedGuildMemberUpdates(ctx: ApiContext, updatedUser: User): Promise<void> {
- const {users, gateway} = ctx.services;
- const userPartial = mapUserToPartialResponse(updatedUser);
- const guildIds = await users.getUserGuildIds(updatedUser.id);
- for (const guildId of guildIds) {
- const guildMemberResult = await gateway.getGuildMember({
- guildId,
- userId: updatedUser.id,
- });
- if (!guildMemberResult.success || !guildMemberResult.memberData) {
- continue;
- }
- await gateway.dispatchGuild({
- guildId,
- event: 'GUILD_MEMBER_UPDATE',
- data: {
- ...guildMemberResult.memberData,
- user: userPartial,
- },
- });
- }
-}
-
-async function enforceSmsSendProtections(ctx: ApiContext, phone: string, user: User | null): Promise<void> {
- if (user) {
- await checkPhoneSendLimit(
- ctx,
- {
- identifier: `auth:phone:send:any:${user.id.toString()}`,
- ...ACCOUNT_SMS_SEND_LIMIT,
- },
- 'user',
- );
- }
- await checkPhoneSendLimit(
- ctx,
+export async function sendPhoneVerificationCode(
+ ctx: ApiContext,
+ phone: string,
+ userId: UserID,
+ options: SendPhoneVerificationOptions,
+): Promise<PhoneVerificationStartResult> {
+ assertPhoneFormat(phone);
+ const user = await loadRequestingUser(ctx, userId);
+ const reply = await getPhoneVerificationClient().start(
{
- identifier: `auth:phone:send:phone:${phone}`,
- ...PHONE_SMS_SEND_LIMIT,
+ user_id: user.id.toString(),
+ user_flags: user.flags.toString(),
+ has_verified_phone: user.hasVerifiedPhone,
+ phone,
+ requested_channel: options.channel ?? null,
+ client_ip: options.clientIp,
+ captcha_passed: false,
},
- 'shared',
+ requestInfo(ctx, userId, phone),
);
-}
-
-async function checkPhoneSendLimit(
- ctx: ApiContext,
- config: {identifier: string; maxAttempts: number; windowMs: number},
- scope: RateLimitScope,
-): Promise<void> {
- const result = await ctx.services.rateLimit.checkLimit(config);
- if (!result.allowed) {
- throw createPhoneRateLimitError(result, scope);
+ switch (reply.result) {
+ case 'sms_sent':
+ return {channel: 'sms'};
+ case 'inbound_challenge':
+ return {channel: 'inbound_challenge', ...toIssuedChallenge(reply)};
+ case 'error':
+ throw errorForPhoneReply(reply);
}
}
-function createPhoneRateLimitError(
- result: Pick<RateLimitResult, 'retryAfter' | 'retryAfterDecimal' | 'limit' | 'resetTime' | 'resetAfterDecimal'>,
- scope: RateLimitScope,
-): RateLimitError {
- return new RateLimitError({
- code: APIErrorCodes.PHONE_RATE_LIMIT_EXCEEDED,
- retryAfter: result.retryAfter,
- retryAfterDecimal: result.retryAfterDecimal,
- limit: result.limit,
- resetTime: result.resetTime,
- resetAfterDecimal: result.resetAfterDecimal,
- scope,
- });
+export async function startInboundPhoneChallenge(ctx: ApiContext, userId: UserID): Promise<IssuedChallenge> {
+ const user = await loadRequestingUser(ctx, userId);
+ const reply = await getPhoneVerificationClient().challenge(
+ {user_id: user.id.toString()},
+ requestInfo(ctx, userId, ''),
+ );
+ if (reply.result === 'error') throw errorForPhoneReply(reply);
+ return toIssuedChallenge(reply);
}
-async function throwIfProviderCooldownActive(ctx: ApiContext, phone: string, userId: UserID | null): Promise<void> {
- const accountCooldown = userId ? await readCooldown(ctx, getProviderAccountCooldownKey(userId)) : null;
- const phoneCooldown = await readCooldown(ctx, getProviderPhoneCooldownKey(phone));
- const cooldown = pickLongerCooldown(accountCooldown, phoneCooldown);
- if (!cooldown) {
- return;
- }
- throw createPhoneRateLimitError(
+export async function verifyPhoneCode(ctx: ApiContext, phone: string, code: string, userId: UserID): Promise<void> {
+ assertPhoneFormat(phone);
+ const user = await ctx.services.users.findUnique(userId);
+ if (!user || (user.flags & UserFlags.DELETED) !== 0n) throw new PhoneVerificationRequiredError();
+ if (user.isBot) throw new BotUserAuthEndpointAccessDeniedError();
+ const reply = await getPhoneVerificationClient().check(
{
- retryAfter: cooldown.retryAfter,
- retryAfterDecimal: cooldown.retryAfter,
- limit: 1,
- resetTime: new Date(Date.now() + cooldown.retryAfter * 1000),
- resetAfterDecimal: cooldown.retryAfter,
+ user_id: user.id.toString(),
+ user_flags: user.flags.toString(),
+ phone,
+ code,
+ client_ip: ctx.request.clientIp ?? '',
},
- cooldown.scope,
+ requestInfo(ctx, userId, phone),
);
-}
-
-async function recordProviderCooldown(
- ctx: ApiContext,
- phone: string,
- userId: UserID | null,
- error: TwilioVerificationRateLimitError,
-): Promise<void> {
- const {cache} = ctx.services;
- const ttlSeconds = Math.max(1, Math.ceil(error.cooldownMs / 1000));
- const payload = {provider_message: error.message};
- if ((error.cooldownScope === 'account' || error.cooldownScope === 'account_and_phone') && userId) {
- await cache.set(getProviderAccountCooldownKey(userId), payload, ttlSeconds);
- }
- if (error.cooldownScope === 'phone' || error.cooldownScope === 'account_and_phone') {
- await cache.set(getProviderPhoneCooldownKey(phone), payload, ttlSeconds);
- }
-}
-
-function getProviderAccountCooldownKey(userId: UserID): string {
- return `auth:phone:provider-cooldown:user:${userId.toString()}`;
-}
-
-function getProviderPhoneCooldownKey(phone: string): string {
- return `auth:phone:provider-cooldown:phone:${phone}`;
-}
-
-async function readCooldown(ctx: ApiContext, key: string): Promise<{retryAfter: number; scope: RateLimitScope} | null> {
- const {cache} = ctx.services;
- const payload = await cache.get<unknown>(key);
- if (!payload) {
- return null;
- }
- const ttl = await cache.ttl(key);
- const retryAfter = ttl > 0 ? ttl : 60;
- return {
- retryAfter,
- scope: key.includes(':phone:') ? 'shared' : 'user',
- };
-}
-
-function pickLongerCooldown(
- a: {retryAfter: number; scope: RateLimitScope} | null,
- b: {retryAfter: number; scope: RateLimitScope} | null,
-): {retryAfter: number; scope: RateLimitScope} | null {
- if (!a) return b;
- if (!b) return a;
- return a.retryAfter >= b.retryAfter ? a : b;
-}
-
-type PhoneVerdictResult =
- | {verdict: 'accept'; rejectReason: null}
- | {verdict: 'reject'; rejectReason: PhoneAttemptRejectReason}
- | {verdict: 'require_inbound'; inboundReason: PhoneAttemptInboundReason};
-
-export function errorForPhoneRejectReason(reason: PhoneAttemptRejectReason): FluxerError {
- switch (reason) {
- case 'invalid_format':
- return new InvalidPhoneNumberError();
- case 'banned_prefix':
- return new PhoneCountryNotSupportedError();
- case 'lookup_unavailable':
- return new PhoneLookupUnavailableError();
- case 'invalid_number':
- return new PhoneNumberNotInServiceError();
- case 'line_type_not_mobile':
- case 'line_type_hard_rejected':
- return new PhoneNumberNotMobileError();
- case 'sms_pumping_risk_high':
- case 'behavioural_risk_blocked':
- return new PhoneVerificationNeedsReviewError();
- }
-}
-
-function computePhoneVerdict(lookup: PhoneLookupResult | null, phone: string): PhoneVerdictResult {
- if (lookup == null) {
- return {verdict: 'reject', rejectReason: 'lookup_unavailable'};
- }
- if (!lookup.valid) {
- return {verdict: 'reject', rejectReason: 'invalid_number'};
- }
- if (lookup.lineType && VOIP_PHONE_LINE_TYPES.has(lookup.lineType)) {
- return {verdict: 'require_inbound', inboundReason: 'voip'};
- }
- if (isCanadianPhoneNumber(phone)) {
- return {verdict: 'require_inbound', inboundReason: 'canadian'};
- }
- if (!lookup.lineType || lookup.lineType === 'unknown') {
- return {verdict: 'require_inbound', inboundReason: 'unknown_line_type'};
- }
- if (HARD_REJECT_PHONE_LINE_TYPES.has(lookup.lineType)) {
- return {verdict: 'reject', rejectReason: 'line_type_hard_rejected'};
- }
- if (!ACCEPTED_PHONE_LINE_TYPES.has(lookup.lineType)) {
- return {verdict: 'reject', rejectReason: 'line_type_not_mobile'};
+ if (reply.result === 'error') throw errorForPhoneReply(reply);
+ const action = reply.action;
+ if (action.type !== 'phone_verified' || action.user_id !== user.id.toString()) {
+ Logger.error({actionType: action.type}, 'Phone verification returned an unexpected action');
+ throw new SmsVerificationUnavailableError();
}
- const threshold = getSmsPumpingRiskThreshold(lookup.countryCode);
- if (lookup.smsPumpingRiskScore !== null && lookup.smsPumpingRiskScore >= threshold) {
- return {verdict: 'reject', rejectReason: 'sms_pumping_risk_high'};
+ if (action.expires_at_ms <= Date.now()) {
+ const expired = outcomeOf(action, 'expired');
+ await emitActivity('action_outcome', action.key, expired, null, expired.action_id);
+ throw new SmsVerificationUnavailableError();
}
- return {verdict: 'accept', rejectReason: null};
-}
-
-const CANADIAN_NPAS: ReadonlySet<string> = new Set([
- '204',
- '226',
- '236',
- '249',
- '250',
- '263',
- '289',
- '306',
- '343',
- '354',
- '365',
- '367',
- '368',
- '382',
- '387',
- '403',
- '416',
- '418',
- '428',
- '431',
- '437',
- '438',
- '450',
- '468',
- '474',
- '506',
- '514',
- '519',
- '548',
- '579',
- '581',
- '584',
- '587',
- '604',
- '613',
- '639',
- '647',
- '672',
- '683',
- '705',
- '709',
- '742',
- '753',
- '778',
- '780',
- '782',
- '807',
- '819',
- '825',
- '867',
- '873',
- '879',
- '902',
- '905',
- '942',
-]);
-
-function isCanadianPhoneNumber(e164: string): boolean {
- if (!e164.startsWith('+1') || e164.length < 5) return false;
- const npa = e164.slice(2, 5);
- return CANADIAN_NPAS.has(npa);
+ const outcome = await applyPhoneVerified(accountStateDepsFromContext(ctx, getAdminRepository()), action);
+ await emitActivity('action_outcome', action.key, outcome, null, outcome.action_id);
+ if (outcome.status === 'ineligible') throw new PhoneVerificationRequiredError();
}
diff --git a/fluxer_api/src/api/auth/AuthRegistration.ts b/fluxer_api/src/api/auth/AuthRegistration.ts
index 9f519fddf..8baeb69af 100644
--- a/fluxer_api/src/api/auth/AuthRegistration.ts
+++ b/fluxer_api/src/api/auth/AuthRegistration.ts
@@ -4,10 +4,12 @@ import type {ApiContext} from '@app/api/ApiContext';
import * as AuthPassword from '@app/api/auth/AuthPassword';
import * as AuthSession from '@app/api/auth/AuthSession';
import * as AuthUtility from '@app/api/auth/AuthUtility';
-import type {IRegistrationRiskEvaluator} from '@app/api/auth/services/IRegistrationRiskEvaluator';
+import {assertEmailNotBlocklisted} from '@app/api/auth/EmailBlocklist';
import {createEmailVerificationToken, createInviteCode, createUserID, type UserID} from '@app/api/BrandedTypes';
import type {APIConfig} from '@app/api/config/APIConfig';
import type {UserRow} from '@app/api/database/types/UserTypes';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import {isBlockedEmailDomain} from '@app/api/infrastructure/activity/SharedLists';
import type {IDiscriminatorService} from '@app/api/infrastructure/DiscriminatorService';
import type {KVActivityTracker} from '@app/api/infrastructure/KVActivityTracker';
import {
@@ -23,17 +25,6 @@ import {profileSubstringBlocklistCache} from '@app/api/middleware/ProfileSubstri
import type {RequestCache} from '@app/api/middleware/RequestCacheMiddleware';
import type {User} from '@app/api/models/User';
import {UserSettings} from '@app/api/models/UserSettings';
-import {countryRequiresInboundPhoneVerification, stripDisallowedPhoneFlags} from '@app/api/risk/AbusePolicy';
-import {
- type IAccountPolicyEvaluator,
- isAssessmentThresholdAuditEvent,
- normalizePolicyContactDomain,
-} from '@app/api/risk/AccountPolicyEvaluator';
-import type {IRegistrationEventsRepository} from '@app/api/risk/adapters/VelocityAdapter';
-import {deferPhoneFlagsUntilCommunityJoin} from '@app/api/risk/DeferredPhoneGate';
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import type {IRiskAssessmentRepository} from '@app/api/risk/RiskAssessmentRepository';
-import {deriveLatestRiskContext} from '@app/api/risk/RiskHistoryContext';
import * as AgeUtils from '@app/api/utils/AgeUtils';
import {extractEmailDomain} from '@app/api/utils/EmailDomainUtils';
import {lookupGeoip} from '@app/api/utils/IpUtils';
@@ -41,6 +32,7 @@ import {createRateLimitError} from '@app/api/utils/RateLimitUtils';
import {generateRandomUsername} from '@app/api/utils/UsernameGenerator';
import {deriveUsernameFromDisplayName} from '@app/api/utils/UsernameSuggestionUtils';
import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
+import {getRegionalMinimumAge} from '@fluxer/constants/src/RegionalMinimumAge';
import {ProfileFieldPrivacyFlags, UserFlags} from '@fluxer/constants/src/UserConstants';
import {ValidationErrorCodes} from '@fluxer/constants/src/ValidationErrorCodes';
import {RegistrationClosedError} from '@fluxer/errors/src/domains/auth/RegistrationClosedError';
@@ -54,8 +46,6 @@ import {parseAcceptLanguage} from '@pkgs/locale/src/LocaleService';
import {types} from 'cassandra-driver';
import {ms} from 'itty-time';
-const DEFAULT_MINIMUM_AGE = 13;
-
function parseDobLocalDate(dateOfBirth: string): types.LocalDate {
const match = /^(\d{4})-(\d{2})-(\d{2})$/.exec(dateOfBirth);
if (!match) {
@@ -83,13 +73,6 @@ export interface RegistrationDependencies {
singleCommunityService: SingleCommunityService;
discriminatorService: IDiscriminatorService;
kvActivityTracker: KVActivityTracker;
- registrationRiskEvaluator: IRegistrationRiskEvaluator;
- accountPolicyEvaluator: IAccountPolicyEvaluator;
- isEmailDomainSuspicious: (domain: string) => Promise<boolean>;
- isEmailDomainDisposable: (domain: string) => Promise<boolean>;
- registrationEventsRepository: IRegistrationEventsRepository;
- riskAssessmentRepository: IRiskAssessmentRepository;
- riskHistoryRepository: Pick<IRiskHistoryRepository, 'upsertLatestContext' | 'recordOutcomeForUser'>;
}
interface RegistrationTokenResult {
@@ -114,20 +97,8 @@ export async function register(
{data, request, requestCache}: RegisterParams,
): Promise<RegisterResult> {
const {users, snowflake, emailDnsValidation, config} = ctx.services;
- const {
- inviteService,
- instanceConfigRepository,
- singleCommunityService,
- discriminatorService,
- kvActivityTracker,
- registrationRiskEvaluator,
- accountPolicyEvaluator,
- isEmailDomainSuspicious,
- isEmailDomainDisposable,
- registrationEventsRepository,
- riskAssessmentRepository,
- riskHistoryRepository,
- } = deps;
+ const {inviteService, instanceConfigRepository, singleCommunityService, discriminatorService, kvActivityTracker} =
+ deps;
const appPublicConfig = await instanceConfigRepository.getAppPublicConfig();
const emailEnabled = await instanceConfigRepository.isEmailEnabled();
const requiresTermsConsent = shouldRequireHostedLegalConsent(config) || appPublicConfig.legal.terms_url !== null;
@@ -152,7 +123,7 @@ export async function register(
throw InputValidationError.fromCode('date_of_birth', ValidationErrorCodes.INVALID_DATE_OF_BIRTH_FORMAT);
}
dateOfBirth = parseDobLocalDate(dateOfBirthInput);
- const minAge = accountPolicyEvaluator.getMinimumAgeForRegion(countryCode, DEFAULT_MINIMUM_AGE);
+ const minAge = getRegionalMinimumAge(countryCode);
if (!AuthUtility.validateAge(ctx, {dateOfBirth: dateOfBirthInput, minAge})) {
throw InputValidationError.fromCode('date_of_birth', ValidationErrorCodes.MUST_BE_MINIMUM_AGE, {minAge});
}
@@ -163,28 +134,17 @@ export async function register(
}
const rawEmail = data.email ?? null;
const emailKey = rawEmail ? rawEmail.toLowerCase() : null;
- const userAgent = request.headers.get('user-agent');
const enforceRateLimits = !config.dev.relaxRegistrationRateLimits;
await enforceRegistrationRateLimits(ctx, {enforceRateLimits, clientIp, emailKey});
- let contactDomain: string | null = null;
- let contactDomainAdminListed = false;
- let contactDomainDisposable = false;
- let contactDomainBlocked = false;
- let contactDomainStepUpRequired = false;
if (rawEmail) {
- contactDomain = normalizePolicyContactDomain(extractEmailDomain(rawEmail));
+ if (isBlockedEmailDomain(extractEmailDomain(rawEmail))) {
+ throw InputValidationError.fromCode('email', ValidationErrorCodes.INVALID_EMAIL_ADDRESS);
+ }
+ await assertEmailNotBlocklisted(rawEmail, 'email');
const hasValidDns = await emailDnsValidation.hasValidDnsRecords(rawEmail);
if (!hasValidDns) {
throw InputValidationError.fromCode('email', ValidationErrorCodes.EMAIL_DOMAIN_CANNOT_RECEIVE_MAIL);
}
- contactDomainBlocked = accountPolicyEvaluator.isBlockedRegistrationEmailDomain(contactDomain);
- if (contactDomainBlocked) {
- throw InputValidationError.fromCode('email', ValidationErrorCodes.INVALID_EMAIL_ADDRESS);
- }
- [contactDomainAdminListed, contactDomainDisposable] = contactDomain
- ? await Promise.all([isEmailDomainSuspicious(contactDomain), isEmailDomainDisposable(contactDomain)])
- : [false, false];
- contactDomainStepUpRequired = contactDomainBlocked || contactDomainAdminListed || contactDomainDisposable;
const emailTaken = await users.findByEmail(rawEmail);
if (emailTaken) throw InputValidationError.fromCode('email', ValidationErrorCodes.EMAIL_ALREADY_IN_USE);
}
@@ -330,108 +290,25 @@ export async function register(
void kvActivityTracker.updateActivity(user.id, now).catch((error: unknown) => {
Logger.warn({error, userId: user.id}, 'Failed to update real-time user activity');
});
- const isUnclaimed = !rawEmail;
- const usernameIsUserChosen = data.username != null || data.global_name != null;
- const riskResult = await registrationRiskEvaluator.evaluate({
- email: rawEmail,
- clientIp,
- locale: userLocale,
- timezone: null,
- userAgent,
- username,
- globalName: data.global_name ?? null,
- usernameIsUserChosen,
- isUnclaimed,
- });
- const policyDecision = accountPolicyEvaluator.evaluate({
- contact: {
- value: rawEmail,
- domain: contactDomain,
- domainAdminListed: contactDomainAdminListed,
- domainDisposable: contactDomainDisposable,
- domainBlocked: contactDomainBlocked,
- domainStepUpRequired: contactDomainStepUpRequired,
- },
- region: {
- code: countryCode,
- stepUpRequired: countryRequiresInboundPhoneVerification(countryCode),
- },
- assessment: {
- raw: riskResult.assessment,
- level: riskResult.level,
- action: riskResult.recommendedAction,
+ await emitActivity(
+ 'registration',
+ user.id.toString(),
+ {
+ user_id: user.id.toString(),
+ method: data.password ? 'password' : rawEmail ? 'other' : 'unclaimed',
+ email: rawEmail,
+ username,
+ username_user_chosen: data.username != null || data.global_name != null,
+ global_name: data.global_name ?? null,
+ locale: userLocale,
+ timezone: null,
+ invite_code: data.invite_code?.trim() || null,
+ suspicious_flags: user.suspiciousActivityFlags ?? 0,
+ flags: user.flags.toString(),
},
- });
- const combinedFlags = await deferPhoneFlagsUntilCommunityJoin(
- await stripDisallowedPhoneFlags(policyDecision.flagBits, async () => countryCode),
+ null,
+ user.id.toString(),
);
- const createdAt = new Date();
- const riskContext = deriveLatestRiskContext({
- userId: userId.toString(),
- email: rawEmail ?? null,
- clientIp,
- asn: riskResult.assessment.signals.geoIpAsn?.asn ?? null,
- updatedAt: createdAt,
- });
- if (combinedFlags !== 0) {
- user = await users.patchUpsert(user.id, {suspicious_activity_flags: combinedFlags}, user.toRow());
- }
- registrationEventsRepository
- .recordEvent({
- userId: userId.toString(),
- email: rawEmail ?? null,
- emailDomain: riskContext.emailDomain,
- ip: clientIp,
- locale: userLocale,
- createdAt,
- })
- .catch((error) => {
- Logger.warn(
- {userId: userId.toString(), error},
- '[AuthRegistration] Failed to record registration velocity event',
- );
- });
- (async () => {
- try {
- await riskHistoryRepository.upsertLatestContext(riskContext);
- if (policyDecision.riskHistoryOutcomeCodes.length > 0) {
- await riskHistoryRepository.recordOutcomeForUser({
- userId: userId.toString(),
- occurredAt: createdAt,
- source: 'registration_risk',
- outcomeCodes: [...policyDecision.riskHistoryOutcomeCodes],
- });
- }
- } catch (error) {
- Logger.warn({userId: userId.toString(), error}, '[AuthRegistration] Failed to persist direct risk history');
- }
- })();
- riskAssessmentRepository
- .recordAssessment({
- userId,
- ip: clientIp,
- email: rawEmail ?? null,
- locale: userLocale,
- assessment: riskResult.assessment,
- })
- .catch((error) => {
- Logger.warn({userId: userId.toString(), error}, '[AuthRegistration] Failed to persist risk assessment');
- });
- for (const event of policyDecision.auditEvents) {
- if (isAssessmentThresholdAuditEvent(event)) {
- Logger.warn(
- {
- userId: userId.toString(),
- email: rawEmail,
- ip: clientIp,
- score: riskResult.assessment.riskScore,
- reasoning: riskResult.assessment.reasoning,
- policyRuleId: event.ruleId,
- },
- '[AuthRegistration] Account policy emitted assessment threshold notice',
- );
- }
- }
if (rawEmail && emailEnabled) await maybeSendVerificationEmail(ctx, {user, email: rawEmail});
await users.createAuthorizedIp(userId, clientIp);
if (registrationAccess.pendingApproval) {
@@ -440,24 +317,11 @@ export async function register(
user_id: user.id.toString(),
};
}
- if (policyDecision.inviteAutoJoinEnabled) {
- await maybeAutoJoinInvite(inviteService, {
- userId,
- inviteCode: data.invite_code || config.instance.autoJoinInviteCode,
- requestCache,
- });
- } else {
- Logger.info(
- {
- userId: userId.toString(),
- riskLevel: riskResult.level,
- riskScore: riskResult.assessment.riskScore,
- inviteCode: data.invite_code,
- reason: policyDecision.inviteAutoJoinSkipReason,
- },
- '[AuthRegistration] Skipping invite auto-join because account policy disabled it',
- );
- }
+ await maybeAutoJoinInvite(inviteService, {
+ userId,
+ inviteCode: data.invite_code || config.instance.autoJoinInviteCode,
+ requestCache,
+ });
await singleCommunityService.joinStockCommunity(userId, requestCache);
const [token] = await AuthSession.createAuthSession(ctx, {
user,
diff --git a/fluxer_api/src/api/auth/AuthSession.ts b/fluxer_api/src/api/auth/AuthSession.ts
index e42e9b7f3..f574050fa 100644
--- a/fluxer_api/src/api/auth/AuthSession.ts
+++ b/fluxer_api/src/api/auth/AuthSession.ts
@@ -10,6 +10,7 @@ import {
REGISTRATION_REJECTED_TRAIT,
} from '@app/api/instance/InstanceConfigRepository';
import {Logger} from '@app/api/Logger';
+import {getKVAccountDeletionQueue} from '@app/api/middleware/ServiceSingletons';
import type {AuthSession} from '@app/api/models/AuthSession';
import type {User} from '@app/api/models/User';
import {lookupGeoip} from '@app/api/utils/IpUtils';
@@ -87,6 +88,7 @@ export async function createAuthSession(
if (user.traits.has(REGISTRATION_PENDING_APPROVAL_TRAIT)) throw new RegistrationPendingApprovalError();
if (user.traits.has(REGISTRATION_REJECTED_TRAIT)) throw new RegistrationRejectedError();
user = await AuthUtility.handleBanStatus(ctx, user);
+ user = await AuthUtility.reactivateOnSignIn(ctx, user, getKVAccountDeletionQueue());
const now = new Date();
const token = await AuthUtility.generateAuthToken(ctx);
let clientCountry: string | null = null;
diff --git a/fluxer_api/src/api/auth/AuthSessionRevocation.ts b/fluxer_api/src/api/auth/AuthSessionRevocation.ts
index 5f3bda6ea..006a6fc1b 100644
--- a/fluxer_api/src/api/auth/AuthSessionRevocation.ts
+++ b/fluxer_api/src/api/auth/AuthSessionRevocation.ts
@@ -44,15 +44,16 @@ async function revokeSessionTargets(
? users.deleteAllPushSubscriptions(userId)
: users.deletePushSubscriptionsForAuthSessions(userId, sessionIdHashes, {deleteUnboundSubscriptions: true}),
];
- if (scope === 'selected' || targets.length > 0) {
- steps.push(
- () =>
- users.deleteAuthSessions(
+ steps.push(() =>
+ scope === 'all'
+ ? users.deleteAllAuthSessions(userId)
+ : users.deleteAuthSessions(
userId,
targets.map((target) => target.sessionIdHash),
),
- () => gateway.terminateSession({userId, sessionIdHashes}),
- );
+ );
+ if (targets.length > 0) {
+ steps.push(() => gateway.terminateSession({userId, sessionIdHashes}));
}
await runAllInOrder(steps, 'Failed to revoke auth sessions');
}
diff --git a/fluxer_api/src/api/auth/AuthUtility.ts b/fluxer_api/src/api/auth/AuthUtility.ts
index ac3110003..bb0efd1b2 100644
--- a/fluxer_api/src/api/auth/AuthUtility.ts
+++ b/fluxer_api/src/api/auth/AuthUtility.ts
@@ -4,7 +4,10 @@ import crypto from 'node:crypto';
import {promisify} from 'node:util';
import type {ApiContext} from '@app/api/ApiContext';
import type {UserID} from '@app/api/BrandedTypes';
+import type {KVAccountDeletionQueueService} from '@app/api/infrastructure/KVAccountDeletionQueueService';
+import {Logger} from '@app/api/Logger';
import type {User} from '@app/api/models/User';
+import {isAccountClosed, isTemporarilyBanned} from '@app/api/user/UserHelpers';
import * as AgeUtils from '@app/api/utils/AgeUtils';
import * as RandomUtils from '@app/api/utils/RandomUtils';
import {UserFlags} from '@fluxer/constants/src/UserConstants';
@@ -21,7 +24,6 @@ interface ValidateAgeParams {
}
interface AccountBanStatus {
- isPermanentlyBanned: boolean;
isTempBanned: boolean;
tempBanExpired: boolean;
}
@@ -92,23 +94,18 @@ export async function authorizeIpByToken(
}
function checkAccountBanStatus(_ctx: ApiContext, user: User): AccountBanStatus {
- const isPermanentlyBanned = !!(user.flags & UserFlags.DELETED);
const hasTempBan = !!(user.flags & UserFlags.DISABLED && user.tempBannedUntil);
- const tempBanExpired = hasTempBan && user.tempBannedUntil! <= new Date();
+ const isTempBanned = isTemporarilyBanned(user);
return {
- isPermanentlyBanned,
- isTempBanned: hasTempBan && !tempBanExpired,
- tempBanExpired,
+ isTempBanned,
+ tempBanExpired: hasTempBan && !isTempBanned,
};
}
export async function handleBanStatus(ctx: ApiContext, user: User): Promise<User> {
const {users} = ctx.services;
- if (user.deletionStartedAt) throw new AccountPermanentlySuspendedError();
+ if (isAccountClosed(user)) throw new AccountPermanentlySuspendedError();
const banStatus = checkAccountBanStatus(ctx, user);
- if (banStatus.isPermanentlyBanned) {
- throw new AccountPermanentlySuspendedError();
- }
if (banStatus.isTempBanned) {
throw new AccountTemporarilySuspendedError();
}
@@ -124,3 +121,36 @@ export async function handleBanStatus(ctx: ApiContext, user: User): Promise<User
}
return user;
}
+
+export async function reactivateOnSignIn(
+ ctx: ApiContext,
+ user: User,
+ deletionQueue: Pick<KVAccountDeletionQueueService, 'removeFromQueue'>,
+): Promise<User> {
+ const {users} = ctx.services;
+ let currentUser = user;
+ if ((currentUser.flags & UserFlags.DISABLED) !== 0n && !currentUser.tempBannedUntil) {
+ currentUser = await users.patchUpsert(
+ currentUser.id,
+ {flags: currentUser.flags & ~UserFlags.DISABLED},
+ currentUser.toRow(),
+ );
+ Logger.info({userId: currentUser.id}, 'Auto-undisabled user on sign-in');
+ }
+ if ((currentUser.flags & UserFlags.SELF_DELETED) !== 0n) {
+ const pendingDeletionAt = currentUser.pendingDeletionAt;
+ currentUser = await users.updateDeletionSchedule(currentUser, {
+ flags: currentUser.flags & ~UserFlags.SELF_DELETED,
+ pending_deletion_at: null,
+ deletion_reason_code: null,
+ deletion_public_reason: null,
+ deletion_audit_log_reason: null,
+ });
+ if (pendingDeletionAt) {
+ await users.removePendingDeletion(currentUser.id, pendingDeletionAt);
+ }
+ await deletionQueue.removeFromQueue(currentUser.id);
+ Logger.info({userId: currentUser.id}, 'Auto-cancelled deletion on sign-in');
+ }
+ return currentUser;
+}
diff --git a/fluxer_api/src/api/auth/EmailBlocklist.ts b/fluxer_api/src/api/auth/EmailBlocklist.ts
new file mode 100644
index 000000000..8e1a8c661
--- /dev/null
+++ b/fluxer_api/src/api/auth/EmailBlocklist.ts
@@ -0,0 +1,13 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {AdminRepository} from '@app/api/admin/AdminRepository';
+import {ValidationErrorCodes} from '@fluxer/constants/src/ValidationErrorCodes';
+import {InputValidationError} from '@fluxer/errors/src/domains/core/InputValidationError';
+
+const adminRepository = new AdminRepository();
+
+export async function assertEmailNotBlocklisted(email: string, field: string): Promise<void> {
+ if (await adminRepository.isEmailBanned(email.trim())) {
+ throw InputValidationError.fromCode(field, ValidationErrorCodes.INVALID_EMAIL_ADDRESS);
+ }
+}
diff --git a/fluxer_api/src/api/auth/PhonePrefixBanCache.ts b/fluxer_api/src/api/auth/PhonePrefixBanCache.ts
deleted file mode 100644
index 2d2e70159..000000000
--- a/fluxer_api/src/api/auth/PhonePrefixBanCache.ts
+++ /dev/null
@@ -1,130 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {AdminRepository} from '@app/api/admin/AdminRepository';
-import {PHONE_PREFIX_BAN_REFRESH_CHANNEL} from '@app/api/constants/PhonePrefixBan';
-import {Logger} from '@app/api/Logger';
-import {RefreshSubscription} from '@app/api/utils/RefreshSubscription';
-import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
-
-const BUILT_IN_BANNED_PHONE_PREFIXES: ReadonlyArray<string> = [
- '+93',
- '+95',
- '+223',
- '+225',
- '+228',
- '+233',
- '+236',
- '+240',
- '+244',
- '+245',
- '+255',
- '+256',
- '+257',
- '+261',
- '+263',
- '+269',
- '+387',
- '+996',
-];
-
-export class PhonePrefixBanCache {
- private prefixes: Set<string> = new Set();
- private prefixLengths: ReadonlyArray<number> = [];
- private adminRepository = new AdminRepository();
- private kvClient: IKVProvider | null = null;
- private consecutiveFailures = 0;
- private readonly maxConsecutiveFailures = 5;
- private readonly refreshSubscription = new RefreshSubscription({
- name: 'phone-prefix ban cache',
- channels: [PHONE_PREFIX_BAN_REFRESH_CHANNEL],
- refresh: () => this.refresh(),
- onRefreshError: (err) => {
- this.consecutiveFailures++;
- const message = err instanceof Error ? err.message : String(err);
- if (this.consecutiveFailures >= this.maxConsecutiveFailures) {
- Logger.error({error: message}, 'Failed to refresh phone-prefix ban cache after notification');
- } else {
- Logger.warn({error: message}, 'Failed to refresh phone-prefix ban cache after notification');
- }
- },
- });
-
- setRefreshSubscriber(kvClient: IKVProvider | null): void {
- this.kvClient = kvClient;
- }
-
- initialize(): Promise<void> {
- return this.refreshSubscription.start(this.kvClient);
- }
-
- async refresh(): Promise<void> {
- const list = await this.adminRepository.loadAllBannedPhonePrefixes();
- const next = new Set<string>();
- for (const p of BUILT_IN_BANNED_PHONE_PREFIXES) {
- if (p.length > 0) next.add(p);
- }
- for (const p of list) {
- if (p.length > 0) next.add(p);
- }
- this.prefixes = next;
- this.prefixLengths = this.computeSortedLengths();
- this.consecutiveFailures = 0;
- }
-
- isBlocked(phone: string): boolean {
- const size = this.prefixes.size;
- if (size === 0) return false;
- if (size < PhonePrefixBanCache.SMALL_TABLE_THRESHOLD) {
- for (const prefix of this.prefixes) {
- if (phone.startsWith(prefix)) return true;
- }
- return false;
- }
- const lengths = this.prefixLengths;
- const phoneLen = phone.length;
- for (let i = 0; i < lengths.length; i++) {
- const len = lengths[i]!;
- if (len > phoneLen) return false;
- if (this.prefixes.has(phone.substring(0, len))) return true;
- }
- return false;
- }
-
- private static readonly SMALL_TABLE_THRESHOLD = 16;
-
- ban(prefix: string): void {
- if (prefix.length === 0) return;
- if (this.prefixes.has(prefix)) return;
- this.prefixes.add(prefix);
- this.prefixLengths = this.computeSortedLengths();
- }
-
- unban(prefix: string): void {
- if (!this.prefixes.delete(prefix)) return;
- this.prefixLengths = this.computeSortedLengths();
- }
-
- snapshot(): ReadonlySet<string> {
- return this.prefixes;
- }
-
- resetForTests(): void {
- void this.shutdown().catch((error) => {
- Logger.error({error}, 'Failed to shut down phone-prefix ban cache');
- });
- this.prefixes = new Set();
- this.prefixLengths = [];
- }
-
- private computeSortedLengths(): ReadonlyArray<number> {
- const seen = new Set<number>();
- for (const p of this.prefixes) seen.add(p.length);
- return [...seen].sort((a, b) => a - b);
- }
-
- shutdown(): Promise<void> {
- return this.refreshSubscription.stop();
- }
-}
-
-export const phonePrefixBanCache = new PhonePrefixBanCache();
diff --git a/fluxer_api/src/api/auth/PhoneVerificationClient.ts b/fluxer_api/src/api/auth/PhoneVerificationClient.ts
new file mode 100644
index 000000000..d2eded9db
--- /dev/null
+++ b/fluxer_api/src/api/auth/PhoneVerificationClient.ts
@@ -0,0 +1,241 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createHash, randomUUID} from 'node:crypto';
+import type {
+ ChallengeReply,
+ ChallengeReq,
+ CheckReply,
+ CheckReq,
+ PhoneError,
+ StartReply,
+ StartReq,
+} from '@app/api/infrastructure/activity/Contract.generated';
+import {
+ HEADER,
+ PHONE_CLIENT_TIMEOUT_SLACK_MS,
+ PHONE_DEADLINE_MS,
+ PHONE_RETRY_MIN_REMAINING_MS,
+ PHONE_RPC_VERSION,
+ RPC_PHONE_CHALLENGE,
+ RPC_PHONE_CHECK,
+ RPC_PHONE_START,
+} from '@app/api/infrastructure/activity/Contract.generated';
+import {Logger} from '@app/api/Logger';
+import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
+import {InvalidPhoneNumberError} from '@fluxer/errors/src/domains/auth/InvalidPhoneNumberError';
+import {InvalidPhoneVerificationCodeError} from '@fluxer/errors/src/domains/auth/InvalidPhoneVerificationCodeError';
+import {PhoneAlreadyUsedError} from '@fluxer/errors/src/domains/auth/PhoneAlreadyUsedError';
+import {PhoneCountryNotSupportedError} from '@fluxer/errors/src/domains/auth/PhoneCountryNotSupportedError';
+import {PhoneInboundVerificationRequiredError} from '@fluxer/errors/src/domains/auth/PhoneInboundVerificationRequiredError';
+import {PhoneLookupUnavailableError} from '@fluxer/errors/src/domains/auth/PhoneLookupUnavailableError';
+import {PhoneNumberNotInServiceError} from '@fluxer/errors/src/domains/auth/PhoneNumberNotInServiceError';
+import {PhoneNumberNotMobileError} from '@fluxer/errors/src/domains/auth/PhoneNumberNotMobileError';
+import {PhoneVerificationNeedsReviewError} from '@fluxer/errors/src/domains/auth/PhoneVerificationNeedsReviewError';
+import {SmsVerificationUnavailableError} from '@fluxer/errors/src/domains/auth/SmsVerificationUnavailableError';
+import {CaptchaVerificationRequiredError} from '@fluxer/errors/src/domains/core/CaptchaVerificationRequiredError';
+import {RateLimitError} from '@fluxer/errors/src/domains/core/RateLimitError';
+import type {FluxerError} from '@fluxer/errors/src/FluxerError';
+import {type NatsConnection, headers as natsHeaders, RequestError, TimeoutError} from '@nats-io/transport-node';
+
+type PhoneOp = keyof typeof PHONE_DEADLINE_MS;
+
+export interface PhoneRpcTransport {
+ request(
+ subject: string,
+ payload: string,
+ options: {timeoutMs: number; headers: Record<string, string>},
+ ): Promise<string>;
+}
+
+export class PhoneRpcUnreachableError extends Error {
+ constructor(
+ readonly reason: 'no_responders' | 'timeout' | 'not_configured',
+ options?: {cause?: unknown},
+ ) {
+ super(`Phone verification service unreachable: ${reason}`, options);
+ this.name = 'PhoneRpcUnreachableError';
+ }
+}
+
+export interface PhoneRpcRequestInfo {
+ userId: string;
+ phone: string;
+ requestId: string;
+}
+
+const SUBJECTS: Record<PhoneOp, string> = {
+ start: RPC_PHONE_START,
+ check: RPC_PHONE_CHECK,
+ challenge: RPC_PHONE_CHALLENGE,
+};
+const rpcCounts = new Map<string, number>();
+
+function countRpc(op: PhoneOp, result: string): void {
+ const key = `op="${op}",result="${result}"`;
+ rpcCounts.set(key, (rpcCounts.get(key) ?? 0) + 1);
+}
+
+export function renderPhoneRpcMetrics(): string {
+ return [
+ '# HELP fluxer_api_phone_rpc_total Phone verification requests by operation and result',
+ '# TYPE fluxer_api_phone_rpc_total counter',
+ ...[...rpcCounts].map(([labels, value]) => `fluxer_api_phone_rpc_total{${labels}} ${value}`),
+ ].join('\n');
+}
+
+export function phoneIdempotencyKey(op: PhoneOp, info: PhoneRpcRequestInfo, nonce: string): string {
+ return createHash('sha256').update(`${op}\n${info.userId}\n${info.phone}\n${nonce}`).digest('base64url');
+}
+
+function replyLabel(reply: {result: string; code?: unknown}): string {
+ return reply.result === 'error' && typeof reply.code === 'string' ? reply.code : reply.result;
+}
+
+export function natsPhoneRpcTransport(connection: () => NatsConnection | null): PhoneRpcTransport {
+ return {
+ async request(subject, payload, options) {
+ const nc = connection();
+ if (!nc) throw new PhoneRpcUnreachableError('not_configured');
+ const h = natsHeaders();
+ for (const [name, value] of Object.entries(options.headers)) h.set(name, value);
+ try {
+ const reply = await nc.request(subject, payload, {timeout: options.timeoutMs, headers: h});
+ return reply.string();
+ } catch (error) {
+ if (error instanceof RequestError && error.isNoResponders()) {
+ throw new PhoneRpcUnreachableError('no_responders', {cause: error});
+ }
+ if (error instanceof TimeoutError || error instanceof RequestError) {
+ throw new PhoneRpcUnreachableError('timeout', {cause: error});
+ }
+ throw error;
+ }
+ },
+ };
+}
+
+export class PhoneVerificationClient {
+ constructor(
+ private readonly transport: PhoneRpcTransport | null,
+ private readonly now: () => number = Date.now,
+ private readonly nonce: () => string = randomUUID,
+ ) {}
+
+ start(req: Omit<StartReq, 'v'>, info: PhoneRpcRequestInfo): Promise<StartReply> {
+ return this.call<StartReply>('start', {v: PHONE_RPC_VERSION, ...req}, info);
+ }
+
+ check(req: Omit<CheckReq, 'v'>, info: PhoneRpcRequestInfo): Promise<CheckReply> {
+ return this.call<CheckReply>('check', {v: PHONE_RPC_VERSION, ...req}, info);
+ }
+
+ challenge(req: Omit<ChallengeReq, 'v'>, info: PhoneRpcRequestInfo): Promise<ChallengeReply> {
+ return this.call<ChallengeReply>('challenge', {v: PHONE_RPC_VERSION, ...req}, info);
+ }
+
+ private async call<T extends {result: string}>(op: PhoneOp, body: object, info: PhoneRpcRequestInfo): Promise<T> {
+ if (!this.transport) {
+ countRpc(op, 'not_configured');
+ throw new SmsVerificationUnavailableError();
+ }
+ const deadline = this.now() + PHONE_DEADLINE_MS[op];
+ const headers = {
+ [HEADER.deadline]: String(deadline),
+ [HEADER.idempotencyKey]: phoneIdempotencyKey(op, info, this.nonce()),
+ [HEADER.requestId]: info.requestId,
+ };
+ const payload = JSON.stringify(body);
+ for (let attempt = 0; ; attempt++) {
+ const remaining = deadline - this.now();
+ try {
+ const raw = await this.transport.request(SUBJECTS[op], payload, {
+ timeoutMs: Math.max(1, remaining + PHONE_CLIENT_TIMEOUT_SLACK_MS),
+ headers,
+ });
+ const reply = parseReply<T>(raw);
+ if (!reply) {
+ countRpc(op, 'invalid_reply');
+ Logger.error({op}, 'Phone verification service returned an unreadable reply');
+ throw new SmsVerificationUnavailableError();
+ }
+ countRpc(op, replyLabel(reply));
+ return reply;
+ } catch (error) {
+ if (!(error instanceof PhoneRpcUnreachableError)) throw error;
+ const left = deadline - this.now();
+ if (attempt === 0 && error.reason !== 'not_configured' && left >= PHONE_RETRY_MIN_REMAINING_MS) {
+ continue;
+ }
+ countRpc(op, error.reason);
+ Logger.warn({op, reason: error.reason}, 'Phone verification service unreachable');
+ throw new SmsVerificationUnavailableError();
+ }
+ }
+ }
+}
+
+function parseReply<T extends {result: string}>(raw: string): T | null {
+ try {
+ const value = JSON.parse(raw) as unknown;
+ if (typeof value === 'object' && value !== null && typeof (value as {result?: unknown}).result === 'string') {
+ return value as T;
+ }
+ } catch {
+ return null;
+ }
+ return null;
+}
+
+export function errorForPhoneReply(error: PhoneError): FluxerError {
+ switch (error.code) {
+ case 'invalid_phone':
+ return new InvalidPhoneNumberError();
+ case 'country_not_supported':
+ return new PhoneCountryNotSupportedError();
+ case 'lookup_unavailable':
+ return new PhoneLookupUnavailableError();
+ case 'not_in_service':
+ return new PhoneNumberNotInServiceError();
+ case 'not_mobile':
+ return new PhoneNumberNotMobileError();
+ case 'needs_review':
+ return new PhoneVerificationNeedsReviewError();
+ case 'inbound_required':
+ return new PhoneInboundVerificationRequiredError();
+ case 'already_used':
+ return new PhoneAlreadyUsedError();
+ case 'captcha_required':
+ return new CaptchaVerificationRequiredError();
+ case 'invalid_code':
+ return new InvalidPhoneVerificationCodeError();
+ case 'rate_limited': {
+ const retryAfter = error.retry_after_s ?? 60;
+ return new RateLimitError({
+ code: APIErrorCodes.PHONE_RATE_LIMIT_EXCEEDED,
+ message: error.message ?? undefined,
+ retryAfter,
+ retryAfterDecimal: retryAfter,
+ limit: error.limit ?? 1,
+ resetTime: new Date(Date.now() + retryAfter * 1000),
+ resetAfterDecimal: retryAfter,
+ scope: error.rate_limit_scope ?? 'user',
+ });
+ }
+ case 'unsupported_contract':
+ Logger.error({code: error.code}, 'Phone verification service rejected the request contract');
+ return new SmsVerificationUnavailableError();
+ case 'unavailable':
+ case 'deadline_exceeded':
+ return new SmsVerificationUnavailableError();
+ }
+}
+
+let phoneConnection: (() => NatsConnection | null) | null = null;
+
+export function setPhoneRpcConnection(connection: (() => NatsConnection | null) | null): void {
+ phoneConnection = connection;
+}
+
+export function getPhoneVerificationClient(): PhoneVerificationClient {
+ return new PhoneVerificationClient(phoneConnection ? natsPhoneRpcTransport(phoneConnection) : null);
+}
diff --git a/fluxer_api/src/api/auth/PhoneVerificationPrefixPolicy.ts b/fluxer_api/src/api/auth/PhoneVerificationPrefixPolicy.ts
deleted file mode 100644
index 5809564bb..000000000
--- a/fluxer_api/src/api/auth/PhoneVerificationPrefixPolicy.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {phoneRequiresInboundVerification} from '@app/api/risk/AbusePolicy';
-
-export function requiresInboundPhoneVerification(phone: string, prefixes?: ReadonlyArray<string>): boolean {
- return phoneRequiresInboundVerification(phone, prefixes);
-}
diff --git a/fluxer_api/src/api/auth/PhoneVerificationReuseStore.ts b/fluxer_api/src/api/auth/PhoneVerificationReuseStore.ts
deleted file mode 100644
index 10e85f3f3..000000000
--- a/fluxer_api/src/api/auth/PhoneVerificationReuseStore.ts
+++ /dev/null
@@ -1,190 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createCipheriv, createHmac, randomBytes, randomUUID} from 'node:crypto';
-import {Logger} from '@app/api/Logger';
-import type {ICacheService} from '@pkgs/cache/src/ICacheService';
-import {seconds} from 'itty-time';
-
-const KEY_STATE_CACHE_KEY = 'phone-verification:reuse-key-state';
-const KEY_ROTATION_LOCK = 'phone-verification-reuse-key-rotation';
-const REUSE_KEY_PREFIX = 'phone-verification:reuse';
-const REUSE_LOCK_PREFIX = 'phone-verification-reuse';
-const ROTATE_AFTER_MS = 28 * 24 * 60 * 60 * 1000;
-const REUSE_TTL_SECONDS = seconds('31 days');
-const LOCK_TTL_SECONDS = seconds('30 seconds');
-
-interface PhoneReuseKey {
- id: string;
- secret: string;
- created_at: string;
-}
-
-interface PhoneReuseKeyState {
- primary: PhoneReuseKey;
- secondary: PhoneReuseKey | null;
-}
-
-interface EncryptedPhoneReuseMarker {
- v: 1;
- key_id: string;
- iv: string;
- tag: string;
- ciphertext: string;
- created_at: string;
- verification_count: number;
-}
-
-function createKey(): PhoneReuseKey {
- return {
- id: randomUUID(),
- secret: randomBytes(32).toString('base64url'),
- created_at: new Date().toISOString(),
- };
-}
-
-function shouldRotate(key: PhoneReuseKey): boolean {
- return Date.now() - new Date(key.created_at).getTime() > ROTATE_AFTER_MS;
-}
-
-function phoneDigest(phone: string, key: PhoneReuseKey): string {
- return createHmac('sha256', Buffer.from(key.secret, 'base64url')).update(phone).digest('base64url');
-}
-
-function markerKey(phone: string, key: PhoneReuseKey): string {
- return `${REUSE_KEY_PREFIX}:${key.id}:${phoneDigest(phone, key)}`;
-}
-
-function encryptPhone(phone: string, key: PhoneReuseKey, verificationCount: number): EncryptedPhoneReuseMarker {
- const iv = randomBytes(12);
- const cipher = createCipheriv('aes-256-gcm', Buffer.from(key.secret, 'base64url'), iv);
- const ciphertext = Buffer.concat([cipher.update(phone, 'utf8'), cipher.final()]);
- return {
- v: 1,
- key_id: key.id,
- iv: iv.toString('base64url'),
- tag: cipher.getAuthTag().toString('base64url'),
- ciphertext: ciphertext.toString('base64url'),
- created_at: new Date().toISOString(),
- verification_count: verificationCount,
- };
-}
-
-export class PhoneVerificationReuseStore {
- constructor(private readonly cacheService: ICacheService) {}
-
- async initialize(): Promise<void> {
- await this.getFreshState();
- }
-
- async hasReachedVerificationLimit(phone: string): Promise<boolean> {
- return (await this.getRecentVerificationCount(phone)) >= 2;
- }
-
- async getRecentVerificationCount(phone: string): Promise<number> {
- const state = await this.getFreshState();
- const keys = [state.primary, state.secondary].filter((key): key is PhoneReuseKey => key !== null);
- const results = await this.cacheService.mget<EncryptedPhoneReuseMarker>(keys.map((key) => markerKey(phone, key)));
- return Math.max(0, ...results.map((marker) => marker?.verification_count ?? (marker ? 1 : 0)));
- }
-
- async recordVerification(phone: string): Promise<void> {
- await this.claimVerificationSlot(phone);
- }
-
- async claimVerificationSlot(phone: string): Promise<boolean> {
- const state = await this.getFreshState();
- return await this.withPhoneLock(phone, state, async () => {
- const currentCount = await this.getRecentVerificationCountForState(phone, state);
- if (currentCount >= 2) {
- return false;
- }
- const nextCount = currentCount + 1;
- await this.cacheService.set(
- markerKey(phone, state.primary),
- encryptPhone(phone, state.primary, nextCount),
- REUSE_TTL_SECONDS,
- );
- return true;
- });
- }
-
- private async getRecentVerificationCountForState(phone: string, state: PhoneReuseKeyState): Promise<number> {
- const keys = [state.primary, state.secondary].filter((key): key is PhoneReuseKey => key !== null);
- const results = await this.cacheService.mget<EncryptedPhoneReuseMarker>(keys.map((key) => markerKey(phone, key)));
- return Math.max(0, ...results.map((marker) => marker?.verification_count ?? (marker ? 1 : 0)));
- }
-
- private async getFreshState(): Promise<PhoneReuseKeyState> {
- const state = await this.cacheService.get<PhoneReuseKeyState>(KEY_STATE_CACHE_KEY);
- if (!state) {
- return await this.withRotationLock(async () => {
- const existing = await this.cacheService.get<PhoneReuseKeyState>(KEY_STATE_CACHE_KEY);
- if (existing) {
- return existing;
- }
- const initialState = {primary: createKey(), secondary: null};
- await this.cacheService.set(KEY_STATE_CACHE_KEY, initialState);
- return initialState;
- });
- }
- if (!shouldRotate(state.primary)) {
- return state;
- }
- return await this.withRotationLock(async () => {
- const latest = await this.cacheService.get<PhoneReuseKeyState>(KEY_STATE_CACHE_KEY);
- if (latest && !shouldRotate(latest.primary)) {
- return latest;
- }
- const basis = latest ?? state;
- const rotated = {
- primary: createKey(),
- secondary: basis.primary,
- };
- await this.cacheService.set(KEY_STATE_CACHE_KEY, rotated);
- Logger.info(
- {newKeyId: rotated.primary.id, secondaryKeyId: rotated.secondary.id},
- 'Rotated phone verification reuse encryption key',
- );
- return rotated;
- });
- }
-
- private async withRotationLock<T>(fn: () => Promise<T>): Promise<T> {
- const token = await this.cacheService.acquireLock(KEY_ROTATION_LOCK, LOCK_TTL_SECONDS);
- if (!token) {
- await new Promise((resolve) => setTimeout(resolve, 250));
- const existing = await this.cacheService.get<PhoneReuseKeyState>(KEY_STATE_CACHE_KEY);
- if (existing) {
- return existing as T;
- }
- throw new Error('Phone verification reuse key state is temporarily unavailable');
- }
- try {
- return await fn();
- } finally {
- await this.cacheService.releaseLock(KEY_ROTATION_LOCK, token);
- }
- }
-
- private async withPhoneLock<T>(phone: string, state: PhoneReuseKeyState, fn: () => Promise<T>): Promise<T> {
- const lockKey = `${REUSE_LOCK_PREFIX}:${state.primary.id}:${phoneDigest(phone, state.primary)}`;
- const token = await this.cacheService.acquireLock(lockKey, LOCK_TTL_SECONDS);
- if (!token) {
- await new Promise((resolve) => setTimeout(resolve, 250));
- const retryToken = await this.cacheService.acquireLock(lockKey, LOCK_TTL_SECONDS);
- if (!retryToken) {
- throw new Error('Phone verification reuse marker is temporarily locked');
- }
- try {
- return await fn();
- } finally {
- await this.cacheService.releaseLock(lockKey, retryToken);
- }
- }
- try {
- return await fn();
- } finally {
- await this.cacheService.releaseLock(lockKey, token);
- }
- }
-}
diff --git a/fluxer_api/src/api/auth/__tests__/PhoneGateCodeCoverage.test.ts b/fluxer_api/src/api/auth/__tests__/PhoneGateCodeCoverage.test.ts
deleted file mode 100644
index 6b040f316..000000000
--- a/fluxer_api/src/api/auth/__tests__/PhoneGateCodeCoverage.test.ts
+++ /dev/null
@@ -1,79 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {readFileSync} from 'node:fs';
-import path from 'node:path';
-import {fileURLToPath} from 'node:url';
-import {errorForPhoneRejectReason} from '@app/api/auth/AuthPhone';
-import type {PhoneAttemptRejectReason} from '@app/api/auth/services/PhoneLookupRepository';
-import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
-import {ErrorCodeToI18nKey} from '@fluxer/errors/src/i18n/ErrorCodeMappings';
-import {getErrorMessageUnsafe} from '@fluxer/errors/src/i18n/ErrorI18n';
-import {describe, expect, it} from 'vitest';
-
-const ALL_REJECT_REASONS: ReadonlyArray<PhoneAttemptRejectReason> = [
- 'invalid_format',
- 'banned_prefix',
- 'lookup_unavailable',
- 'invalid_number',
- 'line_type_not_mobile',
- 'line_type_hard_rejected',
- 'sms_pumping_risk_high',
- 'behavioural_risk_blocked',
-];
-
-const PHONE_GATE_CODES: ReadonlyArray<string> = Array.from(
- new Set([
- ...ALL_REJECT_REASONS.map((reason) => errorForPhoneRejectReason(reason).code),
- APIErrorCodes.PHONE_INBOUND_VERIFICATION_REQUIRED,
- ]),
-);
-
-const REPO_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../..');
-const CLIENT_SWITCH_PATH = path.join(
- REPO_ROOT,
- 'fluxer_app/src/features/auth/components/modals/required_action/RequiredActionShared.tsx',
-);
-
-describe('phone gate error codes', () => {
- it('produces every code the gate is meant to produce', () => {
- expect(PHONE_GATE_CODES.slice().sort()).toEqual(
- [
- APIErrorCodes.INVALID_PHONE_NUMBER,
- APIErrorCodes.PHONE_COUNTRY_NOT_SUPPORTED,
- APIErrorCodes.PHONE_INBOUND_VERIFICATION_REQUIRED,
- APIErrorCodes.PHONE_LOOKUP_UNAVAILABLE,
- APIErrorCodes.PHONE_NUMBER_NOT_IN_SERVICE,
- APIErrorCodes.PHONE_NUMBER_NOT_MOBILE,
- APIErrorCodes.PHONE_VERIFICATION_NEEDS_REVIEW,
- ].sort(),
- );
- });
- it.each(PHONE_GATE_CODES)('%s is a declared APIErrorCode', (code) => {
- expect(Object.values(APIErrorCodes)).toContain(code);
- });
- it.each(PHONE_GATE_CODES)('%s has an ErrorCodeMappings entry', (code) => {
- expect(ErrorCodeToI18nKey[code as keyof typeof ErrorCodeToI18nKey]).toBeTruthy();
- });
- it.each(PHONE_GATE_CODES)('%s resolves to a real English message', (code) => {
- const message = getErrorMessageUnsafe(code, 'en-US');
- expect(message).not.toBe(code);
- expect(message).not.toBe(ErrorCodeToI18nKey[code as keyof typeof ErrorCodeToI18nKey]);
- expect(message.length).toBeGreaterThan(0);
- });
- it.each(PHONE_GATE_CODES)('%s has a case in the required-action client switch', (code) => {
- const source = readFileSync(CLIENT_SWITCH_PATH, 'utf8');
- expect(source).toContain(`case APIErrorCodes.${code}:`);
- });
- it('keeps the two fraud reasons on one shared code', () => {
- expect(errorForPhoneRejectReason('sms_pumping_risk_high').code).toBe(
- errorForPhoneRejectReason('behavioural_risk_blocked').code,
- );
- });
- it('gives every benign reason a code the fraud reasons do not use', () => {
- const review = errorForPhoneRejectReason('sms_pumping_risk_high').code;
- const benign = ALL_REJECT_REASONS.filter(
- (reason) => reason !== 'sms_pumping_risk_high' && reason !== 'behavioural_risk_blocked',
- ).map((reason) => errorForPhoneRejectReason(reason).code);
- expect(benign).not.toContain(review);
- });
-});
diff --git a/fluxer_api/src/api/auth/__tests__/PhoneGateOutcomes.test.ts b/fluxer_api/src/api/auth/__tests__/PhoneGateOutcomes.test.ts
deleted file mode 100644
index 47767dd03..000000000
--- a/fluxer_api/src/api/auth/__tests__/PhoneGateOutcomes.test.ts
+++ /dev/null
@@ -1,257 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {ApiContext} from '@app/api/ApiContext';
-import {errorForPhoneRejectReason, sendPhoneVerificationCode, verifyPhoneCode} from '@app/api/auth/AuthPhone';
-import {phonePrefixBanCache} from '@app/api/auth/PhonePrefixBanCache';
-import type {PhoneAttemptInboundReason, PhoneAttemptRejectReason} from '@app/api/auth/services/PhoneLookupRepository';
-import type {UserID} from '@app/api/BrandedTypes';
-import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
-import {UserFlags} from '@fluxer/constants/src/UserConstants';
-import type {FluxerError} from '@fluxer/errors/src/FluxerError';
-import type {PhoneLineType, PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-import {afterEach, describe, expect, it, vi} from 'vitest';
-
-const USER_ID = 1n as UserID;
-const MOBILE_US = '+15125550123';
-const CANADIAN = '+16045550123';
-
-function lookup(overrides: Partial<PhoneLookupResult> = {}): PhoneLookupResult {
- return {
- valid: true,
- lineType: 'mobile',
- countryCode: 'US',
- carrierName: 'Test',
- smsPumpingRiskScore: 0,
- ...overrides,
- };
-}
-
-interface HarnessOptions {
- lookupResult?: PhoneLookupResult | null;
- userFlags?: bigint;
- riskDecision?: 'allow' | 'require_inbound';
- challengeFails?: boolean;
-}
-
-function buildContext(options: HarnessOptions = {}) {
- const issueChallenge = vi.fn(async () => {
- if (options.challengeFails) {
- throw new Error('inbound challenge service down');
- }
- return {challengeCode: 'ABCD', ourNumber: '+15005550006', expiresAt: new Date(0)};
- });
- const record = vi.fn(async (_input: {rejected: boolean}) => undefined);
- const services = {
- sms: {
- lookupPhone: vi.fn(async () => (options.lookupResult === undefined ? lookup() : options.lookupResult)),
- checkVerification: vi.fn(async () => true),
- startVerificationWithResult: vi.fn(async () => undefined),
- },
- phoneLookup: null,
- users: {
- findUnique: vi.fn(async () => ({
- id: USER_ID,
- isBot: false,
- flags: options.userFlags ?? 0n,
- hasVerifiedPhone: false,
- })),
- },
- cache: {get: vi.fn(async () => null), ttl: vi.fn(async () => 0), set: vi.fn(async () => undefined)},
- phoneAttemptRisk: {
- evaluate: vi.fn(async () => ({decision: options.riskDecision ?? 'allow', reason: null, counters: {}})),
- record,
- },
- inboundSmsChallenge: {issueChallenge},
- config: {sms: {inboundChallengeNumber: '+15005550006'}},
- };
- return {ctx: {services} as unknown as ApiContext, issueChallenge, record};
-}
-
-async function codeFromVerify(phone: string, options: HarnessOptions = {}): Promise<string> {
- const {ctx} = buildContext(options);
- try {
- await verifyPhoneCode(ctx, phone, '123456', USER_ID);
- } catch (error) {
- return (error as FluxerError).code;
- }
- throw new Error(`verifyPhoneCode did not reject ${phone}`);
-}
-
-async function inboundReasonFromSend(phone: string, options: HarnessOptions = {}, channel?: 'inbound_challenge') {
- const {ctx} = buildContext(options);
- const result = await sendPhoneVerificationCode(ctx, phone, USER_ID, channel ? {channel} : {});
- if (result.channel !== 'inbound_challenge') {
- throw new Error(`sendPhoneVerificationCode returned ${result.channel} for ${phone}`);
- }
- return result.reason;
-}
-
-afterEach(() => {
- phonePrefixBanCache.unban('+31970');
-});
-
-const REJECT_REASON_CODES: Record<PhoneAttemptRejectReason, string> = {
- invalid_format: APIErrorCodes.INVALID_PHONE_NUMBER,
- banned_prefix: APIErrorCodes.PHONE_COUNTRY_NOT_SUPPORTED,
- lookup_unavailable: APIErrorCodes.PHONE_LOOKUP_UNAVAILABLE,
- invalid_number: APIErrorCodes.PHONE_NUMBER_NOT_IN_SERVICE,
- line_type_not_mobile: APIErrorCodes.PHONE_NUMBER_NOT_MOBILE,
- line_type_hard_rejected: APIErrorCodes.PHONE_NUMBER_NOT_MOBILE,
- sms_pumping_risk_high: APIErrorCodes.PHONE_VERIFICATION_NEEDS_REVIEW,
- behavioural_risk_blocked: APIErrorCodes.PHONE_VERIFICATION_NEEDS_REVIEW,
-};
-
-const INBOUND_REASONS: Record<PhoneAttemptInboundReason, true> = {
- voip: true,
- canadian: true,
- unknown_line_type: true,
- expensive_destination: true,
- account_forced: true,
- behavioural_risk: true,
-};
-
-describe('every reject reason maps to its own error', () => {
- it.each(Object.entries(REJECT_REASON_CODES))('%s produces %s', (reason, code) => {
- expect(errorForPhoneRejectReason(reason as PhoneAttemptRejectReason).code).toBe(code);
- });
- it('covers all eight declared reject reasons', () => {
- expect(Object.keys(REJECT_REASON_CODES)).toHaveLength(8);
- });
-});
-
-describe('reject reasons reaching the caller through the real gate', () => {
- it('invalid_format keeps the plain invalid-number error', async () => {
- expect(await codeFromVerify('5551234')).toBe(REJECT_REASON_CODES.invalid_format);
- });
- it('banned_prefix says the country is unsupported', async () => {
- phonePrefixBanCache.ban('+31970');
- expect(await codeFromVerify('+31970123456')).toBe(REJECT_REASON_CODES.banned_prefix);
- });
- it('lookup_unavailable blames our own checker', async () => {
- expect(await codeFromVerify(MOBILE_US, {lookupResult: null})).toBe(REJECT_REASON_CODES.lookup_unavailable);
- });
- it('invalid_number says the carrier rejected it', async () => {
- expect(await codeFromVerify(MOBILE_US, {lookupResult: lookup({valid: false})})).toBe(
- REJECT_REASON_CODES.invalid_number,
- );
- });
- it.each(['landline', 'tollFree', 'premium', 'sharedCost', 'uan', 'voicemail', 'pager'] as const)(
- 'line_type_hard_rejected for %s says it is not a mobile',
- async (lineType) => {
- expect(await codeFromVerify(MOBILE_US, {lookupResult: lookup({lineType})})).toBe(
- REJECT_REASON_CODES.line_type_hard_rejected,
- );
- },
- );
- it('sms_pumping_risk_high routes to human review', async () => {
- expect(await codeFromVerify(MOBILE_US, {lookupResult: lookup({smsPumpingRiskScore: 100})})).toBe(
- REJECT_REASON_CODES.sms_pumping_risk_high,
- );
- });
- it('line_type_not_mobile is unreachable through the verdict and is covered by the mapper alone', async () => {
- const accepted: Array<PhoneLineType> = ['mobile', 'personal'];
- for (const lineType of accepted) {
- const {ctx} = buildContext({lookupResult: lookup({lineType})});
- const rejection = await verifyPhoneCode(ctx, MOBILE_US, '123456', USER_ID).then(
- () => null,
- (error: FluxerError) => error.code,
- );
- expect(rejection).not.toBe(APIErrorCodes.PHONE_NUMBER_NOT_MOBILE);
- expect(rejection).not.toBe(APIErrorCodes.PHONE_INBOUND_VERIFICATION_REQUIRED);
- }
- expect(errorForPhoneRejectReason('line_type_not_mobile').code).toBe(REJECT_REASON_CODES.line_type_not_mobile);
- });
- it('behavioural_risk_blocked has no producer in the gate and is covered by the mapper alone', () => {
- expect(errorForPhoneRejectReason('behavioural_risk_blocked').code).toBe(
- REJECT_REASON_CODES.behavioural_risk_blocked,
- );
- });
-});
-
-describe('every inbound reason', () => {
- it('covers all six declared inbound reasons', () => {
- expect(Object.keys(INBOUND_REASONS)).toHaveLength(6);
- });
- it.each(['fixedVoip', 'nonFixedVoip'] as const)('routes %s to the inbound challenge as voip', async (lineType) => {
- expect(await inboundReasonFromSend(MOBILE_US, {lookupResult: lookup({lineType})})).toBe('voip');
- });
- it('routes a Canadian number to the inbound challenge as canadian', async () => {
- expect(await inboundReasonFromSend(CANADIAN)).toBe('canadian');
- });
- it.each([null, 'unknown'] as const)('routes line type %s to the inbound challenge', async (lineType) => {
- expect(await inboundReasonFromSend(MOBILE_US, {lookupResult: lookup({lineType})})).toBe('unknown_line_type');
- });
- it('routes an explicit inbound channel request as expensive_destination', async () => {
- expect(await inboundReasonFromSend(MOBILE_US, {}, 'inbound_challenge')).toBe('expensive_destination');
- });
- it('routes a force-flagged account as account_forced', async () => {
- expect(await inboundReasonFromSend(MOBILE_US, {userFlags: UserFlags.FORCE_INBOUND_PHONE_VERIFICATION})).toBe(
- 'account_forced',
- );
- });
- it('routes a risk-flagged account as behavioural_risk', async () => {
- expect(await inboundReasonFromSend(MOBILE_US, {riskDecision: 'require_inbound'})).toBe('behavioural_risk');
- });
-});
-
-describe('inbound reasons a caller cannot answer', () => {
- it.each([
- [lookup({lineType: 'fixedVoip'}), MOBILE_US],
- [lookup({lineType: 'nonFixedVoip'}), MOBILE_US],
- [lookup({lineType: null}), MOBILE_US],
- [lookup({lineType: 'unknown'}), MOBILE_US],
- [lookup(), CANADIAN],
- ])('tells the user to restart phone verification instead of calling the number invalid', async (result, phone) => {
- expect(await codeFromVerify(phone, {lookupResult: result})).toBe(APIErrorCodes.PHONE_INBOUND_VERIFICATION_REQUIRED);
- });
- it('never reports the inbound reason to the caller', async () => {
- const voip = await codeFromVerify(MOBILE_US, {lookupResult: lookup({lineType: 'fixedVoip'})});
- const canadian = await codeFromVerify(CANADIAN);
- const unknown = await codeFromVerify(MOBILE_US, {lookupResult: lookup({lineType: 'unknown'})});
- expect(new Set([voip, canadian, unknown]).size).toBe(1);
- });
-});
-
-describe('inbound challenge issuance failures', () => {
- it.each([
- ['voip', {lookupResult: lookup({lineType: 'fixedVoip'})}, undefined],
- ['account_forced', {userFlags: UserFlags.FORCE_INBOUND_PHONE_VERIFICATION}, undefined],
- ['behavioural_risk', {riskDecision: 'require_inbound' as const}, undefined],
- ['expensive_destination', {}, 'inbound_challenge' as const],
- ])('surfaces the send-path outage for %s', async (_reason, options, channel) => {
- const {ctx} = buildContext({...(options as HarnessOptions), challengeFails: true});
- try {
- await sendPhoneVerificationCode(ctx, MOBILE_US, USER_ID, channel ? {channel} : {});
- } catch (error) {
- expect((error as FluxerError).code).toBe(APIErrorCodes.SMS_VERIFICATION_UNAVAILABLE);
- return;
- }
- throw new Error('sendPhoneVerificationCode did not reject');
- });
-});
-
-async function recordedRejectionFor(options: HarnessOptions): Promise<boolean> {
- const {ctx, record} = buildContext(options);
- await sendPhoneVerificationCode(ctx, MOBILE_US, USER_ID, {}).catch(() => undefined);
- const call = record.mock.calls.at(-1)?.[0];
- if (!call) {
- throw new Error('phoneAttemptRisk.record was never called');
- }
- return call.rejected;
-}
-
-describe('what each rejection costs the user', () => {
- it('does not count our own lookup outage against them', async () => {
- expect(await recordedRejectionFor({lookupResult: null})).toBe(false);
- });
- it.each([
- ['invalid_number', lookup({valid: false})],
- ['line_type_hard_rejected', lookup({lineType: 'landline'})],
- ['sms_pumping_risk_high', lookup({smsPumpingRiskScore: 100})],
- ])('still counts %s against them', async (_reason, lookupResult) => {
- expect(await recordedRejectionFor({lookupResult})).toBe(true);
- });
- it('does not count an inbound-challenge routing against them', async () => {
- expect(await recordedRejectionFor({lookupResult: lookup({lineType: 'fixedVoip'})})).toBe(false);
- });
-});
diff --git a/fluxer_api/src/api/auth/__tests__/PhonePrefixBanCache.test.ts b/fluxer_api/src/api/auth/__tests__/PhonePrefixBanCache.test.ts
deleted file mode 100644
index b7f288e87..000000000
--- a/fluxer_api/src/api/auth/__tests__/PhonePrefixBanCache.test.ts
+++ /dev/null
@@ -1,107 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {PhonePrefixBanCache} from '@app/api/auth/PhonePrefixBanCache';
-import {beforeEach, describe, expect, it} from 'vitest';
-
-describe('PhonePrefixBanCache', () => {
- let cache: PhonePrefixBanCache;
- beforeEach(() => {
- cache = new PhonePrefixBanCache();
- });
- it('matches phones that start with a banned prefix', () => {
- cache.ban('+31970');
- expect(cache.isBlocked('+31970123456')).toBe(true);
- expect(cache.isBlocked('+3197058046507')).toBe(true);
- expect(cache.isBlocked('+3197058046509')).toBe(true);
- });
- it('does not match phones outside the banned prefix', () => {
- cache.ban('+31970');
- expect(cache.isBlocked('+15551234567')).toBe(false);
- expect(cache.isBlocked('+31612345678')).toBe(false);
- expect(cache.isBlocked('+31201234567')).toBe(false);
- });
- it('is empty by default — no prefixes block anything until ban() is called', () => {
- expect(cache.isBlocked('+31970123456')).toBe(false);
- expect(cache.isBlocked('+15551234567')).toBe(false);
- });
- it('unban() removes a prefix from the active set', () => {
- cache.ban('+31970');
- expect(cache.isBlocked('+31970123456')).toBe(true);
- cache.unban('+31970');
- expect(cache.isBlocked('+31970123456')).toBe(false);
- });
- it('supports multiple simultaneous prefixes', () => {
- cache.ban('+31970');
- cache.ban('+15550');
- expect(cache.isBlocked('+31970123456')).toBe(true);
- expect(cache.isBlocked('+15550000000')).toBe(true);
- expect(cache.isBlocked('+15551234567')).toBe(false);
- });
- it('only matches at the start of the string (prefix semantics, not substring)', () => {
- cache.ban('+31970');
- expect(cache.isBlocked('+1555031970123')).toBe(false);
- });
- it('ignores empty-string bans', () => {
- cache.ban('');
- expect(cache.isBlocked('+31970123456')).toBe(false);
- expect(cache.isBlocked('+15551234567')).toBe(false);
- });
- it('ban() is idempotent — double-banning the same prefix is a no-op', () => {
- cache.ban('+31970');
- cache.ban('+31970');
- expect(cache.snapshot().size).toBe(1);
- cache.unban('+31970');
- expect(cache.snapshot().size).toBe(0);
- });
- it('snapshot() exposes the live set for exact-membership checks', () => {
- cache.ban('+31970');
- cache.ban('+15550');
- const snapshot = cache.snapshot();
- expect(snapshot.has('+31970')).toBe(true);
- expect(snapshot.has('+15550')).toBe(true);
- expect(snapshot.has('+31971')).toBe(false);
- });
- describe('length-bucketing optimization', () => {
- it('matches against prefixes of multiple distinct lengths', () => {
- cache.ban('+1');
- cache.ban('+31970');
- cache.ban('+449876');
- expect(cache.isBlocked('+15551234567')).toBe(true);
- expect(cache.isBlocked('+31970123456')).toBe(true);
- expect(cache.isBlocked('+449876543210')).toBe(true);
- expect(cache.isBlocked('+449100000000')).toBe(false);
- expect(cache.isBlocked('+31612345678')).toBe(false);
- });
- it('returns false immediately when the phone is shorter than the shortest banned prefix', () => {
- cache.ban('+31970');
- expect(cache.isBlocked('+31')).toBe(false);
- expect(cache.isBlocked('+319')).toBe(false);
- expect(cache.isBlocked('+3197')).toBe(false);
- expect(cache.isBlocked('+31970')).toBe(true);
- expect(cache.isBlocked('+319701')).toBe(true);
- });
- it('early-exits once prefix length exceeds phone length', () => {
- cache.ban('+49123456');
- cache.ban('+12345678');
- expect(cache.isBlocked('+12345')).toBe(false);
- });
- it('rebuilds length index when unban removes the last prefix of a given length', () => {
- cache.ban('+1');
- cache.ban('+44');
- cache.ban('+31970');
- expect(cache.isBlocked('+31970123')).toBe(true);
- cache.unban('+31970');
- expect(cache.isBlocked('+31970123')).toBe(false);
- expect(cache.isBlocked('+15551234567')).toBe(true);
- expect(cache.isBlocked('+441234567890')).toBe(true);
- });
- it('handles phones that match only at a deep length', () => {
- cache.ban('+31');
- cache.ban('+31970');
- expect(cache.isBlocked('+31970123')).toBe(true);
- cache.unban('+31');
- expect(cache.isBlocked('+31970123')).toBe(true);
- expect(cache.isBlocked('+31612345678')).toBe(false);
- });
- });
-});
diff --git a/fluxer_api/src/api/auth/__tests__/PhoneRejectionErrors.test.ts b/fluxer_api/src/api/auth/__tests__/PhoneRejectionErrors.test.ts
deleted file mode 100644
index 79741c87d..000000000
--- a/fluxer_api/src/api/auth/__tests__/PhoneRejectionErrors.test.ts
+++ /dev/null
@@ -1,41 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {errorForPhoneRejectReason} from '@app/api/auth/AuthPhone';
-import type {PhoneAttemptRejectReason} from '@app/api/auth/services/PhoneLookupRepository';
-import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
-import {describe, expect, it} from 'vitest';
-
-const EXPECTED_CODES: ReadonlyArray<[PhoneAttemptRejectReason, string]> = [
- ['invalid_format', APIErrorCodes.INVALID_PHONE_NUMBER],
- ['banned_prefix', APIErrorCodes.PHONE_COUNTRY_NOT_SUPPORTED],
- ['lookup_unavailable', APIErrorCodes.PHONE_LOOKUP_UNAVAILABLE],
- ['invalid_number', APIErrorCodes.PHONE_NUMBER_NOT_IN_SERVICE],
- ['line_type_not_mobile', APIErrorCodes.PHONE_NUMBER_NOT_MOBILE],
- ['line_type_hard_rejected', APIErrorCodes.PHONE_NUMBER_NOT_MOBILE],
- ['sms_pumping_risk_high', APIErrorCodes.PHONE_VERIFICATION_NEEDS_REVIEW],
- ['behavioural_risk_blocked', APIErrorCodes.PHONE_VERIFICATION_NEEDS_REVIEW],
-];
-
-describe('errorForPhoneRejectReason', () => {
- it.each(EXPECTED_CODES)('maps %s to %s', (reason, code) => {
- expect(errorForPhoneRejectReason(reason).code).toBe(code);
- });
- it.each(EXPECTED_CODES)('returns a 400 for %s', (reason) => {
- expect(errorForPhoneRejectReason(reason).status).toBe(400);
- });
- it('gives both line type rejections the same code', () => {
- expect(errorForPhoneRejectReason('line_type_not_mobile').code).toBe(
- errorForPhoneRejectReason('line_type_hard_rejected').code,
- );
- });
- it('gives both fraud signals the same response body', async () => {
- const pumping = await errorForPhoneRejectReason('sms_pumping_risk_high').getResponse().text();
- const behavioural = await errorForPhoneRejectReason('behavioural_risk_blocked').getResponse().text();
- expect(pumping).toBe(behavioural);
- });
- it('keeps the fraud signals distinct from every benign reason', () => {
- const review = errorForPhoneRejectReason('sms_pumping_risk_high').code;
- const benign = EXPECTED_CODES.filter(([, code]) => code !== review).map(([, code]) => code);
- expect(benign).not.toContain(review);
- });
-});
diff --git a/fluxer_api/src/api/auth/__tests__/PhoneVerificationPrefixPolicy.test.ts b/fluxer_api/src/api/auth/__tests__/PhoneVerificationPrefixPolicy.test.ts
deleted file mode 100644
index 000931127..000000000
--- a/fluxer_api/src/api/auth/__tests__/PhoneVerificationPrefixPolicy.test.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {requiresInboundPhoneVerification} from '@app/api/auth/PhoneVerificationPrefixPolicy';
-import {describe, expect, it} from 'vitest';
-
-describe('PhoneVerificationPrefixPolicy', () => {
- const configuredPrefixes = ['+101', '+202', '+3034'];
-
- it('requires inbound verification for configured prefixes', () => {
- expect(requiresInboundPhoneVerification('+1015551234', configuredPrefixes)).toBe(true);
- expect(requiresInboundPhoneVerification('+2025551234', configuredPrefixes)).toBe(true);
- expect(requiresInboundPhoneVerification('+30345551234', configuredPrefixes)).toBe(true);
- });
- it('does not require inbound verification for prefixes outside config', () => {
- expect(requiresInboundPhoneVerification('+15551234567', configuredPrefixes)).toBe(false);
- expect(requiresInboundPhoneVerification('+4045551234', configuredPrefixes)).toBe(false);
- });
-});
diff --git a/fluxer_api/src/api/auth/services/IRegistrationRiskEvaluator.ts b/fluxer_api/src/api/auth/services/IRegistrationRiskEvaluator.ts
deleted file mode 100644
index f04c8b37e..000000000
--- a/fluxer_api/src/api/auth/services/IRegistrationRiskEvaluator.ts
+++ /dev/null
@@ -1,25 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {RecommendedAction, RiskAssessment, RiskLevel} from '@app/api/risk/RiskTypes';
-
-export interface RegistrationRiskParams {
- email: string | null;
- clientIp: string;
- locale: string | null;
- timezone: string | null;
- userAgent: string | null;
- username?: string | null;
- globalName?: string | null;
- usernameIsUserChosen?: boolean;
- isUnclaimed?: boolean;
-}
-
-export interface RegistrationRiskResult {
- assessment: RiskAssessment;
- level: RiskLevel;
- recommendedAction: RecommendedAction;
-}
-
-export interface IRegistrationRiskEvaluator {
- evaluate(params: RegistrationRiskParams): Promise<RegistrationRiskResult>;
-}
diff --git a/fluxer_api/src/api/auth/services/InboundSmsChallengeService.ts b/fluxer_api/src/api/auth/services/InboundSmsChallengeService.ts
deleted file mode 100644
index b4db5d40b..000000000
--- a/fluxer_api/src/api/auth/services/InboundSmsChallengeService.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {UserID} from '@app/api/BrandedTypes';
-import {BatchBuilder, fetchOne} from '@app/api/database/CassandraQueryExecution';
-import {Db} from '@app/api/database/CassandraTypes';
-import type {InboundSmsChallengeRow} from '@app/api/database/types/RiskTypes';
-import {InboundSmsChallenges, InboundSmsChallengesByUser} from '@app/api/Tables';
-import {randomNumericCode} from '@app/api/utils/RandomUtils';
-import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
-
-interface IssueChallengeParams {
- userId: UserID;
- ourNumber: string;
- ttlSeconds?: number;
-}
-
-export interface IssuedChallenge {
- challengeCode: string;
- ourNumber: string;
- expiresAt: Date;
-}
-
-interface ConsumedChallenge {
- userId: UserID;
- consumedAt: Date;
-}
-
-interface IInboundSmsChallengeRepository {
- insertChallenge(row: InboundSmsChallengeRow): Promise<void>;
- getChallenge(code: string): Promise<InboundSmsChallengeRow | null>;
- markConsumed(code: string, fromPhone: string, consumedAt: Date): Promise<void>;
-}
-
-const DEFAULT_TTL_SECONDS = 900;
-const CODE_LENGTH = 6;
-const CONSUME_LOCK_PREFIX = 'sms_challenge:consume:';
-const CONSUME_LOCK_TTL_SECONDS = 30;
-
-export class InboundSmsChallengeService {
- constructor(
- private readonly repository: IInboundSmsChallengeRepository,
- private readonly kvClient: IKVProvider,
- ) {}
-
- async issueChallenge(params: IssueChallengeParams): Promise<IssuedChallenge> {
- const ttl = params.ttlSeconds ?? DEFAULT_TTL_SECONDS;
- const challengeCode = generateNumericCode(CODE_LENGTH);
- const now = new Date();
- const expiresAt = new Date(now.getTime() + ttl * 1000);
- await this.repository.insertChallenge({
- challenge_code: challengeCode,
- user_id: params.userId,
- our_number: params.ourNumber,
- created_at: now,
- expires_at: expiresAt,
- consumed_at: null,
- consumed_from_phone: null,
- });
- return {challengeCode, ourNumber: params.ourNumber, expiresAt};
- }
-
- async consumeChallenge(args: {code: string; fromPhone: string}): Promise<ConsumedChallenge | null> {
- const normalizedCode = args.code.trim();
- const lockKey = `${CONSUME_LOCK_PREFIX}${normalizedCode}`;
- const acquired = await this.kvClient.acquireLock(lockKey, '1', CONSUME_LOCK_TTL_SECONDS);
- if (!acquired) {
- return null;
- }
- try {
- const challenge = await this.repository.getChallenge(normalizedCode);
- if (!challenge) return null;
- if (challenge.consumed_at !== null) return null;
- if (challenge.expires_at.getTime() < Date.now()) return null;
- const consumedAt = new Date();
- await this.repository.markConsumed(normalizedCode, args.fromPhone, consumedAt);
- return {userId: challenge.user_id, consumedAt};
- } finally {
- await this.kvClient.del(lockKey).catch(() => {});
- }
- }
-}
-
-export class CassandraInboundSmsChallengeRepository implements IInboundSmsChallengeRepository {
- async insertChallenge(row: InboundSmsChallengeRow): Promise<void> {
- const batch = new BatchBuilder();
- batch.addPrepared(InboundSmsChallenges.insert(row));
- batch.addPrepared(
- InboundSmsChallengesByUser.insert({
- user_id: row.user_id,
- created_at: row.created_at,
- challenge_code: row.challenge_code,
- expires_at: row.expires_at,
- }),
- );
- await batch.execute(false);
- }
-
- async getChallenge(code: string): Promise<InboundSmsChallengeRow | null> {
- return (
- (await fetchOne<InboundSmsChallengeRow>(
- InboundSmsChallenges.selectCql({where: InboundSmsChallenges.where.eq('challenge_code'), limit: 1}),
- {challenge_code: code},
- )) ?? null
- );
- }
-
- async markConsumed(code: string, fromPhone: string, consumedAt: Date): Promise<void> {
- const batch = new BatchBuilder();
- batch.addPrepared(
- InboundSmsChallenges.patchByPk(
- {challenge_code: code},
- {consumed_at: Db.set(consumedAt), consumed_from_phone: Db.set(fromPhone)},
- ),
- );
- await batch.execute(false);
- }
-}
-
-function generateNumericCode(length: number): string {
- return randomNumericCode(length);
-}
diff --git a/fluxer_api/src/api/auth/services/PhoneAttemptRiskService.ts b/fluxer_api/src/api/auth/services/PhoneAttemptRiskService.ts
deleted file mode 100644
index 2e2351444..000000000
--- a/fluxer_api/src/api/auth/services/PhoneAttemptRiskService.ts
+++ /dev/null
@@ -1,357 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createHmac, randomBytes, randomUUID} from 'node:crypto';
-import {Logger} from '@app/api/Logger';
-import {getSameIpDecisionKey, getSubnet} from '@fluxer/ip_utils/src/IpAddress';
-import type {ICacheService} from '@pkgs/cache/src/ICacheService';
-import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
-
-const WINDOW_SECONDS = 24 * 60 * 60;
-const HARD_BLOCK_TTL_SECONDS = 24 * 60 * 60;
-const IP_BLOCK_TTL_SECONDS = 60 * 60;
-const HMAC_ROTATE_AFTER_MS = 28 * 24 * 60 * 60 * 1000;
-const HMAC_KEY_TTL_SECONDS = 31 * 24 * 60 * 60;
-const HMAC_KEY_CACHE_KEY = 'auth:phone:risk:hmac-key-state';
-const KEY_PREFIX = 'auth:phone:risk:';
-
-interface PhoneAttemptRiskThresholds {
- userDistinctPrefixCaptcha: number;
- userDistinctPhonesHardBlock: number;
- userDistinctCountriesRequireInbound: number;
- ipDistinctPhonesHardBlock: number;
- ipDistinctUsersHardBlock: number;
- subnetDistinctPhonesHardBlock: number;
-}
-
-const DEFAULT_THRESHOLDS: PhoneAttemptRiskThresholds = {
- userDistinctPrefixCaptcha: 3,
- userDistinctPhonesHardBlock: 5,
- userDistinctCountriesRequireInbound: 3,
- ipDistinctPhonesHardBlock: 10,
- ipDistinctUsersHardBlock: 3,
- subnetDistinctPhonesHardBlock: 30,
-};
-
-type PhoneAttemptRiskDecision = 'allow' | 'require_captcha' | 'require_inbound' | 'hard_block';
-type PhoneAttemptRiskReason =
- | 'user_prefix_sweep'
- | 'user_rejected_burst'
- | 'user_country_sweep'
- | 'ip_distinct_phones'
- | 'ip_user_pool'
- | 'subnet_distinct_phones'
- | 'user_already_hard_blocked'
- | 'ip_already_hard_blocked'
- | 'subnet_already_hard_blocked';
-
-interface PhoneAttemptRiskEvaluation {
- decision: PhoneAttemptRiskDecision;
- reason: PhoneAttemptRiskReason | null;
- counters: {
- userAttempts: number;
- userRejected: number;
- userDistinctPrefix: number;
- userDistinctCountries: number;
- ipDistinctPhones: number;
- ipDistinctUsers: number;
- subnetDistinctPhones: number;
- };
-}
-
-const ZERO_COUNTERS: PhoneAttemptRiskEvaluation['counters'] = {
- userAttempts: 0,
- userRejected: 0,
- userDistinctPrefix: 0,
- userDistinctCountries: 0,
- ipDistinctPhones: 0,
- ipDistinctUsers: 0,
- subnetDistinctPhones: 0,
-};
-
-interface PhoneAttemptRiskInput {
- userId?: string | bigint | null;
- clientIp?: string | null;
- phone: string;
- countryCode?: string | null;
-}
-
-interface PhoneAttemptRecordInput extends PhoneAttemptRiskInput {
- rejected: boolean;
-}
-
-interface HmacKey {
- id: string;
- secret: string;
- created_at: string;
-}
-
-interface HmacKeyState {
- primary: HmacKey;
- secondary: HmacKey | null;
-}
-
-function newKey(): HmacKey {
- return {id: randomUUID(), secret: randomBytes(32).toString('base64url'), created_at: new Date().toISOString()};
-}
-
-function shouldRotate(key: HmacKey): boolean {
- return Date.now() - new Date(key.created_at).getTime() > HMAC_ROTATE_AFTER_MS;
-}
-
-function hmac(value: string, key: HmacKey): string {
- return createHmac('sha256', Buffer.from(key.secret, 'base64url')).update(value).digest('base64url');
-}
-
-function prefix6(phone: string): string {
- return phone.slice(0, 6);
-}
-
-function userKey(userId: string | bigint, suffix: string): string {
- return `${KEY_PREFIX}user:${String(userId)}:${suffix}`;
-}
-
-function ipKey(ip: string, suffix: string): string {
- return `${KEY_PREFIX}ip:${getSameIpDecisionKey(ip) ?? ip}:${suffix}`;
-}
-
-function subnetKey(subnet: string, suffix: string): string {
- return `${KEY_PREFIX}ipnet:${subnet}:${suffix}`;
-}
-
-type PhoneAttemptHardBlockHook = (params: {
- userId: string | null;
- clientIp: string | null;
- reason: PhoneAttemptRiskReason;
-}) => void;
-
-export class PhoneAttemptRiskService {
- private readonly cache: ICacheService;
- private readonly kv: IKVProvider;
- private readonly thresholds: PhoneAttemptRiskThresholds;
- private readonly hardBlockHooks: Array<PhoneAttemptHardBlockHook> = [];
- private keyState: HmacKeyState | null = null;
-
- constructor(cache: ICacheService, kv: IKVProvider, thresholds: Partial<PhoneAttemptRiskThresholds> = {}) {
- this.cache = cache;
- this.kv = kv;
- this.thresholds = {...DEFAULT_THRESHOLDS, ...thresholds};
- }
-
- onHardBlock(hook: PhoneAttemptHardBlockHook): void {
- this.hardBlockHooks.push(hook);
- }
-
- async evaluate(input: PhoneAttemptRiskInput): Promise<PhoneAttemptRiskEvaluation> {
- const evaluation: PhoneAttemptRiskEvaluation = {
- decision: 'allow',
- reason: null,
- counters: {...ZERO_COUNTERS},
- };
- if (input.userId !== null && input.userId !== undefined && input.userId !== '') {
- if ((await this.kv.exists(userKey(input.userId, 'hard_block'))) > 0) {
- evaluation.decision = 'hard_block';
- evaluation.reason = 'user_already_hard_blocked';
- return evaluation;
- }
- }
- if (input.clientIp) {
- if ((await this.kv.exists(ipKey(input.clientIp, 'hard_block'))) > 0) {
- evaluation.decision = 'hard_block';
- evaluation.reason = 'ip_already_hard_blocked';
- return evaluation;
- }
- const subnet = getSubnet(input.clientIp) ?? input.clientIp;
- if ((await this.kv.exists(subnetKey(subnet, 'hard_block'))) > 0) {
- evaluation.decision = 'hard_block';
- evaluation.reason = 'subnet_already_hard_blocked';
- return evaluation;
- }
- }
- if (input.userId !== null && input.userId !== undefined && input.userId !== '') {
- const userAttempts = await this.peekCounter(userKey(input.userId, 'attempts'));
- const userRejected = await this.peekCounter(userKey(input.userId, 'rejected'));
- const userDistinctPrefix = await this.kv.scard(userKey(input.userId, 'prefix6'));
- const userDistinctCountries = await this.kv.scard(userKey(input.userId, 'countries'));
- evaluation.counters.userAttempts = userAttempts;
- evaluation.counters.userRejected = userRejected;
- evaluation.counters.userDistinctPrefix = userDistinctPrefix;
- evaluation.counters.userDistinctCountries = userDistinctCountries;
- const rejectedRatio = userAttempts > 0 ? userRejected / userAttempts : 0;
- if (userAttempts >= this.thresholds.userDistinctPhonesHardBlock && rejectedRatio >= 0.5) {
- evaluation.decision = 'hard_block';
- evaluation.reason = 'user_rejected_burst';
- return evaluation;
- }
- if (userDistinctCountries >= this.thresholds.userDistinctCountriesRequireInbound) {
- evaluation.decision = 'require_inbound';
- evaluation.reason = 'user_country_sweep';
- return evaluation;
- }
- if (userDistinctPrefix >= this.thresholds.userDistinctPrefixCaptcha) {
- evaluation.decision = 'require_captcha';
- evaluation.reason = 'user_prefix_sweep';
- return evaluation;
- }
- }
- if (input.clientIp) {
- const ipDistinctPhones = await this.kv.scard(ipKey(input.clientIp, 'phones'));
- const ipDistinctUsers = await this.kv.scard(ipKey(input.clientIp, 'users'));
- evaluation.counters.ipDistinctPhones = ipDistinctPhones;
- evaluation.counters.ipDistinctUsers = ipDistinctUsers;
- if (
- ipDistinctPhones >= this.thresholds.ipDistinctPhonesHardBlock &&
- ipDistinctUsers >= this.thresholds.ipDistinctUsersHardBlock
- ) {
- evaluation.decision = 'hard_block';
- evaluation.reason = 'ip_user_pool';
- return evaluation;
- }
- const subnet = getSubnet(input.clientIp) ?? input.clientIp;
- const subnetDistinctPhones = await this.kv.scard(subnetKey(subnet, 'phones'));
- evaluation.counters.subnetDistinctPhones = subnetDistinctPhones;
- if (subnetDistinctPhones >= this.thresholds.subnetDistinctPhonesHardBlock) {
- evaluation.decision = 'hard_block';
- evaluation.reason = 'subnet_distinct_phones';
- return evaluation;
- }
- }
- return evaluation;
- }
-
- async record(input: PhoneAttemptRecordInput): Promise<PhoneAttemptRiskEvaluation> {
- const key = await this.getCurrentKey();
- const userAttempts =
- input.userId !== null && input.userId !== undefined && input.userId !== ''
- ? await this.bumpCounter(userKey(input.userId, 'attempts'))
- : 0;
- const userRejected =
- input.rejected && input.userId !== null && input.userId !== undefined && input.userId !== ''
- ? await this.bumpCounter(userKey(input.userId, 'rejected'))
- : input.userId !== null && input.userId !== undefined && input.userId !== ''
- ? await this.peekCounter(userKey(input.userId, 'rejected'))
- : 0;
- let userDistinctPrefix = 0;
- let userDistinctCountries = 0;
- if (input.userId !== null && input.userId !== undefined && input.userId !== '') {
- userDistinctPrefix = await this.bumpSet(userKey(input.userId, 'prefix6'), hmac(prefix6(input.phone), key));
- if (input.countryCode) {
- userDistinctCountries = await this.bumpSet(userKey(input.userId, 'countries'), input.countryCode);
- }
- }
- let ipDistinctPhones = 0;
- let ipDistinctUsers = 0;
- let subnetDistinctPhones = 0;
- if (input.clientIp) {
- ipDistinctPhones = await this.bumpSet(ipKey(input.clientIp, 'phones'), hmac(input.phone, key));
- if (input.userId !== null && input.userId !== undefined && input.userId !== '') {
- ipDistinctUsers = await this.bumpSet(ipKey(input.clientIp, 'users'), hmac(String(input.userId), key));
- }
- const subnet = getSubnet(input.clientIp) ?? input.clientIp;
- subnetDistinctPhones = await this.bumpSet(subnetKey(subnet, 'phones'), hmac(input.phone, key));
- }
- const counters = {
- userAttempts,
- userRejected,
- userDistinctPrefix,
- userDistinctCountries,
- ipDistinctPhones,
- ipDistinctUsers,
- subnetDistinctPhones,
- };
- const tripped = this.tripsAt(counters);
- if (tripped !== null) {
- await this.applyHardBlock(input, tripped);
- }
- return {
- decision: tripped !== null ? 'hard_block' : 'allow',
- reason: tripped,
- counters,
- };
- }
-
- private tripsAt(counters: PhoneAttemptRiskEvaluation['counters']): PhoneAttemptRiskReason | null {
- const rejectedRatio = counters.userAttempts > 0 ? counters.userRejected / counters.userAttempts : 0;
- if (counters.userAttempts >= this.thresholds.userDistinctPhonesHardBlock && rejectedRatio >= 0.5) {
- return 'user_rejected_burst';
- }
- if (
- counters.ipDistinctPhones >= this.thresholds.ipDistinctPhonesHardBlock &&
- counters.ipDistinctUsers >= this.thresholds.ipDistinctUsersHardBlock
- ) {
- return 'ip_user_pool';
- }
- if (counters.subnetDistinctPhones >= this.thresholds.subnetDistinctPhonesHardBlock) {
- return 'subnet_distinct_phones';
- }
- return null;
- }
-
- private async applyHardBlock(input: PhoneAttemptRecordInput, reason: PhoneAttemptRiskReason): Promise<void> {
- if (
- reason === 'user_rejected_burst' &&
- input.userId !== null &&
- input.userId !== undefined &&
- input.userId !== ''
- ) {
- await this.kv.setex(userKey(input.userId, 'hard_block'), HARD_BLOCK_TTL_SECONDS, '1');
- } else if (reason === 'ip_user_pool' && input.clientIp) {
- await this.kv.setex(ipKey(input.clientIp, 'hard_block'), IP_BLOCK_TTL_SECONDS, '1');
- } else if (reason === 'subnet_distinct_phones' && input.clientIp) {
- const subnet = getSubnet(input.clientIp) ?? input.clientIp;
- await this.kv.setex(subnetKey(subnet, 'hard_block'), IP_BLOCK_TTL_SECONDS, '1');
- }
- Logger.warn(
- {
- reason,
- userId: input.userId ? String(input.userId) : null,
- clientIp: input.clientIp ?? null,
- },
- 'phone_attempt_risk.hard_block applied',
- );
- for (const hook of this.hardBlockHooks) {
- try {
- hook({
- userId: input.userId ? String(input.userId) : null,
- clientIp: input.clientIp ?? null,
- reason,
- });
- } catch (error) {
- Logger.warn({error, reason}, 'phone_attempt_risk.hard_block hook failed');
- }
- }
- }
-
- private async peekCounter(key: string): Promise<number> {
- const v = await this.kv.get(key);
- return v ? Number(v) : 0;
- }
-
- private async bumpCounter(key: string): Promise<number> {
- const value = await this.kv.incr(key);
- if (value === 1) {
- await this.kv.expire(key, WINDOW_SECONDS);
- }
- return value;
- }
-
- private async bumpSet(key: string, member: string): Promise<number> {
- await this.kv.sadd(key, member);
- await this.kv.expire(key, WINDOW_SECONDS);
- return await this.kv.scard(key);
- }
-
- private async getCurrentKey(): Promise<HmacKey> {
- if (this.keyState && !shouldRotate(this.keyState.primary)) {
- return this.keyState.primary;
- }
- const state = await this.cache.get<HmacKeyState>(HMAC_KEY_CACHE_KEY);
- if (state && !shouldRotate(state.primary)) {
- this.keyState = state;
- return state.primary;
- }
- const next: HmacKeyState = {primary: newKey(), secondary: state?.primary ?? null};
- await this.cache.set(HMAC_KEY_CACHE_KEY, next, HMAC_KEY_TTL_SECONDS);
- this.keyState = next;
- return next.primary;
- }
-}
diff --git a/fluxer_api/src/api/auth/services/PhoneFraudGraphService.ts b/fluxer_api/src/api/auth/services/PhoneFraudGraphService.ts
deleted file mode 100644
index 062b33101..000000000
--- a/fluxer_api/src/api/auth/services/PhoneFraudGraphService.ts
+++ /dev/null
@@ -1,91 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {UserID} from '@app/api/BrandedTypes';
-import {Logger} from '@app/api/Logger';
-import type {IUserRepository} from '@app/api/user/IUserRepository';
-import {UserFlags} from '@fluxer/constants/src/UserConstants';
-import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
-
-const COHORT_KEY_PREFIX = 'auth:ip24-cohort:';
-const COHORT_TTL_SECONDS = 7 * 24 * 60 * 60;
-const PROPAGATION_LOOKBACK_DAYS = 2;
-const MAX_NEIGHBOURS_TO_FLAG = 50;
-
-function cidr24For(ip: string): string | null {
- if (!ip.includes('.')) return null;
- const parts = ip.split('.');
- if (parts.length !== 4) return null;
- return `${parts[0]}.${parts[1]}.${parts[2]}.0/24`;
-}
-
-function dayKey(when: Date): string {
- const y = when.getUTCFullYear().toString().padStart(4, '0');
- const m = (when.getUTCMonth() + 1).toString().padStart(2, '0');
- const d = when.getUTCDate().toString().padStart(2, '0');
- return `${y}-${m}-${d}`;
-}
-
-function cohortKey(cidr24: string, day: string): string {
- return `${COHORT_KEY_PREFIX}${cidr24}:${day}`;
-}
-
-export class PhoneFraudGraphService {
- constructor(
- private readonly kv: IKVProvider,
- private readonly users: IUserRepository,
- ) {}
-
- async recordSessionForCohortGraph(userId: UserID, clientIp: string, createdAt: Date): Promise<void> {
- const cidr = cidr24For(clientIp);
- if (!cidr) return;
- const key = cohortKey(cidr, dayKey(createdAt));
- await this.kv.sadd(key, userId.toString());
- await this.kv.expire(key, COHORT_TTL_SECONDS);
- }
-
- async propagateHardBlock(blockedUserId: UserID | null, clientIp: string | null): Promise<number> {
- if (!clientIp) return 0;
- const cidr = cidr24For(clientIp);
- if (!cidr) return 0;
- const now = new Date();
- const days: Array<string> = [];
- for (let i = 0; i <= PROPAGATION_LOOKBACK_DAYS; i++) {
- const d = new Date(now.getTime() - i * 24 * 60 * 60 * 1000);
- days.push(dayKey(d));
- }
- const neighbours = new Set<string>();
- for (const day of days) {
- const members = await this.kv.smembers(cohortKey(cidr, day));
- for (const m of members) neighbours.add(m);
- if (neighbours.size >= MAX_NEIGHBOURS_TO_FLAG) break;
- }
- const blockedIdStr = blockedUserId ? blockedUserId.toString() : null;
- let flaggedCount = 0;
- for (const neighbourIdStr of neighbours) {
- if (flaggedCount >= MAX_NEIGHBOURS_TO_FLAG) break;
- if (neighbourIdStr === blockedIdStr) continue;
- try {
- const neighbourId = BigInt(neighbourIdStr) as UserID;
- const user = await this.users.findUnique(neighbourId);
- if (!user) continue;
- if ((user.flags & UserFlags.FORCE_INBOUND_PHONE_VERIFICATION) !== 0n) continue;
- if ((user.flags & UserFlags.NOT_SUSPICIOUS) !== 0n) continue;
- const newFlags = user.flags | UserFlags.FORCE_INBOUND_PHONE_VERIFICATION;
- await this.users.patchUpsert(neighbourId, {flags: newFlags}, user.toRow());
- flaggedCount++;
- } catch (error) {
- Logger.warn({neighbourId: neighbourIdStr, error}, 'phone_fraud_graph.flag failed for neighbour');
- }
- }
- Logger.warn(
- {
- cidr24: cidr,
- blockedUserId: blockedIdStr,
- neighboursSeen: neighbours.size,
- neighboursFlagged: flaggedCount,
- },
- 'phone_fraud_graph.propagated hard-block to /24 cohort',
- );
- return flaggedCount;
- }
-}
diff --git a/fluxer_api/src/api/auth/services/PhoneLookupRepository.ts b/fluxer_api/src/api/auth/services/PhoneLookupRepository.ts
deleted file mode 100644
index a978fbf42..000000000
--- a/fluxer_api/src/api/auth/services/PhoneLookupRepository.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {executeQuery, fetchOne} from '@app/api/database/CassandraQueryExecution';
-import type {PhoneLookupCacheRow, PhoneVerificationAttemptRow} from '@app/api/database/types/RiskTypes';
-import {PhoneLookupCache, PhoneVerificationAttempts} from '@app/api/Tables';
-import {createLogger} from '@fluxer/logger/src/Logger';
-import type {LoggerInterface} from '@fluxer/logger/src/LoggerInterface';
-import type {PhoneLookupResult} from '@pkgs/sms/src/PhoneLookupTypes';
-
-const CACHE_TTL_SECONDS = 7 * 24 * 60 * 60;
-const ATTEMPT_TTL_SECONDS = 90 * 24 * 60 * 60;
-
-export type PhoneAttemptRejectReason =
- | 'invalid_format'
- | 'banned_prefix'
- | 'lookup_unavailable'
- | 'invalid_number'
- | 'line_type_not_mobile'
- | 'line_type_hard_rejected'
- | 'sms_pumping_risk_high'
- | 'behavioural_risk_blocked';
-export type PhoneAttemptInboundReason =
- | 'voip'
- | 'canadian'
- | 'unknown_line_type'
- | 'expensive_destination'
- | 'account_forced'
- | 'behavioural_risk';
-type PhoneAttemptVerdict = 'accept' | 'reject' | 'require_inbound';
-
-export interface RecordAttemptParams {
- phone: string;
- lookup: PhoneLookupResult | null;
- verdict: PhoneAttemptVerdict;
- rejectReason: PhoneAttemptRejectReason | null;
- inboundReason: PhoneAttemptInboundReason | null;
- lookupCacheHit: boolean;
-}
-
-export interface IPhoneLookupRepository {
- getCachedLookup(phone: string): Promise<PhoneLookupResult | null>;
- setCachedLookup(phone: string, lookup: PhoneLookupResult): Promise<void>;
- recordAttempt(params: RecordAttemptParams): Promise<void>;
-}
-
-export class CassandraPhoneLookupRepository implements IPhoneLookupRepository {
- private readonly logger: LoggerInterface;
-
- constructor(logger?: LoggerInterface) {
- this.logger = logger ?? createLogger('./PhoneLookupRepository');
- }
-
- async getCachedLookup(phone: string): Promise<PhoneLookupResult | null> {
- try {
- const row = await fetchOne<PhoneLookupCacheRow>(
- PhoneLookupCache.selectCql({where: PhoneLookupCache.where.eq('phone'), limit: 1}),
- {phone},
- );
- if (!row) return null;
- return rowToLookupResult(row);
- } catch (error) {
- this.logger.warn(
- {error: error instanceof Error ? error.message : String(error)},
- '[PhoneLookupRepository] cache read failed (treating as miss)',
- );
- return null;
- }
- }
-
- async setCachedLookup(phone: string, lookup: PhoneLookupResult): Promise<void> {
- try {
- const row: PhoneLookupCacheRow = {
- phone,
- looked_up_at: new Date(),
- valid: lookup.valid,
- line_type: lookup.lineType,
- country_code: lookup.countryCode,
- carrier_name: lookup.carrierName,
- sms_pumping_risk_score: lookup.smsPumpingRiskScore,
- };
- await executeQuery(PhoneLookupCache.insertWithTtl(row, CACHE_TTL_SECONDS));
- } catch (error) {
- this.logger.warn(
- {error: error instanceof Error ? error.message : String(error)},
- '[PhoneLookupRepository] cache write failed',
- );
- }
- }
-
- async recordAttempt(params: RecordAttemptParams): Promise<void> {
- try {
- const row: PhoneVerificationAttemptRow = {
- attempt_id: crypto.randomUUID(),
- created_at: new Date(),
- phone: params.phone,
- country_code: params.lookup?.countryCode ?? null,
- line_type: params.lookup?.lineType ?? null,
- carrier_name: params.lookup?.carrierName ?? null,
- sms_pumping_risk_score: params.lookup?.smsPumpingRiskScore ?? null,
- verdict: params.verdict,
- reject_reason: params.rejectReason,
- inbound_reason: params.inboundReason,
- lookup_cache_hit: params.lookupCacheHit,
- };
- await executeQuery(PhoneVerificationAttempts.insertWithTtl(row, ATTEMPT_TTL_SECONDS));
- } catch (error) {
- this.logger.warn(
- {error: error instanceof Error ? error.message : String(error)},
- '[PhoneLookupRepository] attempts log write failed',
- );
- }
- }
-}
-
-function rowToLookupResult(row: PhoneLookupCacheRow): PhoneLookupResult {
- return {
- valid: row.valid,
- lineType: row.line_type as PhoneLookupResult['lineType'],
- countryCode: row.country_code,
- carrierName: row.carrier_name,
- smsPumpingRiskScore: row.sms_pumping_risk_score,
- };
-}
diff --git a/fluxer_api/src/api/auth/services/RegistrationRiskEvaluator.ts b/fluxer_api/src/api/auth/services/RegistrationRiskEvaluator.ts
deleted file mode 100644
index 90549ae66..000000000
--- a/fluxer_api/src/api/auth/services/RegistrationRiskEvaluator.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {
- IRegistrationRiskEvaluator,
- RegistrationRiskParams,
- RegistrationRiskResult,
-} from '@app/api/auth/services/IRegistrationRiskEvaluator';
-import {Logger} from '@app/api/Logger';
-import type {DeterministicRiskEngine} from '@app/api/risk/DeterministicRiskEngine';
-import {RecommendedAction, RiskConfidence, RiskDecisionMethod, RiskLevel} from '@app/api/risk/RiskTypes';
-
-export class RegistrationRiskEvaluator implements IRegistrationRiskEvaluator {
- constructor(private readonly riskEngine: Pick<DeterministicRiskEngine, 'classify'>) {}
-
- async evaluate(params: RegistrationRiskParams): Promise<RegistrationRiskResult> {
- const assessment = await this.riskEngine.classify({
- email: params.email,
- ip: params.clientIp,
- locale: params.locale,
- timezone: params.timezone,
- userAgent: params.userAgent,
- username: params.username,
- globalName: params.globalName,
- usernameIsUserChosen: params.usernameIsUserChosen,
- isUnclaimed: params.isUnclaimed,
- });
- if (assessment.suspicious) {
- Logger.info(
- {
- clientIp: params.clientIp,
- email: params.email,
- level: assessment.level,
- score: assessment.riskScore,
- method: assessment.method,
- elapsedMs: assessment.elapsedMs,
- recommendedAction: assessment.recommendedAction,
- },
- 'Registration risk evaluation flagged as suspicious',
- );
- }
- return {
- assessment,
- level: assessment.level,
- recommendedAction: assessment.recommendedAction,
- };
- }
-}
-
-export const noopRegistrationRiskEvaluator: IRegistrationRiskEvaluator = {
- async evaluate(): Promise<RegistrationRiskResult> {
- return {
- assessment: {
- suspicious: false,
- level: RiskLevel.Low,
- confidence: RiskConfidence.Low,
- riskScore: 0,
- reasoning: 'risk engine not configured — defaulted to allow',
- recommendedAction: RecommendedAction.Allow,
- method: RiskDecisionMethod.Noop,
- modelUsed: 'none',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- },
- level: RiskLevel.Low,
- recommendedAction: RecommendedAction.Allow,
- };
- },
-};
diff --git a/fluxer_api/src/api/auth/services/SsoService.ts b/fluxer_api/src/api/auth/services/SsoService.ts
index c6ef17a4f..78ad9059f 100644
--- a/fluxer_api/src/api/auth/services/SsoService.ts
+++ b/fluxer_api/src/api/auth/services/SsoService.ts
@@ -3,6 +3,7 @@
import {createHash, randomBytes} from 'node:crypto';
import type {ApiContext} from '@app/api/ApiContext';
import * as AuthSession from '@app/api/auth/AuthSession';
+import {assertEmailNotBlocklisted} from '@app/api/auth/EmailBlocklist';
import {SsoIdentityRepository} from '@app/api/auth/services/SsoIdentityRepository';
import {
parseTokenEndpointResponse,
@@ -11,6 +12,7 @@ import {
} from '@app/api/auth/services/SsoUtils';
import type {UserID} from '@app/api/BrandedTypes';
import type {ILogger} from '@app/api/ILogger';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
import type {IDiscriminatorService} from '@app/api/infrastructure/DiscriminatorService';
import type {KVActivityTracker} from '@app/api/infrastructure/KVActivityTracker';
import {
@@ -381,6 +383,7 @@ export class SsoService {
if (registrationConfig.mode === 'closed') {
throw new RegistrationClosedError();
}
+ await assertEmailNotBlocklisted(emailLower, 'email');
const pendingApproval = registrationConfig.mode === 'approval';
const user = await this.provisionUserFromClaims(claims, config, {pendingApproval});
if (pendingApproval) {
@@ -552,6 +555,25 @@ export class SsoService {
void this.kvActivityTracker.updateActivity(user.id, now).catch((error: unknown) => {
getLogger().warn({error, userId: user.id}, 'Failed to update real-time user activity');
});
+ await emitActivity(
+ 'registration',
+ user.id.toString(),
+ {
+ user_id: user.id.toString(),
+ method: 'oauth',
+ email: user.email,
+ username: user.username,
+ username_user_chosen: false,
+ global_name: user.globalName,
+ locale: user.locale,
+ timezone: null,
+ invite_code: null,
+ suspicious_flags: user.suspiciousActivityFlags ?? 0,
+ flags: user.flags.toString(),
+ },
+ null,
+ user.id.toString(),
+ );
return user;
} catch (error) {
if (!userCreated) {
diff --git a/fluxer_api/src/api/auth/tests/DeferredPhoneGate.test.ts b/fluxer_api/src/api/auth/tests/DeferredPhoneGate.test.ts
deleted file mode 100644
index 6d3f6efa7..000000000
--- a/fluxer_api/src/api/auth/tests/DeferredPhoneGate.test.ts
+++ /dev/null
@@ -1,747 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {IRegistrationRiskEvaluator} from '@app/api/auth/services/IRegistrationRiskEvaluator';
-import {
- createAuthHarness,
- createTestAccount,
- createUniqueEmail,
- createUniqueUsername,
- loginAccount,
- registerUser,
-} from '@app/api/auth/tests/AuthTestUtils';
-import {Config} from '@app/api/Config';
-import {setInjectedRegistrationRiskEvaluator} from '@app/api/middleware/ServiceMiddleware';
-import {getInstanceConfigRepository} from '@app/api/middleware/ServiceSingletons';
-import {
- authorizeOAuth2,
- createOAuth2Application,
- exchangeOAuth2AuthorizationCode,
-} from '@app/api/oauth/tests/OAuthTestUtils';
-import {PHONE_GATE_ESCAPE_MAX_GUILDS} from '@app/api/risk/DeferredPhoneGate';
-import {
- RecommendedAction,
- RiskConfidence,
- RiskDecisionMethod,
- RiskLevel,
- type RiskLevel as RiskLevelType,
-} from '@app/api/risk/RiskTypes';
-import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
-import {NoopGatewayService} from '@app/api/test/NoopGatewayService';
-import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
-import {
- DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- PHONE_GATE_PROMOTED_FROM_DEFERRAL,
- SuspiciousActivityFlags,
-} from '@fluxer/constants/src/UserConstants';
-import type {GuildResponse} from '@fluxer/schema/src/domains/guild/GuildResponseSchemas';
-import {afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, vi} from 'vitest';
-
-function phoneRiskEvaluator(level: RiskLevelType, riskScore: number): IRegistrationRiskEvaluator {
- return {
- async evaluate() {
- return {
- level,
- recommendedAction: RecommendedAction.RequireOutboundPhone,
- assessment: {
- suspicious: true,
- level,
- confidence: RiskConfidence.High,
- riskScore,
- reasoning: 'deferred phone gate test',
- recommendedAction: RecommendedAction.RequireOutboundPhone,
- method: RiskDecisionMethod.Noop,
- modelUsed: 'test',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- },
- };
- },
- };
-}
-
-async function createGuildWithInvite(harness: ApiTestHarness): Promise<{guildId: string; inviteCode: string}> {
- let owner = await createTestAccount(harness);
- await createBuilderWithoutAuth(harness)
- .post(`/test/users/${owner.userId}/acls`)
- .body({acls: ['*']})
- .expect(200)
- .execute();
- owner = await loginAccount(harness, owner);
- const guild = await createBuilder<GuildResponse>(harness, owner.token)
- .post('/guilds')
- .body({name: `PhoneGate-${Date.now()}`})
- .execute();
- const invite = await createBuilder<{code: string}>(harness, owner.token)
- .post(`/channels/${guild.system_channel_id}`.concat('/invites'))
- .body({max_uses: 0, max_age: 0, unique: false, temporary: false})
- .execute();
- return {guildId: guild.id, inviteCode: invite.code};
-}
-
-async function readFlags(userId: string): Promise<number> {
- const {UserRepository} = await import('@app/api/user/repositories/UserRepository');
- const {createUserID} = await import('@app/api/BrandedTypes');
- const user = await new UserRepository().findUnique(createUserID(BigInt(userId)));
- return user?.suspiciousActivityFlags ?? 0;
-}
-
-async function readGuildIds(userId: string): Promise<Array<string>> {
- const {GuildRepository} = await import('@app/api/guild/repositories/GuildRepository');
- const {createUserID} = await import('@app/api/BrandedTypes');
- const guilds = await new GuildRepository().listUserGuilds(createUserID(BigInt(userId)));
- return guilds.map((guild) => guild.id.toString());
-}
-
-const ESCAPE_PATH = '/users/@me/required-actions/phone-gate-escape';
-const RATE_LIMIT_HEADER = 'x-fluxer-test-enable-rate-limits';
-
-interface EscapeSubject {
- userId: string;
- token: string;
-}
-
-interface EscapePreviewResponse {
- available: boolean;
- guilds: Array<{id: string; name: string}>;
- owned_guilds: Array<{id: string; name: string}>;
-}
-
-describe('Deferred phone verification gate', () => {
- let harness: ApiTestHarness;
- beforeAll(async () => {
- harness = await createAuthHarness();
- });
- beforeEach(async () => {
- setInjectedRegistrationRiskEvaluator(undefined);
- await harness.reset();
- });
- afterAll(async () => {
- setInjectedRegistrationRiskEvaluator(undefined);
- await harness?.shutdown();
- });
-
- it('applies the phone requirement immediately while the gate is off', async () => {
- await getInstanceConfigRepository().setInstancePolicyConfig({deferred_phone_gate_enabled: false});
- setInjectedRegistrationRiskEvaluator(phoneRiskEvaluator(RiskLevel.High, 70));
- const registration = await registerUser(harness, {
- email: createUniqueEmail('gate-off'),
- username: createUniqueUsername('gate_off'),
- global_name: 'Gate Off',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- const flags = await readFlags(registration.user_id);
- expect(flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).not.toBe(0);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- });
-
- it('defers the phone requirement at registration while the gate is on', async () => {
- await getInstanceConfigRepository().setInstancePolicyConfig({deferred_phone_gate_enabled: true});
- setInjectedRegistrationRiskEvaluator(phoneRiskEvaluator(RiskLevel.High, 70));
- const registration = await registerUser(harness, {
- email: createUniqueEmail('gate-on'),
- username: createUniqueUsername('gate_on'),
- global_name: 'Gate On',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- const flags = await readFlags(registration.user_id);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- expect(flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).not.toBe(0);
- const me = await createBuilder<{required_actions: Array<string>}>(harness, registration.token)
- .get('/users/@me')
- .expect(200)
- .execute();
- expect(me.required_actions ?? []).toEqual([]);
- });
-
- it('lets a deferred account join a small guild without being challenged', async () => {
- await getInstanceConfigRepository().setInstancePolicyConfig({deferred_phone_gate_enabled: true});
- const {guildId, inviteCode} = await createGuildWithInvite(harness);
- setInjectedRegistrationRiskEvaluator(phoneRiskEvaluator(RiskLevel.High, 70));
- const registration = await registerUser(harness, {
- email: createUniqueEmail('gate-small'),
- username: createUniqueUsername('gate_small'),
- global_name: 'Gate Small',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- setInjectedRegistrationRiskEvaluator(undefined);
- await createBuilder(harness, registration.token).post(`/invites/${inviteCode}`).expect(200).execute();
- const flags = await readFlags(registration.user_id);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- expect(guildId).toBeTruthy();
- });
-
- it('does not defer the inbound-SMS tier, which stays enforced from registration', async () => {
- await getInstanceConfigRepository().setInstancePolicyConfig({deferred_phone_gate_enabled: true});
- setInjectedRegistrationRiskEvaluator({
- async evaluate() {
- return {
- level: RiskLevel.VeryHigh,
- recommendedAction: RecommendedAction.RequireInboundPhone,
- assessment: {
- suspicious: true,
- level: RiskLevel.VeryHigh,
- confidence: RiskConfidence.High,
- riskScore: 90,
- reasoning: 'inbound tier',
- recommendedAction: RecommendedAction.RequireInboundPhone,
- method: RiskDecisionMethod.Noop,
- modelUsed: 'test',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- },
- };
- },
- });
- const registration = await registerUser(harness, {
- email: createUniqueEmail('gate-inbound'),
- username: createUniqueUsername('gate_inbound'),
- global_name: 'Gate Inbound',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- const flags = await readFlags(registration.user_id);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- expect(flags & SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION).not.toBe(0);
- });
-
- it('promotes the requirement and refuses the join on a qualifying guild inside the window', async () => {
- await getInstanceConfigRepository().setInstancePolicyConfig({
- deferred_phone_gate_enabled: true,
- deferred_phone_gate_member_threshold: 1,
- deferred_phone_gate_window_hours: 24,
- });
- const {inviteCode} = await createGuildWithInvite(harness);
- const filler = await createTestAccount(harness);
- await createBuilder(harness, filler.token).post(`/invites/${inviteCode}`).expect(200).execute();
-
- setInjectedRegistrationRiskEvaluator(phoneRiskEvaluator(RiskLevel.High, 70));
- const registration = await registerUser(harness, {
- email: createUniqueEmail('gate-qualifying'),
- username: createUniqueUsername('gate_qualifying'),
- global_name: 'Gate Qualifying',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- setInjectedRegistrationRiskEvaluator(undefined);
- expect((await readFlags(registration.user_id)) & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
-
- await createBuilder(harness, registration.token).post(`/invites/${inviteCode}`).expect(403).execute();
-
- const flags = await readFlags(registration.user_id);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- expect(flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).not.toBe(0);
- });
-
- describe('with phone flagging disabled', () => {
- const originalPhoneFlagging = {...Config.abusePolicy.phoneFlagging};
- afterEach(() => {
- Config.abusePolicy.phoneFlagging = originalPhoneFlagging;
- });
-
- it('sets no phone requirement and no deferral at registration', async () => {
- await getInstanceConfigRepository().setInstancePolicyConfig({deferred_phone_gate_enabled: true});
- Config.abusePolicy.phoneFlagging = {enabled: false, exemptCountryCodes: []};
- setInjectedRegistrationRiskEvaluator(phoneRiskEvaluator(RiskLevel.High, 70));
- const registration = await registerUser(harness, {
- email: createUniqueEmail('flagging-off'),
- username: createUniqueUsername('flagging_off'),
- global_name: 'Flagging Off',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- const flags = await readFlags(registration.user_id);
- expect(flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).toBe(0);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- });
-
- it('keeps an existing deferral dormant on a qualifying join', async () => {
- await getInstanceConfigRepository().setInstancePolicyConfig({
- deferred_phone_gate_enabled: true,
- deferred_phone_gate_member_threshold: 1,
- deferred_phone_gate_window_hours: 24,
- });
- const {inviteCode} = await createGuildWithInvite(harness);
- const filler = await createTestAccount(harness);
- await createBuilder(harness, filler.token).post(`/invites/${inviteCode}`).expect(200).execute();
- setInjectedRegistrationRiskEvaluator(phoneRiskEvaluator(RiskLevel.High, 70));
- const registration = await registerUser(harness, {
- email: createUniqueEmail('flagging-off-join'),
- username: createUniqueUsername('flagging_off_join'),
- global_name: 'Flagging Off Join',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- setInjectedRegistrationRiskEvaluator(undefined);
- expect((await readFlags(registration.user_id)) & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
-
- Config.abusePolicy.phoneFlagging = {enabled: false, exemptCountryCodes: []};
- await createBuilder(harness, registration.token).post(`/invites/${inviteCode}`).expect(200).execute();
-
- const flags = await readFlags(registration.user_id);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- expect(flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).toBe(0);
- });
- });
-
- describe('phone gate escape', () => {
- async function configurePhoneGate(
- overrides: {
- deferred_phone_gate_enabled?: boolean;
- deferred_phone_gate_member_threshold?: number;
- deferred_phone_gate_window_hours?: number;
- single_community_enabled?: boolean;
- single_community_guild_id?: string | null;
- } = {},
- ): Promise<void> {
- await getInstanceConfigRepository().setInstancePolicyConfig({
- deferred_phone_gate_enabled: true,
- deferred_phone_gate_member_threshold: 1,
- deferred_phone_gate_window_hours: 24,
- ...overrides,
- });
- }
-
- async function registerDeferredUser(prefix: string): Promise<EscapeSubject> {
- setInjectedRegistrationRiskEvaluator(phoneRiskEvaluator(RiskLevel.High, 70));
- const registration = await registerUser(harness, {
- email: createUniqueEmail(prefix),
- username: createUniqueUsername(prefix),
- global_name: 'Gate Escape',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- });
- setInjectedRegistrationRiskEvaluator(undefined);
- return {userId: registration.user_id, token: registration.token};
- }
-
- async function addFillerMember(inviteCode: string): Promise<void> {
- const filler = await createTestAccount(harness);
- await createBuilder(harness, filler.token).post(`/invites/${inviteCode}`).expect(200).execute();
- }
-
- async function makeDiscoverable(guildId: string): Promise<void> {
- await createBuilderWithoutAuth(harness)
- .post(`/test/guilds/${guildId}/features`)
- .body({add_features: ['DISCOVERABLE']})
- .execute();
- }
-
- async function setSuspiciousFlags(userId: string, flags: number): Promise<void> {
- await createBuilderWithoutAuth(harness)
- .post(`/test/users/${userId}/security-flags`)
- .body({suspicious_activity_flags: flags})
- .execute();
- }
-
- async function promoteThroughRefusedJoin(subject: EscapeSubject, inviteCode: string): Promise<void> {
- await createBuilder(harness, subject.token).post(`/invites/${inviteCode}`).expect(403).execute();
- }
-
- async function createPromotedSubject(prefix: string): Promise<EscapeSubject> {
- const gate = await createGuildWithInvite(harness);
- await addFillerMember(gate.inviteCode);
- const subject = await registerDeferredUser(prefix);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
- return subject;
- }
-
- function previewEscape(subject: EscapeSubject) {
- return createBuilder<EscapePreviewResponse>(harness, subject.token).get(ESCAPE_PATH).expect(200).execute();
- }
-
- function executeEscape(subject: EscapeSubject) {
- return createBuilder<{required_actions: Array<string> | null}>(harness, subject.token)
- .post(ESCAPE_PATH)
- .body({})
- .expect(200)
- .execute();
- }
-
- function expectEscapeRefused(subject: EscapeSubject) {
- return createBuilder(harness, subject.token)
- .post(ESCAPE_PATH)
- .body({})
- .expect(400, 'PHONE_GATE_ESCAPE_UNAVAILABLE')
- .execute();
- }
-
- it('answers both escape routes for an account every ordinary route refuses', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_reach');
-
- await createBuilder(harness, subject.token)
- .get('/users/@me/guilds')
- .expect(403, 'ACCOUNT_SUSPICIOUS_ACTIVITY')
- .execute();
-
- const preview = await previewEscape(subject);
- expect(preview.available).toBe(true);
- await executeEscape(subject);
- });
-
- it('records the promotion without leaking the bit into the client projection', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_bit');
-
- const flags = await readFlags(subject.userId);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- expect(flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).not.toBe(0);
- expect(flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).not.toBe(0);
-
- const me = await createBuilder<{required_actions: Array<string> | null; suspicious_activity_flags?: number}>(
- harness,
- subject.token,
- )
- .get('/users/@me')
- .expect(200)
- .execute();
- expect(me.required_actions).toEqual(['REQUIRE_VERIFIED_PHONE']);
- expect(me.suspicious_activity_flags).toBeUndefined();
- });
-
- it('unlocks an account that is in no community at all', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_empty');
- expect(await readGuildIds(subject.userId)).toEqual([]);
-
- const preview = await previewEscape(subject);
- expect(preview).toEqual({available: true, guilds: [], owned_guilds: []});
-
- const updated = await executeEscape(subject);
- expect(updated.required_actions ?? []).toEqual([]);
-
- const me = await createBuilder<{required_actions: Array<string> | null}>(harness, subject.token)
- .get('/users/@me')
- .expect(200)
- .execute();
- expect(me.required_actions ?? []).toEqual([]);
- await createBuilder(harness, subject.token).get('/users/@me/guilds').expect(200).execute();
-
- const flags = await readFlags(subject.userId);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- expect(flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).toBe(0);
- expect(flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).not.toBe(0);
- });
-
- it('leaves the qualifying community, unlocks the account and dispatches a single user update', async () => {
- await configurePhoneGate();
- const member = await createGuildWithInvite(harness);
- const subject = await registerDeferredUser('escape_leave');
- await createBuilder(harness, subject.token).post(`/invites/${member.inviteCode}`).expect(200).execute();
- const gate = await createGuildWithInvite(harness);
- await addFillerMember(gate.inviteCode);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
-
- const preview = await previewEscape(subject);
- expect(preview.guilds.map((guild) => guild.id)).toEqual([member.guildId]);
- expect(preview.owned_guilds).toEqual([]);
-
- const dispatchSpy = vi.spyOn(NoopGatewayService.prototype, 'dispatchPresence');
- try {
- const updated = await executeEscape(subject);
- expect(updated.required_actions ?? []).toEqual([]);
- const userUpdates = dispatchSpy.mock.calls.filter(
- ([params]) => params.event === 'USER_UPDATE' && params.userId.toString() === subject.userId,
- );
- expect(userUpdates).toHaveLength(1);
- } finally {
- dispatchSpy.mockRestore();
- }
-
- expect(await readGuildIds(subject.userId)).toEqual([]);
- const flags = await readFlags(subject.userId);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- expect(flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).toBe(0);
- });
-
- it('applies the member threshold strictly, so a community sitting on it is kept', async () => {
- await configurePhoneGate({deferred_phone_gate_member_threshold: 2});
- const onThreshold = await createGuildWithInvite(harness);
- const aboveThreshold = await createGuildWithInvite(harness);
- await addFillerMember(aboveThreshold.inviteCode);
- const subject = await registerDeferredUser('escape_bound');
- await createBuilder(harness, subject.token).post(`/invites/${onThreshold.inviteCode}`).expect(200).execute();
- await createBuilder(harness, subject.token).post(`/invites/${aboveThreshold.inviteCode}`).expect(200).execute();
- const gate = await createGuildWithInvite(harness);
- await addFillerMember(gate.inviteCode);
- await addFillerMember(gate.inviteCode);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
-
- const preview = await previewEscape(subject);
- expect(preview.guilds.map((guild) => guild.id)).toEqual([aboveThreshold.guildId]);
-
- await executeEscape(subject);
- expect(await readGuildIds(subject.userId)).toEqual([onThreshold.guildId]);
- });
-
- it('leaves a discoverable community that sits far below the member threshold', async () => {
- await configurePhoneGate({deferred_phone_gate_member_threshold: 50});
- const discoverable = await createGuildWithInvite(harness);
- const subject = await registerDeferredUser('escape_disc');
- await createBuilder(harness, subject.token).post(`/invites/${discoverable.inviteCode}`).expect(200).execute();
- await makeDiscoverable(discoverable.guildId);
- const gate = await createGuildWithInvite(harness);
- await makeDiscoverable(gate.guildId);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
-
- const preview = await previewEscape(subject);
- expect(preview.guilds.map((guild) => guild.id)).toEqual([discoverable.guildId]);
-
- await executeEscape(subject);
- expect(await readGuildIds(subject.userId)).toEqual([]);
- });
-
- it('keeps a qualifying community the user owns and reports it separately', async () => {
- await configurePhoneGate();
- const member = await createGuildWithInvite(harness);
- const subject = await registerDeferredUser('escape_owned');
- await createBuilder(harness, subject.token).post(`/invites/${member.inviteCode}`).expect(200).execute();
- await createBuilderWithoutAuth(harness)
- .post(`/test/users/${subject.userId}/security-flags`)
- .body({email_verified: true})
- .execute();
- const owned = await createBuilder<GuildResponse>(harness, subject.token)
- .post('/guilds')
- .body({name: `PhoneGateOwned-${Date.now()}`})
- .execute();
- const ownedInvite = await createBuilder<{code: string}>(harness, subject.token)
- .post(`/channels/${owned.system_channel_id}`.concat('/invites'))
- .body({max_uses: 0, max_age: 0, unique: false, temporary: false})
- .execute();
- await addFillerMember(ownedInvite.code);
- const gate = await createGuildWithInvite(harness);
- await addFillerMember(gate.inviteCode);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
-
- const preview = await previewEscape(subject);
- expect(preview.guilds.map((guild) => guild.id)).toEqual([member.guildId]);
- expect(preview.owned_guilds.map((guild) => guild.id)).toEqual([owned.id]);
-
- const updated = await executeEscape(subject);
- expect(updated.required_actions ?? []).toEqual([]);
- expect(await readGuildIds(subject.userId)).toEqual([owned.id]);
- expect((await readFlags(subject.userId)) & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- });
-
- it('leaves what it can when the qualifying set exceeds the per-call limit, and finishes on a second call', async () => {
- await configurePhoneGate();
- const subject = await registerDeferredUser('escape_batch');
- for (let index = 0; index < PHONE_GATE_ESCAPE_MAX_GUILDS + 1; index++) {
- const guild = await createGuildWithInvite(harness);
- await createBuilder(harness, subject.token).post(`/invites/${guild.inviteCode}`).expect(200).execute();
- }
- const gate = await createGuildWithInvite(harness);
- await addFillerMember(gate.inviteCode);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
-
- const preview = await previewEscape(subject);
- expect(preview.guilds).toHaveLength(PHONE_GATE_ESCAPE_MAX_GUILDS + 1);
-
- const afterFirst = await executeEscape(subject);
- expect(afterFirst.required_actions ?? []).toEqual(['REQUIRE_VERIFIED_PHONE']);
- expect(await readGuildIds(subject.userId)).toHaveLength(1);
- const flagsAfterFirst = await readFlags(subject.userId);
- expect(flagsAfterFirst & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- expect(flagsAfterFirst & PHONE_GATE_PROMOTED_FROM_DEFERRAL).not.toBe(0);
-
- const afterSecond = await executeEscape(subject);
- expect(afterSecond.required_actions ?? []).toEqual([]);
- expect(await readGuildIds(subject.userId)).toEqual([]);
- const flags = await readFlags(subject.userId);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- expect(flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).toBe(0);
- });
-
- it('refuses an account whose phone requirement was never deferred', async () => {
- await configurePhoneGate();
- const member = await createGuildWithInvite(harness);
- const account = await createTestAccount(harness);
- await createBuilder(harness, account.token).post(`/invites/${member.inviteCode}`).expect(200).execute();
- await setSuspiciousFlags(account.userId, SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE);
- const subject: EscapeSubject = {userId: account.userId, token: account.token};
-
- const preview = await previewEscape(subject);
- expect(preview).toEqual({available: false, guilds: [], owned_guilds: []});
- await expectEscapeRefused(subject);
- expect(await readGuildIds(subject.userId)).toEqual([member.guildId]);
- expect(await readFlags(subject.userId)).toBe(SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE);
- });
-
- it('refuses while the gate is switched off, leaving flags and memberships untouched', async () => {
- await configurePhoneGate();
- const member = await createGuildWithInvite(harness);
- const subject = await registerDeferredUser('escape_off');
- await createBuilder(harness, subject.token).post(`/invites/${member.inviteCode}`).expect(200).execute();
- const gate = await createGuildWithInvite(harness);
- await addFillerMember(gate.inviteCode);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
- const flagsBefore = await readFlags(subject.userId);
-
- await configurePhoneGate({deferred_phone_gate_enabled: false});
- const preview = await previewEscape(subject);
- expect(preview.available).toBe(false);
- await expectEscapeRefused(subject);
-
- expect(await readFlags(subject.userId)).toBe(flagsBefore);
- expect(await readGuildIds(subject.userId)).toEqual([member.guildId]);
- });
-
- it('refuses in single-community mode and leaves the designated community alone', async () => {
- await configurePhoneGate();
- const member = await createGuildWithInvite(harness);
- const subject = await registerDeferredUser('escape_single');
- await createBuilder(harness, subject.token).post(`/invites/${member.inviteCode}`).expect(200).execute();
- const gate = await createGuildWithInvite(harness);
- await addFillerMember(gate.inviteCode);
- await promoteThroughRefusedJoin(subject, gate.inviteCode);
-
- await configurePhoneGate({single_community_enabled: true, single_community_guild_id: member.guildId});
- const preview = await previewEscape(subject);
- expect(preview.available).toBe(false);
- await expectEscapeRefused(subject);
- expect(await readGuildIds(subject.userId)).toEqual([member.guildId]);
- });
-
- it('refuses an account that is still deferred and has never been locked out', async () => {
- await configurePhoneGate();
- const member = await createGuildWithInvite(harness);
- const subject = await registerDeferredUser('escape_defer');
- await createBuilder(harness, subject.token).post(`/invites/${member.inviteCode}`).expect(200).execute();
- const flagsBefore = await readFlags(subject.userId);
-
- const preview = await previewEscape(subject);
- expect(preview).toEqual({available: false, guilds: [], owned_guilds: []});
- await expectEscapeRefused(subject);
- expect(await readFlags(subject.userId)).toBe(flagsBefore);
- expect(await readGuildIds(subject.userId)).toEqual([member.guildId]);
- });
-
- it('refuses a promoted account that also carries the inbound-SMS tier', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_inbound');
- const promotedFlags = await readFlags(subject.userId);
- await setSuspiciousFlags(
- subject.userId,
- promotedFlags | SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION,
- );
-
- const preview = await previewEscape(subject);
- expect(preview.available).toBe(false);
- await expectEscapeRefused(subject);
- });
-
- it('closes itself after a successful escape', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_twice');
- await executeEscape(subject);
- const flagsAfterFirst = await readFlags(subject.userId);
-
- await expectEscapeRefused(subject);
- expect(await readFlags(subject.userId)).toBe(flagsAfterFirst);
- const preview = await previewEscape(subject);
- expect(preview.available).toBe(false);
- });
-
- it('leaves a remaining email requirement in place', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_email');
- const promotedFlags = await readFlags(subject.userId);
- await setSuspiciousFlags(subject.userId, promotedFlags | SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL);
-
- const updated = await executeEscape(subject);
- expect(updated.required_actions ?? []).toEqual(['REQUIRE_VERIFIED_EMAIL']);
- const me = await createBuilder<{required_actions: Array<string> | null}>(harness, subject.token)
- .get('/users/@me')
- .expect(200)
- .execute();
- expect(me.required_actions ?? []).toEqual(['REQUIRE_VERIFIED_EMAIL']);
- });
-
- it('restores the deferral, so a qualifying join re-promotes inside the window and not outside it', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_rearm');
- await executeEscape(subject);
-
- const insideWindow = await createGuildWithInvite(harness);
- await addFillerMember(insideWindow.inviteCode);
- await promoteThroughRefusedJoin(subject, insideWindow.inviteCode);
- const repromoted = await readFlags(subject.userId);
- expect(repromoted & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- expect(repromoted & PHONE_GATE_PROMOTED_FROM_DEFERRAL).not.toBe(0);
-
- await executeEscape(subject);
- await configurePhoneGate({deferred_phone_gate_window_hours: 0.0001});
- const outsideWindow = await createGuildWithInvite(harness);
- await addFillerMember(outsideWindow.inviteCode);
- const beforeJoin = await readFlags(subject.userId);
- expect(beforeJoin & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- await createBuilder(harness, subject.token).post(`/invites/${outsideWindow.inviteCode}`).expect(200).execute();
-
- const flags = await readFlags(subject.userId);
- expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- expect(flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).toBe(0);
- });
-
- it('refuses bot tokens and OAuth2 bearer tokens on both routes', async () => {
- await configurePhoneGate();
- const owner = await createTestAccount(harness);
- const redirectURI = 'https://example.com/callback';
- const application = await createOAuth2Application(harness, owner, {redirect_uris: [redirectURI]});
- const {code} = await authorizeOAuth2(harness, owner.token, {
- client_id: application.id,
- redirect_uri: redirectURI,
- scope: 'identify',
- });
- const {access_token: accessToken} = await exchangeOAuth2AuthorizationCode(harness, {
- client_id: application.id,
- client_secret: application.client_secret,
- code,
- redirect_uri: redirectURI,
- });
-
- for (const token of [`Bot ${application.bot.token}`, `Bearer ${accessToken}`]) {
- await createBuilder(harness, token).get(ESCAPE_PATH).expect(403).execute();
- await createBuilder(harness, token).post(ESCAPE_PATH).body({}).expect(403).execute();
- }
- });
-
- it('spends the execute budget only on execute calls', async () => {
- await configurePhoneGate();
- const subject = await createPromotedSubject('escape_limit');
- for (let index = 0; index < 3; index++) {
- await createBuilder(harness, subject.token)
- .get(ESCAPE_PATH)
- .header(RATE_LIMIT_HEADER, 'true')
- .expect(200)
- .execute();
- }
- for (let index = 0; index < 5; index++) {
- const {response} = await createBuilder(harness, subject.token)
- .post(ESCAPE_PATH)
- .body({})
- .header(RATE_LIMIT_HEADER, 'true')
- .executeRaw();
- expect(response.status).toBe(index === 0 ? 200 : 400);
- }
- const {response} = await createBuilder(harness, subject.token)
- .post(ESCAPE_PATH)
- .body({})
- .header(RATE_LIMIT_HEADER, 'true')
- .executeRaw();
- expect(response.status).toBe(429);
- });
- });
-});
diff --git a/fluxer_api/src/api/auth/tests/EmailBlocklistEnforcement.test.ts b/fluxer_api/src/api/auth/tests/EmailBlocklistEnforcement.test.ts
new file mode 100644
index 000000000..7cb96d767
--- /dev/null
+++ b/fluxer_api/src/api/auth/tests/EmailBlocklistEnforcement.test.ts
@@ -0,0 +1,128 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {
+ clearTestEmails,
+ createAuthHarness,
+ createTestAccount,
+ createUniqueEmail,
+ createUniqueUsername,
+ findLastTestEmail,
+ listTestEmails,
+ setUserACLs,
+ type TestAccount,
+ unclaimAccount,
+} from '@app/api/auth/tests/AuthTestUtils';
+import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {HTTP_STATUS, TEST_CREDENTIALS, TEST_USER_DATA} from '@app/api/test/TestConstants';
+import {createBuilder} from '@app/api/test/TestRequestBuilder';
+import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
+
+interface ValidationErrorBody {
+ code: string;
+ errors: Array<{path: string; code: string}>;
+}
+
+interface EmailChangeStartResponse {
+ ticket: string;
+ original_proof?: string;
+}
+
+describe('Email blocklist at signup and email change', () => {
+ let harness: ApiTestHarness;
+ let admin: TestAccount;
+ beforeAll(async () => {
+ harness = await createAuthHarness();
+ });
+ beforeEach(async () => {
+ await harness.reset();
+ await clearTestEmails(harness);
+ admin = await setUserACLs(harness, await createTestAccount(harness), ['admin:authenticate', 'ban:email:add']);
+ });
+ afterAll(async () => {
+ await harness?.shutdown();
+ });
+
+ async function blocklist(email: string): Promise<void> {
+ await createBuilder(harness, admin.token)
+ .post('/admin/blocklists/email/entries')
+ .body({email})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ }
+
+ function expectGenericEmailError(json: ValidationErrorBody, path: string): void {
+ expect(json.errors.map((entry) => ({path: entry.path, code: entry.code}))).toEqual([
+ {path, code: 'INVALID_EMAIL_ADDRESS'},
+ ]);
+ }
+
+ it('refuses registration with a blocklisted address in any letter case', async () => {
+ const email = createUniqueEmail('blocked-signup');
+ await blocklist(email);
+ const {json} = await createBuilder<ValidationErrorBody>(harness, '')
+ .post('/auth/register')
+ .body({
+ email: email.toUpperCase(),
+ username: createUniqueUsername('blocked'),
+ global_name: TEST_USER_DATA.DEFAULT_GLOBAL_NAME,
+ password: TEST_CREDENTIALS.STRONG_PASSWORD,
+ date_of_birth: TEST_USER_DATA.DEFAULT_DATE_OF_BIRTH,
+ consent: true,
+ })
+ .expect(HTTP_STATUS.BAD_REQUEST, 'INVALID_FORM_BODY')
+ .executeWithResponse();
+ expectGenericEmailError(json, 'email');
+ });
+
+ it('still registers an address that is not blocklisted', async () => {
+ await blocklist(createUniqueEmail('blocked-other'));
+ await createTestAccount(harness);
+ });
+
+ it('refuses an email change to a blocklisted address before sending a code', async () => {
+ const account = await createTestAccount(harness);
+ const blocked = createUniqueEmail('blocked-change');
+ await blocklist(blocked);
+ const start = await createBuilder<EmailChangeStartResponse>(harness, account.token)
+ .post('/users/@me/email-change/start')
+ .body({password: account.password})
+ .execute();
+ const originalCode = findLastTestEmail(
+ await listTestEmails(harness, {recipient: account.email}),
+ 'email_change_original',
+ )!.metadata.code!;
+ const {original_proof: originalProof} = await createBuilder<{original_proof: string}>(harness, account.token)
+ .post('/users/@me/email-change/verify-original')
+ .body({ticket: start.ticket, code: originalCode, password: account.password})
+ .execute();
+ const {json} = await createBuilder<ValidationErrorBody>(harness, account.token)
+ .post('/users/@me/email-change/request-new')
+ .body({
+ ticket: start.ticket,
+ new_email: blocked,
+ original_proof: originalProof,
+ password: account.password,
+ })
+ .expect(HTTP_STATUS.BAD_REQUEST, 'INVALID_FORM_BODY')
+ .executeWithResponse();
+ expectGenericEmailError(json, 'new_email');
+ expect(await listTestEmails(harness, {recipient: blocked})).toHaveLength(0);
+ });
+
+ it('refuses claiming an unclaimed account with a blocklisted address', async () => {
+ const account = await createTestAccount(harness);
+ await unclaimAccount(harness, account.userId);
+ const blocked = createUniqueEmail('blocked-claim');
+ await blocklist(blocked);
+ const start = await createBuilder<EmailChangeStartResponse>(harness, account.token)
+ .post('/users/@me/email-change/start')
+ .body({})
+ .execute();
+ const {json} = await createBuilder<ValidationErrorBody>(harness, account.token)
+ .post('/users/@me/email-change/request-new')
+ .body({ticket: start.ticket, new_email: blocked, original_proof: start.original_proof})
+ .expect(HTTP_STATUS.BAD_REQUEST, 'INVALID_FORM_BODY')
+ .executeWithResponse();
+ expectGenericEmailError(json, 'new_email');
+ });
+});
diff --git a/fluxer_api/src/api/auth/tests/EmailChangeFlow.test.ts b/fluxer_api/src/api/auth/tests/EmailChangeFlow.test.ts
index b192541c1..2166d2799 100644
--- a/fluxer_api/src/api/auth/tests/EmailChangeFlow.test.ts
+++ b/fluxer_api/src/api/auth/tests/EmailChangeFlow.test.ts
@@ -11,8 +11,6 @@ import {
loginUser,
type TestAccount,
} from '@app/api/auth/tests/AuthTestUtils';
-import {setInjectedRegistrationRiskEvaluator} from '@app/api/middleware/ServiceMiddleware';
-import {RecommendedAction, RiskConfidence, RiskDecisionMethod, RiskLevel} from '@app/api/risk/RiskTypes';
import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
@@ -124,31 +122,6 @@ async function unclaimAccount(harness: ApiTestHarness, userId: string): Promise<
await createBuilderWithoutAuth(harness).post(`/test/users/${userId}/unclaim`).body(null).expect(200).execute();
}
-function createForcedRiskEvaluator(onEvaluate?: () => void) {
- return {
- async evaluate() {
- onEvaluate?.();
- return {
- assessment: {
- suspicious: true,
- level: RiskLevel.High,
- confidence: RiskConfidence.High,
- riskScore: 70,
- reasoning: 'forced test risk result',
- recommendedAction: RecommendedAction.RequireOutboundPhone,
- method: RiskDecisionMethod.Deterministic,
- modelUsed: 'test',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- },
- level: RiskLevel.High,
- recommendedAction: RecommendedAction.RequireOutboundPhone,
- };
- },
- };
-}
-
describe('Email change flow', () => {
let harness: ApiTestHarness;
beforeAll(async () => {
@@ -485,58 +458,8 @@ describe('Email change flow', () => {
expect(updated.required_actions).not.toContain('REQUIRE_REVERIFIED_EMAIL');
expect(updated.required_actions).not.toContain('REQUIRE_VERIFIED_PHONE');
});
- it('re-evaluates plus-tagged email changes on claimed accounts', async () => {
+ it('applies ordinary claimed email changes', async () => {
const account = await createTestAccount(harness);
- let evaluateCalls = 0;
- setInjectedRegistrationRiskEvaluator(
- createForcedRiskEvaluator(() => {
- evaluateCalls += 1;
- }),
- );
- const startResp = await startEmailChange(harness, account, account.password);
- const emails = await listTestEmails(harness, {recipient: account.email});
- const originalEmail = findLastTestEmail(emails, 'email_change_original');
- expect(startResp.require_original).toBe(true);
- expect(originalEmail?.metadata?.code).toBeDefined();
- const originalProof = await verifyOriginalEmailChange(
- harness,
- account,
- startResp.ticket,
- originalEmail!.metadata!.code!,
- account.password,
- );
- const newEmail = `integration-plus+${Date.now()}@example.com`;
- await requestNewEmailChange(harness, account, startResp.ticket, newEmail, originalProof, account.password);
- const newEmails = await listTestEmails(harness, {recipient: newEmail});
- const newEmailData = findLastTestEmail(newEmails, 'email_change_new');
- expect(newEmailData?.metadata?.code).toBeDefined();
- const token = await verifyNewEmailChange(
- harness,
- account,
- startResp.ticket,
- newEmailData!.metadata!.code!,
- originalProof,
- account.password,
- );
- const updated = await createBuilder<UserPrivateResponse>(harness, account.token)
- .patch('/users/@me')
- .body({
- email_token: token,
- password: account.password,
- })
- .expect(200)
- .execute();
- expect(evaluateCalls).toBe(1);
- expect(updated.required_actions).toContain('REQUIRE_VERIFIED_PHONE');
- });
- it('does not re-evaluate ordinary claimed email changes', async () => {
- const account = await createTestAccount(harness);
- let evaluateCalls = 0;
- setInjectedRegistrationRiskEvaluator(
- createForcedRiskEvaluator(() => {
- evaluateCalls += 1;
- }),
- );
const startResp = await startEmailChange(harness, account, account.password);
const emails = await listTestEmails(harness, {recipient: account.email});
const originalEmail = findLastTestEmail(emails, 'email_change_original');
@@ -570,7 +493,6 @@ describe('Email change flow', () => {
})
.expect(200)
.execute();
- expect(evaluateCalls).toBe(0);
expect(updated.required_actions ?? []).not.toContain('REQUIRE_VERIFIED_PHONE');
});
it('requires MFA (not password) for email_token apply when user has TOTP enabled', async () => {
@@ -796,15 +718,9 @@ describe('Email change flow', () => {
.execute();
expect(updated.email).toBe(newEmail);
});
- it('does not re-evaluate clean unclaimed accounts when they are claimed', async () => {
+ it('claims clean unclaimed accounts', async () => {
const account = await createTestAccount(harness);
await unclaimAccount(harness, account.userId);
- let evaluateCalls = 0;
- setInjectedRegistrationRiskEvaluator(
- createForcedRiskEvaluator(() => {
- evaluateCalls += 1;
- }),
- );
const startResp = await createBuilder<EmailChangeStartResponse>(harness, account.token)
.post('/users/@me/email-change/start')
.body({})
@@ -833,7 +749,6 @@ describe('Email change flow', () => {
})
.expect(200)
.execute();
- expect(evaluateCalls).toBe(0);
expect(updated.email).toBe(newEmail);
expect(updated.verified).toBe(true);
expect(updated.required_actions).not.toContain('REQUIRE_VERIFIED_PHONE');
diff --git a/fluxer_api/src/api/auth/tests/InboundChallengeUnconfigured.test.ts b/fluxer_api/src/api/auth/tests/InboundChallengeUnconfigured.test.ts
deleted file mode 100644
index 01045ed34..000000000
--- a/fluxer_api/src/api/auth/tests/InboundChallengeUnconfigured.test.ts
+++ /dev/null
@@ -1,55 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createAuthHarness, createTestAccount} from '@app/api/auth/tests/AuthTestUtils';
-import {getConfig} from '@app/api/Config';
-import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
-import {createBuilder} from '@app/api/test/TestRequestBuilder';
-import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
-
-describe('Inbound SMS challenge without a receiving number', () => {
- let harness: ApiTestHarness;
- beforeAll(async () => {
- harness = await createAuthHarness();
- });
- beforeEach(async () => {
- await harness.reset();
- });
- afterAll(async () => {
- await harness?.shutdown();
- });
- it('rejects the challenge with SMS_VERIFICATION_UNAVAILABLE when no number is configured', async () => {
- const account = await createTestAccount(harness);
- const config = getConfig();
- const previousInboundNumber = config.sms.inboundChallengeNumber;
- config.sms.inboundChallengeNumber = undefined;
- try {
- const {response, json} = await createBuilder(harness, account.token)
- .post('/users/@me/phone/inbound-challenge')
- .executeRaw();
- expect(response.status).toBe(400);
- expect(json).toMatchObject({code: 'SMS_VERIFICATION_UNAVAILABLE'});
- } finally {
- config.sms.inboundChallengeNumber = previousInboundNumber;
- }
- });
- it('issues the challenge once a receiving number is configured', async () => {
- const account = await createTestAccount(harness);
- const config = getConfig();
- const previousInboundNumber = config.sms.inboundChallengeNumber;
- config.sms.inboundChallengeNumber = '+15551234567';
- try {
- const response = await createBuilder<{
- challenge_code: string;
- our_number: string;
- expires_at: string;
- }>(harness, account.token)
- .post('/users/@me/phone/inbound-challenge')
- .expect(200)
- .execute();
- expect(response.our_number).toBe('+15551234567');
- expect(response.challenge_code).toMatch(/^\d{6}$/);
- } finally {
- config.sms.inboundChallengeNumber = previousInboundNumber;
- }
- });
-});
diff --git a/fluxer_api/src/api/auth/tests/PhoneVerificationClient.test.ts b/fluxer_api/src/api/auth/tests/PhoneVerificationClient.test.ts
new file mode 100644
index 000000000..63e4acdc3
--- /dev/null
+++ b/fluxer_api/src/api/auth/tests/PhoneVerificationClient.test.ts
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createHash} from 'node:crypto';
+import {
+ errorForPhoneReply,
+ natsPhoneRpcTransport,
+ type PhoneRpcTransport,
+ PhoneRpcUnreachableError,
+ PhoneVerificationClient,
+ phoneIdempotencyKey,
+ renderPhoneRpcMetrics,
+} from '@app/api/auth/PhoneVerificationClient';
+import {HEADER, RPC_PHONE_CHECK, RPC_PHONE_START} from '@app/api/infrastructure/activity/Contract.generated';
+import {APIErrorCodes} from '@fluxer/constants/src/ApiErrorCodes';
+import {PhoneAlreadyUsedError} from '@fluxer/errors/src/domains/auth/PhoneAlreadyUsedError';
+import {SmsVerificationUnavailableError} from '@fluxer/errors/src/domains/auth/SmsVerificationUnavailableError';
+import {RateLimitError} from '@fluxer/errors/src/domains/core/RateLimitError';
+import {connect, type NatsConnection} from '@nats-io/transport-node';
+import {afterAll, beforeAll, describe, expect, it} from 'vitest';
+
+interface RecordedRequest {
+ subject: string;
+ payload: Record<string, unknown>;
+ timeoutMs: number;
+ headers: Record<string, string>;
+}
+
+class ScriptedTransport implements PhoneRpcTransport {
+ readonly requests: Array<RecordedRequest> = [];
+ constructor(private readonly script: Array<string | Error>) {}
+
+ async request(subject: string, payload: string, options: {timeoutMs: number; headers: Record<string, string>}) {
+ this.requests.push({subject, payload: JSON.parse(payload), timeoutMs: options.timeoutMs, headers: options.headers});
+ const next = this.script.shift();
+ if (next === undefined) throw new Error('no scripted reply');
+ if (next instanceof Error) throw next;
+ return next;
+ }
+}
+
+const INFO = {userId: '1174109840998400001', phone: '+15555550123', requestId: 'req-1'};
+const START = {
+ user_id: INFO.userId,
+ user_flags: '0',
+ has_verified_phone: false,
+ phone: INFO.phone,
+ requested_channel: null,
+ client_ip: '203.0.113.9',
+ captcha_passed: false,
+};
+
+describe('phone verification client', () => {
+ it('sends an absolute deadline, a stable idempotency key and the request id', async () => {
+ let now = 1_000_000;
+ const transport = new ScriptedTransport([JSON.stringify({result: 'sms_sent'})]);
+ const client = new PhoneVerificationClient(
+ transport,
+ () => now,
+ () => 'nonce-1',
+ );
+ const reply = await client.start(START, INFO);
+ expect(reply).toEqual({result: 'sms_sent'});
+ const [request] = transport.requests;
+ expect(request.subject).toBe(RPC_PHONE_START);
+ expect(request.payload).toEqual({v: 1, ...START});
+ expect(request.headers[HEADER.deadline]).toBe(String(now + 12_000));
+ expect(request.headers[HEADER.requestId]).toBe('req-1');
+ expect(request.headers[HEADER.idempotencyKey]).toBe(
+ createHash('sha256').update(`start\n${INFO.userId}\n${INFO.phone}\nnonce-1`).digest('base64url'),
+ );
+ expect(request.timeoutMs).toBe(12_250);
+ now += 1;
+ expect(phoneIdempotencyKey('check', INFO, 'n')).not.toBe(phoneIdempotencyKey('start', INFO, 'n'));
+ });
+
+ it('never derives the idempotency key from the client request id', async () => {
+ const transport = new ScriptedTransport([
+ JSON.stringify({result: 'sms_sent'}),
+ JSON.stringify({result: 'sms_sent'}),
+ ]);
+ const client = new PhoneVerificationClient(transport);
+ await client.start(START, INFO);
+ await client.start(START, INFO);
+ const [first, second] = transport.requests;
+ expect(first.headers[HEADER.requestId]).toBe(second.headers[HEADER.requestId]);
+ expect(first.headers[HEADER.idempotencyKey]).not.toBe(second.headers[HEADER.idempotencyKey]);
+ });
+
+ it('counts error replies by their code so unavailable is alertable', async () => {
+ const transport = new ScriptedTransport([JSON.stringify({result: 'error', code: 'unavailable'})]);
+ await new PhoneVerificationClient(transport).start(START, INFO);
+ expect(renderPhoneRpcMetrics()).toContain('fluxer_api_phone_rpc_total{op="start",result="unavailable"}');
+ });
+
+ it('retries once with the same key when the service did not answer and enough time remains', async () => {
+ let now = 0;
+ const transport = new ScriptedTransport([
+ new PhoneRpcUnreachableError('no_responders'),
+ JSON.stringify({result: 'sms_sent'}),
+ ]);
+ const client = new PhoneVerificationClient(transport, () => now);
+ const pending = client.start(START, INFO);
+ now = 1_000;
+ expect(await pending).toEqual({result: 'sms_sent'});
+ expect(transport.requests).toHaveLength(2);
+ expect(transport.requests[1].headers[HEADER.idempotencyKey]).toBe(
+ transport.requests[0].headers[HEADER.idempotencyKey],
+ );
+ expect(transport.requests[1].headers[HEADER.deadline]).toBe(transport.requests[0].headers[HEADER.deadline]);
+ });
+
+ it('gives up without a retry when too little of the deadline is left', async () => {
+ let now = 0;
+ const transport: PhoneRpcTransport = {
+ request: async () => {
+ now = 9_000;
+ throw new PhoneRpcUnreachableError('timeout');
+ },
+ };
+ const client = new PhoneVerificationClient(transport, () => now);
+ await expect(
+ client.check({user_id: INFO.userId, user_flags: '0', phone: INFO.phone, code: '123456', client_ip: ''}, INFO),
+ ).rejects.toBeInstanceOf(SmsVerificationUnavailableError);
+ });
+
+ it('answers unavailable when the service is not configured or replies with garbage', async () => {
+ await expect(new PhoneVerificationClient(null).start(START, INFO)).rejects.toBeInstanceOf(
+ SmsVerificationUnavailableError,
+ );
+ const garbled = new PhoneVerificationClient(new ScriptedTransport(['{"nope":1}']));
+ await expect(garbled.start(START, INFO)).rejects.toBeInstanceOf(SmsVerificationUnavailableError);
+ });
+
+ it('maps service errors to the existing client errors', () => {
+ const limited = errorForPhoneReply({
+ code: 'rate_limited',
+ retry_after_s: 600,
+ rate_limit_scope: 'shared',
+ limit: 3,
+ message: 'Too many verification texts were sent recently. Try again later.',
+ });
+ expect(limited).toBeInstanceOf(RateLimitError);
+ expect((limited as RateLimitError).code).toBe(APIErrorCodes.PHONE_RATE_LIMIT_EXCEEDED);
+ const blank = {retry_after_s: null, rate_limit_scope: null, limit: null, message: null};
+ expect(errorForPhoneReply({code: 'already_used', ...blank})).toBeInstanceOf(PhoneAlreadyUsedError);
+ for (const code of ['unavailable', 'deadline_exceeded', 'unsupported_contract'] as const) {
+ expect(errorForPhoneReply({code, ...blank})).toBeInstanceOf(SmsVerificationUnavailableError);
+ }
+ });
+});
+
+const NATS_URL = process.env.FLUXER_TEST_ACTIVITY_NATS_URL;
+
+describe.skipIf(!NATS_URL)('phone verification client over NATS', () => {
+ let nc: NatsConnection;
+ const seen: Array<{subject: string; headers: Record<string, string>}> = [];
+ beforeAll(async () => {
+ nc = await connect({servers: NATS_URL, token: process.env.FLUXER_TEST_ACTIVITY_NATS_TOKEN});
+ nc.subscribe('rpc.phone.v1.*', {
+ queue: 'phone',
+ callback: (_error, msg) => {
+ const headers: Record<string, string> = {};
+ for (const key of msg.headers?.keys() ?? []) headers[key] = msg.headers!.get(key);
+ seen.push({subject: msg.subject, headers});
+ msg.respond(
+ JSON.stringify({
+ result: 'verified',
+ action: {
+ v: 1,
+ id: 'phone:k',
+ key: INFO.userId,
+ issued_at_ms: 1,
+ expires_at_ms: 2,
+ type: 'phone_verified',
+ user_id: INFO.userId,
+ method: 'outbound',
+ clear_suspicious: 4,
+ },
+ }),
+ );
+ },
+ });
+ await nc.flush();
+ });
+ afterAll(async () => {
+ await nc?.close();
+ });
+
+ it('carries the headers to the responder and returns its reply', async () => {
+ const client = new PhoneVerificationClient(natsPhoneRpcTransport(() => nc));
+ const reply = await client.check(
+ {user_id: INFO.userId, user_flags: '0', phone: INFO.phone, code: '123456', client_ip: '203.0.113.9'},
+ INFO,
+ );
+ expect(reply.result).toBe('verified');
+ expect(seen.at(-1)?.subject).toBe(RPC_PHONE_CHECK);
+ expect(seen.at(-1)?.headers[HEADER.requestId]).toBe('req-1');
+ expect(Number(seen.at(-1)?.headers[HEADER.deadline])).toBeGreaterThan(Date.now());
+ });
+
+ it('reports a subject nobody serves as unreachable', async () => {
+ const other = await connect({servers: NATS_URL, token: process.env.FLUXER_TEST_ACTIVITY_NATS_TOKEN});
+ try {
+ const transport = natsPhoneRpcTransport(() => other);
+ await expect(transport.request('rpc.phone.v9.start', '{}', {timeoutMs: 1000, headers: {}})).rejects.toMatchObject(
+ {reason: 'no_responders'},
+ );
+ } finally {
+ await other.close();
+ }
+ });
+});
diff --git a/fluxer_api/src/api/auth/tests/PhoneVerificationFlow.test.ts b/fluxer_api/src/api/auth/tests/PhoneVerificationFlow.test.ts
deleted file mode 100644
index 550a6219d..000000000
--- a/fluxer_api/src/api/auth/tests/PhoneVerificationFlow.test.ts
+++ /dev/null
@@ -1,244 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createAuthHarness, createTestAccount, createTotpSecret, totpCodeNow} from '@app/api/auth/tests/AuthTestUtils';
-import {getConfig} from '@app/api/Config';
-import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
-import {createBuilder} from '@app/api/test/TestRequestBuilder';
-import {PublicUserFlags, SuspiciousActivityFlags, UserFlags} from '@fluxer/constants/src/UserConstants';
-import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
-
-describe('Phone verification flow', () => {
- let harness: ApiTestHarness;
- beforeAll(async () => {
- harness = await createAuthHarness();
- });
- beforeEach(async () => {
- await harness.reset();
- });
- afterAll(async () => {
- await harness?.shutdown();
- });
- async function allowPhoneVerification(userId: string): Promise<void> {
- await createBuilder(harness, '')
- .post(`/test/users/${userId}/security-flags`)
- .body({
- email_verified: true,
- suspicious_activity_flags: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE,
- })
- .expect(200)
- .execute();
- }
- it('completes full phone verification flow', async () => {
- const account = await createTestAccount(harness);
- await createBuilder(harness, '')
- .patch(`/test/users/${account.userId}/flags`)
- .body({flags: (UserFlags.SPAMMER | UserFlags.HAS_SESSION_STARTED).toString()})
- .expect(200)
- .execute();
- const totpSecret = createTotpSecret();
- const totpCode = totpCodeNow(totpSecret);
- await createBuilder(harness, account.token)
- .post('/users/@me/mfa/totp/enable')
- .body({
- secret: totpSecret,
- code: totpCode,
- password: account.password,
- })
- .execute();
- await allowPhoneVerification(account.userId);
- const phone = `+1555${String(Date.now()).slice(-7)}`;
- await createBuilder(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({
- phone,
- })
- .expect(200)
- .execute();
- const verifyPhoneJson = await createBuilder<{
- verified: true;
- }>(harness, account.token)
- .post('/users/@me/phone/verify')
- .body({
- phone,
- code: '123456',
- })
- .execute();
- expect(verifyPhoneJson).toEqual({verified: true});
- const meJson = await createBuilder<{
- flags: number;
- phone: string | null;
- has_verified_phone: boolean;
- }>(harness, account.token)
- .get('/users/@me')
- .execute();
- expect(meJson.phone).toBeNull();
- expect(meJson.has_verified_phone).toBe(true);
- expect(meJson.flags & PublicUserFlags.SPAMMER).toBe(0);
- });
- it('allows a second account to verify the same phone during the encrypted marker window', async () => {
- const phone = `+1555${String(Date.now()).slice(-7)}`;
- async function verifyPhone(account: {token: string}): Promise<void> {
- await createBuilder(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({phone})
- .expect(200)
- .execute();
- const response = await createBuilder<{
- verified: true;
- }>(harness, account.token)
- .post('/users/@me/phone/verify')
- .body({phone, code: '123456'})
- .execute();
- expect(response).toEqual({verified: true});
- }
- async function hasVerifiedPhone(token: string): Promise<boolean> {
- const me = await createBuilder<{
- has_verified_phone: boolean;
- }>(harness, token)
- .get('/users/@me')
- .execute();
- return me.has_verified_phone;
- }
- const first = await createTestAccount(harness);
- const second = await createTestAccount(harness);
- await allowPhoneVerification(first.userId);
- await allowPhoneVerification(second.userId);
- await verifyPhone(first);
- expect(await hasVerifiedPhone(first.token)).toBe(true);
- await verifyPhone(second);
- expect(await hasVerifiedPhone(first.token)).toBe(true);
- expect(await hasVerifiedPhone(second.token)).toBe(true);
- });
- it('rejects a third account from reusing the same phone number during the encrypted marker window', async () => {
- const phone = `+1555${String(Date.now()).slice(-7)}`;
- async function verifyPhone(account: {token: string}): Promise<void> {
- await createBuilder(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({phone})
- .expect(200)
- .execute();
- const response = await createBuilder<{
- verified: true;
- }>(harness, account.token)
- .post('/users/@me/phone/verify')
- .body({phone, code: '123456'})
- .execute();
- expect(response).toEqual({verified: true});
- }
- const first = await createTestAccount(harness);
- const second = await createTestAccount(harness);
- const third = await createTestAccount(harness);
- await allowPhoneVerification(first.userId);
- await allowPhoneVerification(second.userId);
- await allowPhoneVerification(third.userId);
- await verifyPhone(first);
- await verifyPhone(second);
- await createBuilder(harness, third.token)
- .post('/users/@me/phone/send-verification')
- .body({phone})
- .expect(400, 'PHONE_ALREADY_USED')
- .execute();
- });
- it('limits each account to 3 phone verification SMS sends across any numbers per 6 hours', async () => {
- const account = await createTestAccount(harness);
- await allowPhoneVerification(account.userId);
- const phones = Array.from({length: 4}, (_, idx) => `+1555${String(1000000 + idx).padStart(7, '0')}`);
- for (const phone of phones.slice(0, 3)) {
- await createBuilder(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({phone})
- .expect(200)
- .execute();
- }
- const {response, json} = await createBuilder(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({phone: phones[3]})
- .executeRaw();
- expect(response.status).toBe(429);
- expect(json).toMatchObject({code: 'PHONE_RATE_LIMIT_EXCEEDED'});
- });
- it('limits a specific phone number to 3 SMS sends per 5 days across all accounts', async () => {
- const phone = '+15551234567';
- const accounts = await Promise.all([
- createTestAccount(harness),
- createTestAccount(harness),
- createTestAccount(harness),
- createTestAccount(harness),
- ]);
- for (const account of accounts) {
- await allowPhoneVerification(account.userId);
- }
- for (const account of accounts.slice(0, 3)) {
- await createBuilder(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({phone})
- .expect(200)
- .execute();
- }
- const {response, json} = await createBuilder(harness, accounts[3].token)
- .post('/users/@me/phone/send-verification')
- .body({phone})
- .executeRaw();
- expect(response.status).toBe(429);
- expect(json).toMatchObject({code: 'PHONE_RATE_LIMIT_EXCEEDED'});
- });
- it('requires an inbound challenge for expensive outbound SMS prefixes', async () => {
- const account = await createTestAccount(harness);
- await allowPhoneVerification(account.userId);
- const config = getConfig();
- const previousInboundNumber = config.sms.inboundChallengeNumber;
- const previousInboundPrefixes = config.abusePolicy.phoneVerification.inboundRequiredPrefixes;
- config.sms.inboundChallengeNumber = '+15551234567';
- config.abusePolicy.phoneVerification.inboundRequiredPrefixes = ['+998'];
- try {
- const response = await createBuilder<{
- channel: string;
- challenge_code: string;
- our_number: string;
- reason: string;
- }>(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({phone: '+998991234567'})
- .expect(200)
- .execute();
- expect(response).toMatchObject({
- channel: 'inbound_challenge',
- our_number: '+15551234567',
- reason: 'expensive_destination',
- });
- expect(response.challenge_code).toMatch(/^\d{6}$/);
- } finally {
- config.sms.inboundChallengeNumber = previousInboundNumber;
- config.abusePolicy.phoneVerification.inboundRequiredPrefixes = previousInboundPrefixes;
- }
- });
- it('does not let clients force SMS for inbound-only prefixes', async () => {
- const account = await createTestAccount(harness);
- await allowPhoneVerification(account.userId);
- const config = getConfig();
- const previousInboundNumber = config.sms.inboundChallengeNumber;
- const previousInboundPrefixes = config.abusePolicy.phoneVerification.inboundRequiredPrefixes;
- config.sms.inboundChallengeNumber = '+15551234567';
- config.abusePolicy.phoneVerification.inboundRequiredPrefixes = ['+593'];
- try {
- const response = await createBuilder<{
- channel: string;
- challenge_code: string;
- our_number: string;
- reason: string;
- }>(harness, account.token)
- .post('/users/@me/phone/send-verification')
- .body({phone: '+593991234567', channel: 'sms'})
- .expect(200)
- .execute();
- expect(response).toMatchObject({
- channel: 'inbound_challenge',
- our_number: '+15551234567',
- reason: 'expensive_destination',
- });
- } finally {
- config.sms.inboundChallengeNumber = previousInboundNumber;
- config.abusePolicy.phoneVerification.inboundRequiredPrefixes = previousInboundPrefixes;
- }
- });
-});
diff --git a/fluxer_api/src/api/auth/tests/Registration.test.ts b/fluxer_api/src/api/auth/tests/Registration.test.ts
index 220bc16ea..9fcb9c6f5 100644
--- a/fluxer_api/src/api/auth/tests/Registration.test.ts
+++ b/fluxer_api/src/api/auth/tests/Registration.test.ts
@@ -13,8 +13,8 @@ import {
} from '@app/api/auth/tests/AuthTestUtils';
import {createUserID} from '@app/api/BrandedTypes';
import {getConfig} from '@app/api/Config';
+import {applySharedListUpdate, resetSharedListsForTests} from '@app/api/infrastructure/activity/SharedLists';
import {getInstanceConfigRepository, getUserRepository} from '@app/api/middleware/ServiceSingletons';
-import {torExitListCache} from '@app/api/middleware/TorExitListCache';
import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
import {AdminACLs} from '@fluxer/constants/src/AdminACLs';
@@ -298,15 +298,15 @@ describe('Auth registration', () => {
expect(login.token.length).toBeGreaterThan(0);
expect(login.user_id).toBe(reg.user_id);
});
- it('blocks any request from a Tor exit at the edge', async () => {
- torExitListCache.seedForTesting(['127.0.0.1']);
+ it('blocks any request from an address on the shared blocked list', async () => {
+ applySharedListUpdate('ip_blocked', '127.0.0.1\n');
try {
await createBuilderWithoutAuth(harness)
.post('/auth/register')
.body({
- email: createUniqueEmail('tor-register'),
- username: createUniqueUsername('torregister'),
- global_name: 'Tor Register',
+ email: createUniqueEmail('blocked-register'),
+ username: createUniqueUsername('blockedregister'),
+ global_name: 'Blocked Register',
password: 'a-strong-password',
date_of_birth: '2000-01-01',
consent: true,
@@ -314,7 +314,7 @@ describe('Auth registration', () => {
.expect(403, 'GLOBAL_IP_BANNED')
.execute();
} finally {
- torExitListCache.clearForTesting();
+ resetSharedListsForTests();
}
});
it('treats email as case-insensitive across auth flows', async () => {
diff --git a/fluxer_api/src/api/auth/tests/RegistrationInviteAutoJoin.test.ts b/fluxer_api/src/api/auth/tests/RegistrationInviteAutoJoin.test.ts
index 7d86c1482..b6ae7bc3b 100644
--- a/fluxer_api/src/api/auth/tests/RegistrationInviteAutoJoin.test.ts
+++ b/fluxer_api/src/api/auth/tests/RegistrationInviteAutoJoin.test.ts
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import type {IRegistrationRiskEvaluator} from '@app/api/auth/services/IRegistrationRiskEvaluator';
import {
createAuthHarness,
createTestAccount,
@@ -9,47 +8,11 @@ import {
loginAccount,
registerUser,
} from '@app/api/auth/tests/AuthTestUtils';
-import {setInjectedRegistrationRiskEvaluator} from '@app/api/middleware/ServiceMiddleware';
-import {
- RecommendedAction,
- RiskConfidence,
- RiskDecisionMethod,
- RiskLevel,
- type RiskLevel as RiskLevelType,
-} from '@app/api/risk/RiskTypes';
import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
import type {GuildResponse} from '@fluxer/schema/src/domains/guild/GuildResponseSchemas';
import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
-function createStaticRiskEvaluator(params: {
- level: RiskLevelType;
- riskScore: number;
- recommendedAction: RecommendedAction;
-}): IRegistrationRiskEvaluator {
- return {
- async evaluate() {
- return {
- level: params.level,
- recommendedAction: params.recommendedAction,
- assessment: {
- suspicious: params.level !== RiskLevel.Low,
- level: params.level,
- confidence: RiskConfidence.High,
- riskScore: params.riskScore,
- reasoning: 'test risk verdict',
- recommendedAction: params.recommendedAction,
- method: RiskDecisionMethod.Noop,
- modelUsed: 'test',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- },
- };
- },
- };
-}
-
async function createGuildInvite(harness: ApiTestHarness): Promise<{
guildId: string;
inviteCode: string;
@@ -87,32 +50,23 @@ async function createGuildInvite(harness: ApiTestHarness): Promise<{
return {guildId: guild.id, inviteCode: invite.code, ownerToken: owner.token};
}
-describe('Auth registration invite auto-join risk gating', () => {
+describe('Auth registration invite auto-join', () => {
let harness: ApiTestHarness;
beforeAll(async () => {
harness = await createAuthHarness();
});
beforeEach(async () => {
- setInjectedRegistrationRiskEvaluator(undefined);
await harness.reset();
});
afterAll(async () => {
- setInjectedRegistrationRiskEvaluator(undefined);
await harness?.shutdown();
});
- it('auto-joins the invite on medium-risk registrations', async () => {
+ it('joins the invite guild on registration', async () => {
const {guildId, inviteCode, ownerToken} = await createGuildInvite(harness);
- setInjectedRegistrationRiskEvaluator(
- createStaticRiskEvaluator({
- level: RiskLevel.Medium,
- riskScore: 40,
- recommendedAction: RecommendedAction.RequireVerifiedEmail,
- }),
- );
const registration = await registerUser(harness, {
- email: createUniqueEmail('invite-medium'),
- username: createUniqueUsername('invite_medium'),
- global_name: 'Invite Medium',
+ email: createUniqueEmail('invite-join'),
+ username: createUniqueUsername('invite_join'),
+ global_name: 'Invite Join',
password: 'StrongPassword!123',
date_of_birth: '2000-01-01',
consent: true,
@@ -124,52 +78,4 @@ describe('Auth registration invite auto-join risk gating', () => {
.executeWithResponse();
expect(memberLookup.response.status).toBe(200);
});
- it('auto-joins the invite on high-risk registrations', async () => {
- const {guildId, inviteCode, ownerToken} = await createGuildInvite(harness);
- setInjectedRegistrationRiskEvaluator(
- createStaticRiskEvaluator({
- level: RiskLevel.High,
- riskScore: 70,
- recommendedAction: RecommendedAction.RequireOutboundPhone,
- }),
- );
- const registration = await registerUser(harness, {
- email: createUniqueEmail('invite-high'),
- username: createUniqueUsername('invite_high'),
- global_name: 'Invite High',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- invite_code: inviteCode,
- });
- const memberLookup = await createBuilder(harness, ownerToken)
- .get(`/guilds/${guildId}/members/${registration.user_id}`)
- .expect(200)
- .executeWithResponse();
- expect(memberLookup.response.status).toBe(200);
- });
- it('does not auto-join the invite on very-high-risk registrations', async () => {
- const {guildId, inviteCode, ownerToken} = await createGuildInvite(harness);
- setInjectedRegistrationRiskEvaluator(
- createStaticRiskEvaluator({
- level: RiskLevel.VeryHigh,
- riskScore: 90,
- recommendedAction: RecommendedAction.RequireInboundPhone,
- }),
- );
- const registration = await registerUser(harness, {
- email: createUniqueEmail('invite-veryhigh'),
- username: createUniqueUsername('invite_veryhigh'),
- global_name: 'Invite VeryHigh',
- password: 'StrongPassword!123',
- date_of_birth: '2000-01-01',
- consent: true,
- invite_code: inviteCode,
- });
- const memberLookup = await createBuilder(harness, ownerToken)
- .get(`/guilds/${guildId}/members/${registration.user_id}`)
- .expect(404)
- .executeWithResponse();
- expect(memberLookup.response.status).toBe(404);
- });
});
diff --git a/fluxer_api/src/api/auth/tests/RegistrationValidation.test.ts b/fluxer_api/src/api/auth/tests/RegistrationValidation.test.ts
index abdef0e53..b41e65047 100644
--- a/fluxer_api/src/api/auth/tests/RegistrationValidation.test.ts
+++ b/fluxer_api/src/api/auth/tests/RegistrationValidation.test.ts
@@ -6,6 +6,7 @@ import {
createUniqueEmail,
createUniqueUsername,
} from '@app/api/auth/tests/AuthTestUtils';
+import {applySharedListUpdate, resetSharedListsForTests} from '@app/api/infrastructure/activity/SharedLists';
import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
@@ -50,18 +51,23 @@ describe('Registration validation', () => {
expect(emailError?.message).toBe("Format d'adresse e-mail invalide.");
});
it('rejects blocked registration email TLDs as invalid email', async () => {
- await createBuilderWithoutAuth(harness)
- .post('/auth/register')
- .body({
- email: '[email protected]',
- username: createUniqueUsername(),
- global_name: 'Test User',
- password: 'a-strong-password',
- date_of_birth: '2000-01-01',
- consent: true,
- })
- .expect(400)
- .execute();
+ applySharedListUpdate('email_tld_blocked', 'blocked\n');
+ try {
+ await createBuilderWithoutAuth(harness)
+ .post('/auth/register')
+ .body({
+ email: '[email protected]',
+ username: createUniqueUsername(),
+ global_name: 'Test User',
+ password: 'a-strong-password',
+ date_of_birth: '2000-01-01',
+ consent: true,
+ })
+ .expect(400)
+ .execute();
+ } finally {
+ resetSharedListsForTests();
+ }
});
it('rejects weak password', async () => {
const json = await createBuilderWithoutAuth<ValidationErrorResponse>(harness)
diff --git a/fluxer_api/src/api/auth/tests/SignInReactivation.test.ts b/fluxer_api/src/api/auth/tests/SignInReactivation.test.ts
new file mode 100644
index 000000000..070f8c29f
--- /dev/null
+++ b/fluxer_api/src/api/auth/tests/SignInReactivation.test.ts
@@ -0,0 +1,142 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {
+ clearTestEmails,
+ createTestAccount,
+ findLastTestEmail,
+ type LoginSuccessResponse,
+ listTestEmails,
+ loginAccount,
+ type TestAccount,
+} from '@app/api/auth/tests/AuthTestUtils';
+import {createUserID} from '@app/api/BrandedTypes';
+import {getKVAccountDeletionQueue, getUserRepository} from '@app/api/middleware/ServiceSingletons';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {generateUniquePassword, HTTP_STATUS} from '@app/api/test/TestConstants';
+import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
+import {reschedulePendingDeletion} from '@app/api/user/services/PendingDeletionCoordinator';
+import {DeletionReasons} from '@fluxer/constants/src/Core';
+import {UserFlags} from '@fluxer/constants/src/UserConstants';
+import {afterEach, beforeEach, describe, expect, test} from 'vitest';
+
+interface HandoffInitiateResponse {
+ code: string;
+}
+
+describe('Signing in again reactivates the account on every sign-in path', () => {
+ let harness: ApiTestHarness;
+ beforeEach(async () => {
+ harness = await createApiTestHarness();
+ await clearTestEmails(harness);
+ });
+ afterEach(async () => {
+ await harness?.shutdown();
+ });
+
+ async function readUser(account: TestAccount) {
+ return (await getUserRepository().findUnique(createUserID(BigInt(account.userId))))!;
+ }
+
+ async function resetPassword(account: TestAccount): Promise<LoginSuccessResponse> {
+ await createBuilderWithoutAuth(harness)
+ .post('/auth/forgot')
+ .body({email: account.email})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ const emails = await listTestEmails(harness, {recipient: account.email});
+ const token = findLastTestEmail(emails, 'password_reset')!.metadata!.token!;
+ return createBuilderWithoutAuth<LoginSuccessResponse>(harness)
+ .post('/auth/reset')
+ .body({token, password: generateUniquePassword()})
+ .execute();
+ }
+
+ test('a password reset cancels a self-requested deletion', async () => {
+ const account = await createTestAccount(harness);
+ await createBuilder(harness, account.token)
+ .post('/users/@me/delete')
+ .body({password: account.password})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ expect((await readUser(account)).pendingDeletionAt).not.toBeNull();
+ expect(await harness.kvProvider.zcard('deletion_queue')).toBe(1);
+ const reset = await resetPassword(account);
+ const user = await readUser(account);
+ expect(user.flags & UserFlags.SELF_DELETED).toBe(0n);
+ expect(user.pendingDeletionAt).toBeNull();
+ expect(user.deletionReasonCode).toBeNull();
+ expect(await harness.kvProvider.zcard('deletion_queue')).toBe(0);
+ await createBuilder(harness, reset.token).get('/users/@me').expect(HTTP_STATUS.OK).execute();
+ });
+
+ test('a password reset reactivates a disabled account', async () => {
+ const account = await createTestAccount(harness);
+ await createBuilder(harness, account.token)
+ .post('/users/@me/disable')
+ .body({password: account.password})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ expect((await readUser(account)).flags & UserFlags.DISABLED).toBe(UserFlags.DISABLED);
+ await resetPassword(account);
+ expect((await readUser(account)).flags & UserFlags.DISABLED).toBe(0n);
+ });
+
+ test('a device handoff from a live session cancels a pending inactivity deletion', async () => {
+ const account = await createTestAccount(harness);
+ const login = await loginAccount(harness, account);
+ const users = getUserRepository();
+ const user = await readUser(account);
+ const pendingDeletionAt = new Date(Date.now() + 86_400_000);
+ await users.updateDeletionSchedule(user, {
+ flags: user.flags | UserFlags.SELF_DELETED,
+ pending_deletion_at: pendingDeletionAt,
+ deletion_reason_code: DeletionReasons.INACTIVITY,
+ });
+ await reschedulePendingDeletion({
+ userId: user.id,
+ nextPendingDeletionAt: pendingDeletionAt,
+ deletionReasonCode: DeletionReasons.INACTIVITY,
+ userRepository: users,
+ deletionQueue: getKVAccountDeletionQueue(),
+ });
+ expect(await harness.kvProvider.zcard('deletion_queue')).toBe(1);
+ const initiated = await createBuilderWithoutAuth<HandoffInitiateResponse>(harness)
+ .post('/auth/handoff/initiate')
+ .body(null)
+ .execute();
+ await createBuilderWithoutAuth(harness).get(`/auth/handoff/${initiated.code}/info`).execute();
+ await createBuilderWithoutAuth(harness)
+ .post('/auth/handoff/complete')
+ .body({code: initiated.code, token: login.token, user_id: login.userId})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ const after = await readUser(account);
+ expect(after.flags & UserFlags.SELF_DELETED).toBe(0n);
+ expect(after.pendingDeletionAt).toBeNull();
+ expect(await harness.kvProvider.zcard('deletion_queue')).toBe(0);
+ });
+
+ test('a temporary ban still blocks every sign-in path', async () => {
+ const account = await createTestAccount(harness);
+ const users = getUserRepository();
+ const user = await readUser(account);
+ await users.patchUpsert(
+ user.id,
+ {flags: user.flags | UserFlags.DISABLED, temp_banned_until: new Date(Date.now() + 3_600_000)},
+ user.toRow(),
+ );
+ await createBuilderWithoutAuth(harness)
+ .post('/auth/forgot')
+ .body({email: account.email})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ const emails = await listTestEmails(harness, {recipient: account.email});
+ const token = findLastTestEmail(emails, 'password_reset')!.metadata!.token!;
+ const {response} = await createBuilderWithoutAuth(harness)
+ .post('/auth/reset')
+ .body({token, password: generateUniquePassword()})
+ .executeRaw();
+ expect(response.status).toBe(HTTP_STATUS.FORBIDDEN);
+ expect((await readUser(account)).flags & UserFlags.DISABLED).toBe(UserFlags.DISABLED);
+ });
+});
diff --git a/fluxer_api/src/api/risk/IpBanCgnatGuard.ts b/fluxer_api/src/api/ban/IpBanCgnatGuard.ts
similarity index 78%
rename from fluxer_api/src/api/risk/IpBanCgnatGuard.ts
rename to fluxer_api/src/api/ban/IpBanCgnatGuard.ts
index 4bcca9fd0..0cc4aa5f6 100644
--- a/fluxer_api/src/api/risk/IpBanCgnatGuard.ts
+++ b/fluxer_api/src/api/ban/IpBanCgnatGuard.ts
@@ -1,6 +1,5 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import {isTrustedCommercialPrivacyProvider} from '@app/api/risk/TrustedPrivacyProviders';
import {parseIpBanEntry} from '@app/api/utils/IpRangeUtils';
import {getSameIpDecisionKey} from '@fluxer/ip_utils/src/IpAddress';
import type {IpInfoLookupResult, IpInfoService} from '@pkgs/geoip/src/IpInfoService';
@@ -38,21 +37,6 @@ export function isHighCgnatBlastRadiusRisk(result: IpInfoLookupResult): boolean
return result.flags.isMobile || result.mobile.name !== null || asnType === 'mobile';
}
-type SuspiciousIpSkipReason = 'ipinfo_unavailable' | 'trusted_commercial_privacy_provider' | 'high_blast_radius';
-
-export function getSuspiciousIpSkipReason(result: IpInfoLookupResult): SuspiciousIpSkipReason | null {
- if (!result.available) {
- return 'ipinfo_unavailable';
- }
- if (isTrustedCommercialPrivacyProvider(result.anonymous.providerName)) {
- return 'trusted_commercial_privacy_provider';
- }
- if (isHighCgnatBlastRadiusRisk(result) || isHighSharedAccessBlastRadiusRisk(result)) {
- return 'high_blast_radius';
- }
- return null;
-}
-
export function isHighSharedAccessBlastRadiusRisk(result: IpInfoLookupResult): boolean {
if (result.flags.isHosting || isAnonymousAccess(result)) {
return false;
diff --git a/fluxer_api/src/api/risk/IpBanExemptions.ts b/fluxer_api/src/api/ban/IpBanExemptions.ts
similarity index 100%
rename from fluxer_api/src/api/risk/IpBanExemptions.ts
rename to fluxer_api/src/api/ban/IpBanExemptions.ts
diff --git a/fluxer_api/src/api/risk/IpInfoCacheFactory.ts b/fluxer_api/src/api/ban/IpInfoCacheFactory.ts
similarity index 100%
rename from fluxer_api/src/api/risk/IpInfoCacheFactory.ts
rename to fluxer_api/src/api/ban/IpInfoCacheFactory.ts
diff --git a/fluxer_api/src/api/risk/__tests__/IpBanCgnatGuard.test.ts b/fluxer_api/src/api/ban/__tests__/IpBanCgnatGuard.test.ts
similarity index 98%
rename from fluxer_api/src/api/risk/__tests__/IpBanCgnatGuard.test.ts
rename to fluxer_api/src/api/ban/__tests__/IpBanCgnatGuard.test.ts
index 1324d8fe5..e2980a402 100644
--- a/fluxer_api/src/api/risk/__tests__/IpBanCgnatGuard.test.ts
+++ b/fluxer_api/src/api/ban/__tests__/IpBanCgnatGuard.test.ts
@@ -4,7 +4,7 @@ import {
isHighCgnatBlastRadiusRisk,
isHighSharedAccessBlastRadiusRisk,
isSingleIpBanCandidate,
-} from '@app/api/risk/IpBanCgnatGuard';
+} from '@app/api/ban/IpBanCgnatGuard';
import type {IpInfoLookupResult} from '@pkgs/geoip/src/IpInfoService';
import {describe, expect, it} from 'vitest';
@@ -12,7 +12,7 @@ function ipInfoResult(overrides: Partial<IpInfoLookupResult> = {}): IpInfoLookup
return {
ip: '198.51.100.1',
available: true,
- riskNote: 'test',
+ note: 'test',
geo: {
countryCode: 'US',
countryName: 'United States',
diff --git a/fluxer_api/src/api/risk/__tests__/IpBanExemptions.test.ts b/fluxer_api/src/api/ban/__tests__/IpBanExemptions.test.ts
similarity index 98%
rename from fluxer_api/src/api/risk/__tests__/IpBanExemptions.test.ts
rename to fluxer_api/src/api/ban/__tests__/IpBanExemptions.test.ts
index 9c4af79de..a1fa74100 100644
--- a/fluxer_api/src/api/risk/__tests__/IpBanExemptions.test.ts
+++ b/fluxer_api/src/api/ban/__tests__/IpBanExemptions.test.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {isIpBanExempt, resetIpBanExemptionsForTesting} from '@app/api/ban/IpBanExemptions';
import {getConfig} from '@app/api/Config';
-import {isIpBanExempt, resetIpBanExemptionsForTesting} from '@app/api/risk/IpBanExemptions';
import {afterEach, beforeEach, describe, expect, it} from 'vitest';
describe('isIpBanExempt', () => {
diff --git a/fluxer_api/src/api/risk/__tests__/IpInfoServiceCache.test.ts b/fluxer_api/src/api/ban/__tests__/IpInfoServiceCache.test.ts
similarity index 68%
rename from fluxer_api/src/api/risk/__tests__/IpInfoServiceCache.test.ts
rename to fluxer_api/src/api/ban/__tests__/IpInfoServiceCache.test.ts
index bab6b607b..f1362e724 100644
--- a/fluxer_api/src/api/risk/__tests__/IpInfoServiceCache.test.ts
+++ b/fluxer_api/src/api/ban/__tests__/IpInfoServiceCache.test.ts
@@ -4,12 +4,10 @@ import {server} from '@app/api/test/msw/server';
import type {
CachedIpInfoFailure,
IpInfoCache,
- IpInfoLookupBudget,
- IpInfoLookupPriority,
IpInfoRequestAuditEvent,
IpInfoRequestAuditLogger,
} from '@pkgs/geoip/src/IpInfoService';
-import {createIpInfoService, resolveIpInfoLookupPriority} from '@pkgs/geoip/src/IpInfoService';
+import {createIpInfoService} from '@pkgs/geoip/src/IpInfoService';
import {delay, HttpResponse, http} from 'msw';
import {describe, expect, it} from 'vitest';
@@ -127,16 +125,6 @@ describe('IpInfoService caching', () => {
expect(sets[0]?.ttlSeconds).toBe(900);
});
- it('caps the quota rejection TTL for background lookups', async () => {
- useLookupHandler(() => new HttpResponse(null, {status: 429}));
- const {cache, sets} = createRecordingCache();
- const service = createIpInfoService({apiKey: 'token', cache});
-
- await service.lookup('203.0.113.5', {source: 'AbusiveIpAutoBanner', reason: 'classify'});
-
- expect(sets[0]?.ttlSeconds).toBe(120);
- });
-
it('returns a cached failure as a clean unavailable result', async () => {
useLookupHandler(() => new HttpResponse(null, {status: 500}));
const {cache} = createRecordingCache();
@@ -150,7 +138,7 @@ describe('IpInfoService caching', () => {
expect(cached).not.toHaveProperty('failureHttpStatus');
expect(cached).not.toHaveProperty('cachedAtMs');
expect(cached.ip).toBe('203.0.113.6');
- expect(cached.riskNote).toBe('IPInfo HTTP 500');
+ expect(cached.note).toBe('IPInfo HTTP 500');
});
it('writes a cached failure that older readers can still consume', async () => {
@@ -200,77 +188,23 @@ describe('IpInfoService caching', () => {
expect(second.available).toBe(false);
});
- it('sheds a lookup when the budget refuses it', async () => {
- const requests = useLookupHandler(() => successPayload('203.0.113.11'));
- const {cache, sets} = createRecordingCache();
- const {logger, events} = createRecordingAuditLogger();
- const refused: Array<IpInfoLookupPriority> = [];
- const budget: IpInfoLookupBudget = {
- async tryConsume(priority: IpInfoLookupPriority): Promise<boolean> {
- refused.push(priority);
- return priority !== 'background';
- },
- };
- const service = createIpInfoService({apiKey: 'token', cache, auditLogger: logger, budget});
-
- const result = await service.lookup('203.0.113.11', {source: 'AbusiveIpAutoBanner', reason: 'classify'});
-
- expect(refused).toEqual(['background']);
- expect(requests.count()).toBe(0);
- expect(result.available).toBe(false);
- expect(result.riskNote).toContain('shed');
- expect(sets).toHaveLength(0);
- expect(events).toHaveLength(1);
- expect(events[0]?.outcome).toBe('budget_shed');
- expect(events[0]?.httpStatus).toBeNull();
- });
-
- it('still coalesces concurrent lookups when a budget is configured', async () => {
+ it('coalesces concurrent lookups from different sources into one audited request', async () => {
const requests = useLookupHandler(() => successPayload('203.0.113.13'));
const {cache} = createRecordingCache();
- const consumed: Array<IpInfoLookupPriority> = [];
- const budget: IpInfoLookupBudget = {
- async tryConsume(priority: IpInfoLookupPriority): Promise<boolean> {
- consumed.push(priority);
- return true;
- },
- };
- const service = createIpInfoService({apiKey: 'token', cache, budget});
+ const {logger, events} = createRecordingAuditLogger();
+ const service = createIpInfoService({apiKey: 'token', cache, auditLogger: logger});
const results = await Promise.all([
- service.lookup('203.0.113.13', {source: 'risk.geoip_city'}),
- service.lookup('203.0.113.13', {source: 'risk.geoip_asn'}),
- service.lookup('203.0.113.13', {source: 'risk.ipinfo_checker'}),
+ service.lookup('203.0.113.13', {source: 'admin.ip_ban', reason: 'ban'}),
+ service.lookup('203.0.113.13', {source: 'test.b'}),
+ service.lookup('203.0.113.13', {source: 'test.c'}),
]);
expect(requests.count()).toBe(1);
- expect(consumed).toEqual(['standard']);
expect(results.every((result) => result.available)).toBe(true);
- });
-
- it('lets an admitting budget through', async () => {
- const requests = useLookupHandler(() => successPayload('203.0.113.12'));
- const {cache} = createRecordingCache();
- const budget: IpInfoLookupBudget = {
- async tryConsume(): Promise<boolean> {
- return true;
- },
- };
- const service = createIpInfoService({apiKey: 'token', cache, budget});
-
- const result = await service.lookup('203.0.113.12', {source: 'risk.ipinfo_checker'});
-
- expect(requests.count()).toBe(1);
- expect(result.available).toBe(true);
- });
-
- it('maps every lookup source to a priority', () => {
- expect(resolveIpInfoLookupPriority('admin.ip_ban')).toBe('critical');
- expect(resolveIpInfoLookupPriority('admin.scheduled_deletion_suspicious_ip')).toBe('critical');
- expect(resolveIpInfoLookupPriority('AbusiveIpAutoBanner')).toBe('background');
- expect(resolveIpInfoLookupPriority('risk.ipinfo_checker')).toBe('standard');
- expect(resolveIpInfoLookupPriority('risk.geoip_city')).toBe('standard');
- expect(resolveIpInfoLookupPriority('risk.geoip_asn')).toBe('standard');
- expect(resolveIpInfoLookupPriority(undefined)).toBe('standard');
+ expect(events).toHaveLength(1);
+ expect(events[0]?.source).toBe('admin.ip_ban');
+ expect(events[0]?.outcome).toBe('http_success');
+ expect(events[0]?.note).toBe('IPInfo: IP is not anonymous');
});
});
diff --git a/fluxer_api/src/api/risk/__tests__/PostgresIpInfoKv.test.ts b/fluxer_api/src/api/ban/__tests__/PostgresIpInfoKv.test.ts
similarity index 99%
rename from fluxer_api/src/api/risk/__tests__/PostgresIpInfoKv.test.ts
rename to fluxer_api/src/api/ban/__tests__/PostgresIpInfoKv.test.ts
index 0c7569307..11a3c90f8 100644
--- a/fluxer_api/src/api/risk/__tests__/PostgresIpInfoKv.test.ts
+++ b/fluxer_api/src/api/ban/__tests__/PostgresIpInfoKv.test.ts
@@ -39,7 +39,7 @@ const EVENT: IpInfoRequestAuditEvent = {
outcome: 'http_success',
httpStatus: 200,
available: true,
- riskNote: 'none',
+ note: 'none',
latencyMs: 12,
requestUrl: 'https://ipinfo.test/192.0.2.1',
responseIp: '192.0.2.1',
diff --git a/fluxer_api/src/api/risk/__tests__/TieredIpInfoCache.test.ts b/fluxer_api/src/api/ban/__tests__/TieredIpInfoCache.test.ts
similarity index 100%
rename from fluxer_api/src/api/risk/__tests__/TieredIpInfoCache.test.ts
rename to fluxer_api/src/api/ban/__tests__/TieredIpInfoCache.test.ts
diff --git a/fluxer_api/src/api/risk/RiskBlocklistS3.ts b/fluxer_api/src/api/blocklist/BlocklistS3.ts
similarity index 78%
rename from fluxer_api/src/api/risk/RiskBlocklistS3.ts
rename to fluxer_api/src/api/blocklist/BlocklistS3.ts
index 2a353189a..65b9e4667 100644
--- a/fluxer_api/src/api/risk/RiskBlocklistS3.ts
+++ b/fluxer_api/src/api/blocklist/BlocklistS3.ts
@@ -2,8 +2,8 @@
import type {IStorageService} from '@app/api/infrastructure/IStorageService';
-const RISK_S3_BUCKET = 'fluxer-geoip';
-export const RISK_S3_KEYS = {
+const BLOCKLIST_S3_BUCKET = 'fluxer-geoip';
+export const BLOCKLIST_S3_KEYS = {
feedUrls: 'blocklists/feed-urls.txt',
} as const;
@@ -21,7 +21,7 @@ export async function writeLinesToS3(storage: IStorageService, key: string, line
buf[offset++] = 0x0a;
}
await storage.uploadObject({
- bucket: RISK_S3_BUCKET,
+ bucket: BLOCKLIST_S3_BUCKET,
key,
body: buf,
contentType: 'text/plain; charset=utf-8',
@@ -31,7 +31,7 @@ export async function writeLinesToS3(storage: IStorageService, key: string, line
export async function readLinesFromS3(storage: IStorageService, key: string): Promise<Array<string>> {
try {
- const data = await storage.readObject(RISK_S3_BUCKET, key);
+ const data = await storage.readObject(BLOCKLIST_S3_BUCKET, key);
const text = Buffer.from(data).toString('utf8');
const lines: Array<string> = [];
let start = 0;
@@ -48,6 +48,6 @@ export async function readLinesFromS3(storage: IStorageService, key: string): Pr
}
}
-export async function deleteRiskS3Object(storage: IStorageService, key: string): Promise<void> {
- await storage.deleteObject(RISK_S3_BUCKET, key);
+export async function deleteBlocklistS3Object(storage: IStorageService, key: string): Promise<void> {
+ await storage.deleteObject(BLOCKLIST_S3_BUCKET, key);
}
diff --git a/fluxer_api/src/api/bot/tests/BotOwnerStanding.test.ts b/fluxer_api/src/api/bot/tests/BotOwnerStanding.test.ts
new file mode 100644
index 000000000..5fa4c9852
--- /dev/null
+++ b/fluxer_api/src/api/bot/tests/BotOwnerStanding.test.ts
@@ -0,0 +1,87 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createUserID} from '@app/api/BrandedTypes';
+import {createTestBotAccount} from '@app/api/bot/tests/BotTestUtils';
+import {getUserRepository} from '@app/api/middleware/ServiceSingletons';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {HTTP_STATUS} from '@app/api/test/TestConstants';
+import {createBuilder} from '@app/api/test/TestRequestBuilder';
+import {UserFlags} from '@fluxer/constants/src/UserConstants';
+import {afterEach, beforeEach, describe, expect, test} from 'vitest';
+
+const HOUR_MS = 3_600_000;
+
+async function setOwnerStanding(
+ ownerUserId: string,
+ change: {addFlags?: bigint; tempBannedUntil?: Date | null},
+): Promise<void> {
+ const users = getUserRepository();
+ const owner = (await users.findUnique(createUserID(BigInt(ownerUserId))))!;
+ await users.patchUpsert(
+ owner.id,
+ {
+ flags: owner.flags | (change.addFlags ?? 0n),
+ ...(change.tempBannedUntil !== undefined ? {temp_banned_until: change.tempBannedUntil} : {}),
+ },
+ owner.toRow(),
+ );
+}
+
+describe('Bot tokens follow the owner account standing', () => {
+ let harness: ApiTestHarness;
+ beforeEach(async () => {
+ harness = await createApiTestHarness();
+ });
+ afterEach(async () => {
+ await harness?.shutdown();
+ });
+
+ async function botRestStatus(botToken: string): Promise<number> {
+ const {response} = await createBuilder(harness, `Bot ${botToken}`).get('/users/@me').executeRaw();
+ return response.status;
+ }
+
+ async function botIdentifyStatus(botToken: string): Promise<number> {
+ const response = await harness.requestJson({
+ path: '/test/rpc-session-init',
+ method: 'POST',
+ body: {type: 'session', token: `Bot ${botToken}`, version: 1, ip: '127.0.0.1'},
+ });
+ return response.status;
+ }
+
+ test('a bot of an owner in good standing works over REST and the gateway', async () => {
+ const bot = await createTestBotAccount(harness);
+ expect(await botRestStatus(bot.botToken)).toBe(HTTP_STATUS.OK);
+ expect(await botIdentifyStatus(bot.botToken)).toBe(HTTP_STATUS.OK);
+ });
+
+ test('a bot of an owner with the DELETED flag stops working', async () => {
+ const bot = await createTestBotAccount(harness);
+ await setOwnerStanding(bot.ownerUserId, {addFlags: UserFlags.DELETED});
+ expect(await botRestStatus(bot.botToken)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ expect(await botIdentifyStatus(bot.botToken)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ });
+
+ test('a bot of a temporarily banned owner stops working until the ban ends', async () => {
+ const bot = await createTestBotAccount(harness);
+ await setOwnerStanding(bot.ownerUserId, {
+ addFlags: UserFlags.DISABLED,
+ tempBannedUntil: new Date(Date.now() + HOUR_MS),
+ });
+ expect(await botRestStatus(bot.botToken)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ expect(await botIdentifyStatus(bot.botToken)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ await setOwnerStanding(bot.ownerUserId, {tempBannedUntil: new Date(Date.now() - HOUR_MS)});
+ expect(await botRestStatus(bot.botToken)).toBe(HTTP_STATUS.OK);
+ });
+
+ test('a bot of a disabled owner stops working', async () => {
+ const bot = await createTestBotAccount(harness);
+ await createBuilder(harness, bot.ownerToken)
+ .post('/users/@me/disable')
+ .body({password: bot.ownerPassword})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ expect(await botRestStatus(bot.botToken)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ });
+});
diff --git a/fluxer_api/src/api/channel/services/ChannelService.ts b/fluxer_api/src/api/channel/services/ChannelService.ts
index 7ccdcede9..e7884ac1b 100644
--- a/fluxer_api/src/api/channel/services/ChannelService.ts
+++ b/fluxer_api/src/api/channel/services/ChannelService.ts
@@ -27,7 +27,6 @@ import type {LimitConfigService} from '@app/api/limits/LimitConfigService';
import type {User} from '@app/api/models/User';
import type {ReadStateService} from '@app/api/read_state/ReadStateService';
import type {IUserRepository} from '@app/api/user/IUserRepository';
-import {createDirectMessageSpamMitigationService} from '@app/api/user/services/DirectMessageSpamMitigationService';
import type {VoiceAvailabilityService} from '@app/api/voice/VoiceAvailabilityService';
import type {IWebhookRepository} from '@app/api/webhook/IWebhookRepository';
import {Permissions} from '@fluxer/constants/src/ChannelConstants';
@@ -101,7 +100,6 @@ export class ChannelService {
readStateService,
limitConfigService,
);
- const directMessageSpamMitigationService = createDirectMessageSpamMitigationService(apiContext, userRepository);
this.channelData = new ChannelDataService(
channelRepository,
userRepository,
@@ -141,7 +139,6 @@ export class ChannelService {
messagePersistenceService,
attachmentUploadTraceRepository,
limitConfigService,
- directMessageSpamMitigationService,
);
this.interactions = new MessageInteractionService(
channelRepository,
diff --git a/fluxer_api/src/api/channel/services/MessageService.ts b/fluxer_api/src/api/channel/services/MessageService.ts
index cc92001da..f9a244887 100644
--- a/fluxer_api/src/api/channel/services/MessageService.ts
+++ b/fluxer_api/src/api/channel/services/MessageService.ts
@@ -29,7 +29,6 @@ import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import type {LimitConfigService} from '@app/api/limits/LimitConfigService';
import type {ReadStateService} from '@app/api/read_state/ReadStateService';
import type {IUserRepository} from '@app/api/user/IUserRepository';
-import type {DirectMessageSpamMitigationService} from '@app/api/user/services/DirectMessageSpamMitigationService';
import type {WorkerTaskName} from '@app/api/worker/WorkerLaneConfig';
import type {ICacheService} from '@pkgs/cache/src/ICacheService';
import type {IRateLimitService} from '@pkgs/rate_limit/src/IRateLimitService';
@@ -69,7 +68,6 @@ export class MessageService {
persistenceService: MessagePersistenceService,
attachmentUploadTraceRepository: AttachmentUploadTraceRepository,
limitConfigService: LimitConfigService,
- directMessageSpamMitigationService: DirectMessageSpamMitigationService,
) {
this.validation = new MessageValidationService(cacheService, limitConfigService);
this.mention = new MessageMentionService(
@@ -130,7 +128,6 @@ export class MessageService {
attachmentUploadTraceRepository,
operationsHelpers,
limitConfigService,
- directMessageSpamMitigationService,
});
this.edit = new MessageEditService({
channelRepository,
diff --git a/fluxer_api/src/api/channel/services/message/MessageActivity.ts b/fluxer_api/src/api/channel/services/message/MessageActivity.ts
new file mode 100644
index 000000000..d73f42bd2
--- /dev/null
+++ b/fluxer_api/src/api/channel/services/message/MessageActivity.ts
@@ -0,0 +1,125 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createInviteCode, type GuildID, type UserID} from '@app/api/BrandedTypes';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import {Logger} from '@app/api/Logger';
+import {getGuildRepository, getInviteRepository} from '@app/api/middleware/ServiceSingletons';
+import type {Channel} from '@app/api/models/Channel';
+import type {Message} from '@app/api/models/Message';
+import type {User} from '@app/api/models/User';
+import type {IUserRepository} from '@app/api/user/IUserRepository';
+import {findInvites} from '@app/api/utils/InviteUtils';
+import {ChannelTypes} from '@fluxer/constants/src/ChannelConstants';
+import {RelationshipTypes} from '@fluxer/constants/src/UserConstants';
+
+const CONTENT_MAX_CHARS = 2000;
+const LIST_MAX = 10;
+const MENTIONS_MAX = 20;
+const LINK_PATTERN = /https?:\/\/([^\s/?#<>"']+)/giu;
+
+function linkDomains(content: string): Array<string> {
+ const domains = new Set<string>();
+ for (const match of content.matchAll(LINK_PATTERN)) {
+ const host = match[1]
+ ?.toLowerCase()
+ .replace(/:\d+$/u, '')
+ .replace(/^www\./u, '');
+ if (host) domains.add(host);
+ if (domains.size >= LIST_MAX) break;
+ }
+ return [...domains];
+}
+
+interface InviteTarget {
+ guildId: string | null;
+ ownerId: string | null;
+}
+
+async function inviteTarget(code: string): Promise<InviteTarget> {
+ try {
+ const invite = await getInviteRepository().findUnique(createInviteCode(code));
+ if (!invite?.guildId) return {guildId: null, ownerId: null};
+ const guild = await getGuildRepository().findUnique(invite.guildId);
+ return {guildId: invite.guildId.toString(), ownerId: guild ? guild.ownerId.toString() : null};
+ } catch {
+ return {guildId: null, ownerId: null};
+ }
+}
+
+function inviteTargets(codes: ReadonlyArray<string>): Promise<Array<InviteTarget>> {
+ return Promise.all(codes.map(inviteTarget));
+}
+
+async function guildMemberCount(guildId: GuildID): Promise<number | null> {
+ try {
+ const guild = await getGuildRepository().findUnique(guildId);
+ return guild ? guild.memberCount : null;
+ } catch {
+ return null;
+ }
+}
+
+export interface MessageCreatedActivity {
+ user: User;
+ message: Message;
+ channel: Channel;
+ guildId: GuildID | null;
+ guildOwnerId: UserID | null;
+ dmRecipientId: UserID | null;
+ channelHadMessages: boolean;
+ delivered: boolean;
+ userRepository: Pick<IUserRepository, 'getRelationship'>;
+}
+
+async function buildAndEmit(params: MessageCreatedActivity): Promise<void> {
+ const {user, message, channel, guildId, dmRecipientId} = params;
+ const content = Array.from(message.content ?? '')
+ .slice(0, CONTENT_MAX_CHARS)
+ .join('');
+ const inviteCodes = findInvites(message.content, LIST_MAX);
+ const domains = linkDomains(message.content ?? '');
+ const [targets, memberCount] = await Promise.all([
+ inviteTargets(inviteCodes),
+ guildId && (domains.length > 0 || inviteCodes.length > 0) ? guildMemberCount(guildId) : Promise.resolve(null),
+ ]);
+ const mentionedIds = [...message.mentionedUserIds];
+ const recipientIsFriend = dmRecipientId
+ ? (await params.userRepository.getRelationship(user.id, dmRecipientId, RelationshipTypes.FRIEND)) !== null
+ : false;
+ await emitActivity(
+ 'message_created',
+ user.id.toString(),
+ {
+ user_id: user.id.toString(),
+ message_id: message.id.toString(),
+ channel_id: channel.id.toString(),
+ channel_type: guildId ? 'guild' : channel.type === ChannelTypes.GROUP_DM ? 'group_dm' : 'dm',
+ guild_id: guildId ? guildId.toString() : null,
+ dm_recipient_id: dmRecipientId ? dmRecipientId.toString() : null,
+ recipient_is_friend: recipientIsFriend,
+ channel_prior_messages: params.channelHadMessages,
+ is_bot: user.isBot,
+ content,
+ attachment_count: message.attachments.length,
+ attachment_names: message.attachments.slice(0, LIST_MAX).map((attachment) => attachment.filename),
+ link_domains: domains,
+ invite_codes: inviteCodes,
+ invite_guild_ids: targets.map((target) => target.guildId),
+ invite_guild_owner_ids: targets.map((target) => target.ownerId),
+ mention_user_ids: mentionedIds.slice(0, MENTIONS_MAX).map(String),
+ mentions_recipient: dmRecipientId !== null && mentionedIds.some((id) => id === dmRecipientId),
+ mention_everyone: message.mentionEveryone,
+ author_owns_guild: params.guildOwnerId !== null && params.guildOwnerId === user.id,
+ guild_member_count: memberCount,
+ delivered: params.delivered,
+ },
+ null,
+ message.id.toString(),
+ );
+}
+
+export function emitMessageCreated(params: MessageCreatedActivity): void {
+ void buildAndEmit(params).catch((error: unknown) => {
+ Logger.debug({error}, 'Message activity event could not be built');
+ });
+}
diff --git a/fluxer_api/src/api/channel/services/message/MessageSendService.ts b/fluxer_api/src/api/channel/services/message/MessageSendService.ts
index 195d9cd04..fa63274b4 100644
--- a/fluxer_api/src/api/channel/services/message/MessageSendService.ts
+++ b/fluxer_api/src/api/channel/services/message/MessageSendService.ts
@@ -15,6 +15,7 @@ import type {MessageRequest, MessageUpdateRequest} from '@app/api/channel/Messag
import type {IChannelRepositoryAggregate} from '@app/api/channel/repositories/IChannelRepositoryAggregate';
import type {AttachmentUploadTraceRepository} from '@app/api/channel/repositories/message/AttachmentUploadTraceRepository';
import type {AuthenticatedChannel} from '@app/api/channel/services/AuthenticatedChannel';
+import {emitMessageCreated} from '@app/api/channel/services/message/MessageActivity';
import type {MessageChannelAuthService} from '@app/api/channel/services/message/MessageChannelAuthService';
import type {DmNsfwContext} from '@app/api/channel/services/message/MessageContentService';
import type {MessageDispatchService} from '@app/api/channel/services/message/MessageDispatchService';
@@ -46,7 +47,7 @@ import type {MessageSnapshot} from '@app/api/models/MessageSnapshot';
import type {User} from '@app/api/models/User';
import type {Webhook} from '@app/api/models/Webhook';
import type {IUserRepository} from '@app/api/user/IUserRepository';
-import type {DirectMessageSpamMitigationService} from '@app/api/user/services/DirectMessageSpamMitigationService';
+import {isDirectDeliverySuppressed} from '@app/api/user/UserHelpers';
import {assertGuildMemberCanCommunicate} from '@app/api/utils/GuildCommunicationUtils';
import {
ChannelTypes,
@@ -96,7 +97,6 @@ interface MessageSendServiceDeps {
embedAttachmentResolver: MessageEmbedAttachmentResolver;
attachmentUploadTraceRepository: AttachmentUploadTraceRepository;
limitConfigService: LimitConfigService;
- directMessageSpamMitigationService: DirectMessageSpamMitigationService;
}
interface SendMessageResult {
@@ -946,14 +946,8 @@ export class MessageSendService {
}
}
const dmRecipientId = this.getOneToOneDmRecipientId(channel, user.id);
- let suppressDmRecipientDelivery = false;
- if (dmRecipientId && !user.isBot) {
- const spamDecision = await this.deps.directMessageSpamMitigationService.recordOneToOneDmSend({
- sender: user,
- recipientId: dmRecipientId,
- });
- suppressDmRecipientDelivery = spamDecision.shouldSuppressRecipientDelivery;
- }
+ const suppressDmRecipientDelivery = dmRecipientId !== null && isDirectDeliverySuppressed(user);
+ const channelHadMessages = channel.lastMessageId !== null;
const {message, enqueueDeferredEmbeds} = await this.deps.persistenceService.createMessage({
messageId,
channelId,
@@ -1034,6 +1028,17 @@ export class MessageSendService {
},
]);
await this.cacheMessageNonceIfPresent({userId: user.id, nonce: data.nonce, channelId, messageId});
+ emitMessageCreated({
+ user,
+ message,
+ channel,
+ guildId: guild?.id ? createGuildID(BigInt(guild.id)) : null,
+ guildOwnerId: guild?.owner_id ? createUserID(BigInt(guild.owner_id)) : null,
+ dmRecipientId,
+ channelHadMessages,
+ delivered: !suppressDmRecipientDelivery,
+ userRepository: this.deps.userRepository,
+ });
void enqueueDeferredEmbeds().catch((error) => {
Logger.warn({error, messageId: messageId.toString()}, 'Failed to enqueue deferred embed extraction');
});
diff --git a/fluxer_api/src/api/config/APIConfig.ts b/fluxer_api/src/api/config/APIConfig.ts
index 3a83abf8e..1f876eafd 100644
--- a/fluxer_api/src/api/config/APIConfig.ts
+++ b/fluxer_api/src/api/config/APIConfig.ts
@@ -26,16 +26,13 @@ export interface APICachePurgeConfig {
interface APIGeoipFilesystemConfig {
mode: 'filesystem';
maxmindDbPath?: string;
- maxmindAsnDbPath?: string;
}
interface APIGeoipS3Config {
mode: 's3';
maxmindDbPath: string;
- maxmindAsnDbPath?: string;
s3Bucket: string;
s3Key: string;
- s3AsnKey?: string;
}
export type APIGeoipConfig = APIGeoipFilesystemConfig | APIGeoipS3Config;
@@ -185,26 +182,12 @@ export interface APIConfig {
secure: boolean;
};
};
- sms: {
- enabled: boolean;
- accountSid?: string;
- authToken?: string;
- verifyServiceSid?: string;
- inboundChallengeNumber?: string;
- inboundWebhookAuthToken?: string;
- inboundWebhookPublicUrl?: string;
- };
- risk: {
- enabled: boolean;
- ipinfoApiKey?: string;
- accountPolicyDsl?: unknown;
+ ipinfo: {
+ apiKey?: string;
};
blocklistFeeds: {
enabled: boolean;
};
- torExitList: {
- enabled: boolean;
- };
breachedPasswordCheck: {
enabled: boolean;
};
@@ -335,23 +318,6 @@ export interface APIConfig {
configured: boolean;
};
};
- abusePolicy: {
- inboundPhoneCountryCodes: Array<string>;
- phoneFlagging: {
- enabled: boolean;
- exemptCountryCodes: Array<string>;
- };
- phoneVerification: {
- inboundRequiredPrefixes: Array<string>;
- };
- directContactSpam: {
- enabled: boolean;
- countryCodes: Array<string>;
- distinctTargetThreshold: number;
- targetWindowMs: number;
- action: 'flag_spammer' | 'suppress_delivery';
- };
- };
domain: {
baseDomain: string;
};
diff --git a/fluxer_api/src/api/connection/ConnectionRepository.ts b/fluxer_api/src/api/connection/ConnectionRepository.ts
index 3e0241263..e88c2dd9d 100644
--- a/fluxer_api/src/api/connection/ConnectionRepository.ts
+++ b/fluxer_api/src/api/connection/ConnectionRepository.ts
@@ -18,7 +18,12 @@ import {
IConnectionRepository,
type UpdateConnectionParams,
} from '@app/api/connection/IConnectionRepository';
-import {BatchBuilder, executeConditional, fetchMany, fetchOne} from '@app/api/database/CassandraQueryExecution';
+import {
+ executeConditional,
+ executeGroupedBatches,
+ fetchMany,
+ fetchOne,
+} from '@app/api/database/CassandraQueryExecution';
import {type ConditionalWriteEntry, Db, type DbOp} from '@app/api/database/CassandraTypes';
import {
type RevisionedUserConnectionRow,
@@ -270,17 +275,15 @@ export class ConnectionRepository extends IConnectionRepository {
const rows = await fetchMany<UserConnectionStorageRow>(FETCH_DELETION_CONNECTIONS_CQL, {user_id: userId});
const remaining = rows.filter((row) => !isConnectionMembershipRow(row));
if (remaining.length === 0) return;
- const batch = new BatchBuilder();
- for (const row of remaining) {
- batch.addPrepared(
+ await executeGroupedBatches(
+ remaining.map((row) => [
UserConnections.deleteByPk({
user_id: userId,
connection_type: row.connection_type,
connection_id: row.connection_id,
}),
- );
- }
- await batch.execute();
+ ]),
+ );
}
}
diff --git a/fluxer_api/src/api/constants/PhonePrefixBan.ts b/fluxer_api/src/api/constants/PhonePrefixBan.ts
deleted file mode 100644
index c9c4a0fe8..000000000
--- a/fluxer_api/src/api/constants/PhonePrefixBan.ts
+++ /dev/null
@@ -1,3 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-export const PHONE_PREFIX_BAN_REFRESH_CHANNEL = 'phone_prefix_bans:refresh';
diff --git a/fluxer_api/src/api/database/CassandraQueryExecution.test.ts b/fluxer_api/src/api/database/CassandraQueryExecution.test.ts
index 56dd1fadf..abd4fde1e 100644
--- a/fluxer_api/src/api/database/CassandraQueryExecution.test.ts
+++ b/fluxer_api/src/api/database/CassandraQueryExecution.test.ts
@@ -1,9 +1,14 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import {mapCassandraDriverError} from '@app/api/database/CassandraQueryExecution';
+import {
+ executeGroupedBatches,
+ mapCassandraDriverError,
+ setCassandraQueryExecutorForTesting,
+} from '@app/api/database/CassandraQueryExecution';
+import {prepared} from '@app/api/database/CassandraTypes';
import {ServiceUnavailableError} from '@fluxer/errors/src/domains/core/ServiceUnavailableError';
import cassandra from 'cassandra-driver';
-import {describe, expect, it} from 'vitest';
+import {afterEach, describe, expect, it} from 'vitest';
function busyConnectionError(): cassandra.errors.BusyConnectionError {
return new cassandra.errors.BusyConnectionError('127.0.0.1:9042', 2048, 4);
@@ -34,3 +39,45 @@ describe('mapCassandraDriverError', () => {
expect(mapCassandraDriverError(err)).toBe(err);
});
});
+
+describe('executeGroupedBatches', () => {
+ afterEach(() => {
+ setCassandraQueryExecutorForTesting(null);
+ });
+
+ function recordBatches(): Array<Array<string>> {
+ const batches: Array<Array<string>> = [];
+ setCassandraQueryExecutorForTesting({
+ executeQuery: async () => [],
+ executeBatch: async (queries) => {
+ batches.push(queries.map((query) => (query.params as {id: string}).id));
+ },
+ });
+ return batches;
+ }
+
+ function group(id: number, size: number) {
+ return Array.from({length: size}, (_, index) => prepared('DELETE FROM t WHERE id = ?', {id: `${id}.${index}`}));
+ }
+
+ it('keeps every group in one batch and never exceeds the statement limit', async () => {
+ const batches = recordBatches();
+ await executeGroupedBatches(
+ Array.from({length: 10}, (_, id) => group(id, 3)),
+ 7,
+ );
+ expect(batches.map((batch) => batch.length)).toEqual([6, 6, 6, 6, 6]);
+ for (const batch of batches) {
+ const groups = new Set(batch.map((id) => id.split('.')[0]));
+ for (const id of groups) {
+ expect(batch.filter((entry) => entry.startsWith(`${id}.`))).toHaveLength(3);
+ }
+ }
+ });
+
+ it('sends nothing for no groups', async () => {
+ const batches = recordBatches();
+ await executeGroupedBatches([]);
+ expect(batches).toEqual([]);
+ });
+});
diff --git a/fluxer_api/src/api/database/CassandraQueryExecution.ts b/fluxer_api/src/api/database/CassandraQueryExecution.ts
index 6610c7424..64d799566 100644
--- a/fluxer_api/src/api/database/CassandraQueryExecution.ts
+++ b/fluxer_api/src/api/database/CassandraQueryExecution.ts
@@ -366,3 +366,23 @@ export class BatchBuilder {
return this.queries;
}
}
+
+const MAX_BATCH_STATEMENTS = 60;
+
+export async function executeGroupedBatches(
+ groups: ReadonlyArray<ReadonlyArray<PreparedQuery>>,
+ maxStatements = MAX_BATCH_STATEMENTS,
+): Promise<void> {
+ let batch = new BatchBuilder();
+ let size = 0;
+ for (const group of groups) {
+ if (size > 0 && size + group.length > maxStatements) {
+ await batch.execute();
+ batch = new BatchBuilder();
+ size = 0;
+ }
+ for (const query of group) batch.addPrepared(query);
+ size += group.length;
+ }
+ await batch.execute();
+}
diff --git a/fluxer_api/src/api/database/PostgresKvDefaultTtl.test.ts b/fluxer_api/src/api/database/PostgresKvDefaultTtl.test.ts
index 84500e39f..5b96ece86 100644
--- a/fluxer_api/src/api/database/PostgresKvDefaultTtl.test.ts
+++ b/fluxer_api/src/api/database/PostgresKvDefaultTtl.test.ts
@@ -331,7 +331,7 @@ RETURNING updated_at::text`,
await seed('recent_mentions', 'rm-week', '8 days');
await seed('attachment_upload_traces_by_key', 'at-31', '31 days');
await seed('attachment_upload_traces_by_key', 'at-29', '29 days');
- await seed('phone_lookup_cache', 'pl-8', '8 days');
+ await seed('oauth2_access_tokens', 'oa-8', '8 days');
await seed('donor_magic_link_tokens', 'dm-hour', '1 hour');
await seed('ipinfo_requests_by_hour', 'ip-day', '1 day');
await seed('jobs_by_id', 'job', '100 days');
diff --git a/fluxer_api/src/api/database/types/AdminArchiveTypes.ts b/fluxer_api/src/api/database/types/AdminArchiveTypes.ts
index 043ec4e82..202294983 100644
--- a/fluxer_api/src/api/database/types/AdminArchiveTypes.ts
+++ b/fluxer_api/src/api/database/types/AdminArchiveTypes.ts
@@ -93,28 +93,6 @@ export interface BannedEmailRow {
export const BANNED_EMAIL_COLUMNS = ['email_lower'] as const satisfies ReadonlyArray<keyof BannedEmailRow>;
-export interface BannedPhonePrefixRow {
- prefix: string;
-}
-
-export const BANNED_PHONE_PREFIX_COLUMNS = ['prefix'] as const satisfies ReadonlyArray<keyof BannedPhonePrefixRow>;
-
-export interface SuspiciousEmailDomainRow {
- domain: string;
-}
-
-export const SUSPICIOUS_EMAIL_DOMAIN_COLUMNS = ['domain'] as const satisfies ReadonlyArray<
- keyof SuspiciousEmailDomainRow
->;
-
-export interface DisposableEmailDomainRow {
- domain: string;
-}
-
-export const DISPOSABLE_EMAIL_DOMAIN_COLUMNS = ['domain'] as const satisfies ReadonlyArray<
- keyof DisposableEmailDomainRow
->;
-
export interface BannedPhraseRow {
phrase: string;
}
diff --git a/fluxer_api/src/api/database/types/AuthTypes.ts b/fluxer_api/src/api/database/types/AuthTypes.ts
index f0ef533ea..f00f68f2e 100644
--- a/fluxer_api/src/api/database/types/AuthTypes.ts
+++ b/fluxer_api/src/api/database/types/AuthTypes.ts
@@ -36,13 +36,6 @@ export interface AuthSessionTombstoneRow {
version: number;
}
-export interface UserCountryHistoryRow {
- user_id: UserID;
- country: string;
- first_seen_at: Date;
- last_seen_at: Date;
-}
-
export interface MfaBackupCodeRow {
user_id: UserID;
code: MfaBackupCode;
@@ -154,12 +147,6 @@ export const AUTH_SESSION_TOMBSTONE_COLUMNS = [
'deleted_at',
'version',
] as const satisfies ReadonlyArray<keyof AuthSessionTombstoneRow>;
-export const USER_COUNTRY_HISTORY_COLUMNS = [
- 'user_id',
- 'country',
- 'first_seen_at',
- 'last_seen_at',
-] as const satisfies ReadonlyArray<keyof UserCountryHistoryRow>;
export const MFA_BACKUP_CODE_COLUMNS = ['user_id', 'code', 'consumed'] as const satisfies ReadonlyArray<
keyof MfaBackupCodeRow
>;
@@ -199,14 +186,6 @@ export const WEBAUTHN_CREDENTIAL_COLUMNS = [
'superseded_by',
] as const satisfies ReadonlyArray<keyof WebAuthnCredentialRow>;
-export interface PhoneTokenRow {
- token_: string;
- phone: string;
- user_id: Nullish<UserID>;
-}
-
-export const PHONE_TOKEN_COLUMNS = ['token_', 'phone', 'user_id'] as const satisfies ReadonlyArray<keyof PhoneTokenRow>;
-
export interface PasswordChangeTicketRow {
ticket: string;
user_id: UserID;
diff --git a/fluxer_api/src/api/database/types/RiskTypes.ts b/fluxer_api/src/api/database/types/RiskTypes.ts
deleted file mode 100644
index 22acdf809..000000000
--- a/fluxer_api/src/api/database/types/RiskTypes.ts
+++ /dev/null
@@ -1,323 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {UserID} from '@app/api/BrandedTypes';
-
-export interface RegistrationEventByIpRow {
- ip: string;
- created_at: Date;
- user_id: UserID;
- email: string | null;
- email_domain: string | null;
- locale: string | null;
-}
-
-export const REGISTRATION_EVENT_BY_IP_COLUMNS = [
- 'ip',
- 'created_at',
- 'user_id',
- 'email',
- 'email_domain',
- 'locale',
-] as const satisfies ReadonlyArray<keyof RegistrationEventByIpRow>;
-
-export interface RegistrationEventBySubnetRow {
- subnet: string;
- created_at: Date;
- user_id: UserID;
- ip: string;
- email: string | null;
- email_domain: string | null;
- locale: string | null;
-}
-
-export const REGISTRATION_EVENT_BY_SUBNET_COLUMNS = [
- 'subnet',
- 'created_at',
- 'user_id',
- 'ip',
- 'email',
- 'email_domain',
- 'locale',
-] as const satisfies ReadonlyArray<keyof RegistrationEventBySubnetRow>;
-
-export interface RegistrationEventByEmailDomainRow {
- email_domain: string;
- created_at: Date;
- user_id: UserID;
- ip: string;
- email: string | null;
- locale: string | null;
-}
-
-export const REGISTRATION_EVENT_BY_EMAIL_DOMAIN_COLUMNS = [
- 'email_domain',
- 'created_at',
- 'user_id',
- 'ip',
- 'email',
- 'locale',
-] as const satisfies ReadonlyArray<keyof RegistrationEventByEmailDomainRow>;
-
-export interface RegistrationEventByPlusAddressBaseRow {
- plus_address_base: string;
- created_at: Date;
- user_id: UserID;
- ip: string;
- email: string | null;
- locale: string | null;
-}
-
-export const REGISTRATION_EVENT_BY_PLUS_ADDRESS_BASE_COLUMNS = [
- 'plus_address_base',
- 'created_at',
- 'user_id',
- 'ip',
- 'email',
- 'locale',
-] as const satisfies ReadonlyArray<keyof RegistrationEventByPlusAddressBaseRow>;
-
-export interface LatestRiskContextByUserRow {
- user_id: UserID;
- updated_at: Date;
- ip: string;
- subnet: string | null;
- email_domain: string | null;
- asn: number | null;
-}
-
-export const LATEST_RISK_CONTEXT_BY_USER_COLUMNS = [
- 'user_id',
- 'updated_at',
- 'ip',
- 'subnet',
- 'email_domain',
- 'asn',
-] as const satisfies ReadonlyArray<keyof LatestRiskContextByUserRow>;
-
-export interface SuspiciousIpRow {
- ip: string;
- created_at: Date;
- updated_at: Date;
- expires_at: Date | null;
- source: string;
- reason: string;
- source_user_id: UserID | null;
- deletion_reason_code: number | null;
- provider_name: string | null;
- asn: number | null;
- asn_name: string | null;
- asn_type: string | null;
- risk_note: string | null;
-}
-
-export const SUSPICIOUS_IP_COLUMNS = [
- 'ip',
- 'created_at',
- 'updated_at',
- 'expires_at',
- 'source',
- 'reason',
- 'source_user_id',
- 'deletion_reason_code',
- 'provider_name',
- 'asn',
- 'asn_name',
- 'asn_type',
- 'risk_note',
-] as const satisfies ReadonlyArray<keyof SuspiciousIpRow>;
-
-export interface RiskOutcomeByIpRow {
- ip: string;
- created_at: Date;
- user_id: UserID;
- outcome_code: string;
- source: string;
-}
-
-export const RISK_OUTCOME_BY_IP_COLUMNS = [
- 'ip',
- 'created_at',
- 'user_id',
- 'outcome_code',
- 'source',
-] as const satisfies ReadonlyArray<keyof RiskOutcomeByIpRow>;
-
-export interface RiskOutcomeBySubnetRow {
- subnet: string;
- created_at: Date;
- user_id: UserID;
- outcome_code: string;
- source: string;
-}
-
-export const RISK_OUTCOME_BY_SUBNET_COLUMNS = [
- 'subnet',
- 'created_at',
- 'user_id',
- 'outcome_code',
- 'source',
-] as const satisfies ReadonlyArray<keyof RiskOutcomeBySubnetRow>;
-
-export interface RiskOutcomeByEmailDomainRow {
- email_domain: string;
- created_at: Date;
- user_id: UserID;
- outcome_code: string;
- source: string;
-}
-
-export const RISK_OUTCOME_BY_EMAIL_DOMAIN_COLUMNS = [
- 'email_domain',
- 'created_at',
- 'user_id',
- 'outcome_code',
- 'source',
-] as const satisfies ReadonlyArray<keyof RiskOutcomeByEmailDomainRow>;
-
-export interface RiskOutcomeByAsnRow {
- asn: number;
- created_at: Date;
- user_id: UserID;
- outcome_code: string;
- source: string;
-}
-
-export const RISK_OUTCOME_BY_ASN_COLUMNS = [
- 'asn',
- 'created_at',
- 'user_id',
- 'outcome_code',
- 'source',
-] as const satisfies ReadonlyArray<keyof RiskOutcomeByAsnRow>;
-
-export interface RiskAssessmentRow {
- assessment_id: string;
- created_at: Date;
- user_id: UserID | null;
- ip: string;
- email: string | null;
- locale: string | null;
- risk_level: string;
- risk_score: number;
- suspicious: boolean;
- method: string;
- model_used: string;
- recommended_action: string;
- reasoning: string;
- signals_json: string;
-}
-
-export const RISK_ASSESSMENT_COLUMNS = [
- 'assessment_id',
- 'created_at',
- 'user_id',
- 'ip',
- 'email',
- 'locale',
- 'risk_level',
- 'risk_score',
- 'suspicious',
- 'method',
- 'model_used',
- 'recommended_action',
- 'reasoning',
- 'signals_json',
-] as const satisfies ReadonlyArray<keyof RiskAssessmentRow>;
-
-export interface RiskAssessmentByUserRow {
- user_id: UserID;
- created_at: Date;
- assessment_id: string;
- risk_level: string;
- risk_score: number;
-}
-
-export const RISK_ASSESSMENT_BY_USER_COLUMNS = [
- 'user_id',
- 'created_at',
- 'assessment_id',
- 'risk_level',
- 'risk_score',
-] as const satisfies ReadonlyArray<keyof RiskAssessmentByUserRow>;
-
-export interface InboundSmsChallengeRow {
- challenge_code: string;
- user_id: UserID;
- our_number: string;
- created_at: Date;
- expires_at: Date;
- consumed_at: Date | null;
- consumed_from_phone: string | null;
-}
-
-export const INBOUND_SMS_CHALLENGE_COLUMNS = [
- 'challenge_code',
- 'user_id',
- 'our_number',
- 'created_at',
- 'expires_at',
- 'consumed_at',
- 'consumed_from_phone',
-] as const satisfies ReadonlyArray<keyof InboundSmsChallengeRow>;
-
-export interface InboundSmsChallengeByUserRow {
- user_id: UserID;
- created_at: Date;
- challenge_code: string;
- expires_at: Date;
-}
-
-export const INBOUND_SMS_CHALLENGE_BY_USER_COLUMNS = [
- 'user_id',
- 'created_at',
- 'challenge_code',
- 'expires_at',
-] as const satisfies ReadonlyArray<keyof InboundSmsChallengeByUserRow>;
-
-export interface PhoneLookupCacheRow {
- phone: string;
- looked_up_at: Date;
- valid: boolean;
- line_type: string | null;
- country_code: string | null;
- carrier_name: string | null;
- sms_pumping_risk_score: number | null;
-}
-
-export const PHONE_LOOKUP_CACHE_COLUMNS = [
- 'phone',
- 'looked_up_at',
- 'valid',
- 'line_type',
- 'country_code',
- 'carrier_name',
- 'sms_pumping_risk_score',
-] as const satisfies ReadonlyArray<keyof PhoneLookupCacheRow>;
-
-export interface PhoneVerificationAttemptRow {
- attempt_id: string;
- created_at: Date;
- phone: string;
- country_code: string | null;
- line_type: string | null;
- carrier_name: string | null;
- sms_pumping_risk_score: number | null;
- verdict: string;
- reject_reason: string | null;
- inbound_reason: string | null;
- lookup_cache_hit: boolean;
-}
-
-export const PHONE_VERIFICATION_ATTEMPT_COLUMNS = [
- 'attempt_id',
- 'created_at',
- 'phone',
- 'country_code',
- 'line_type',
- 'carrier_name',
- 'sms_pumping_risk_score',
- 'verdict',
- 'reject_reason',
- 'inbound_reason',
- 'lookup_cache_hit',
-] as const satisfies ReadonlyArray<keyof PhoneVerificationAttemptRow>;
diff --git a/fluxer_api/src/api/database/types/UserTypes.ts b/fluxer_api/src/api/database/types/UserTypes.ts
index f315a5819..04178495e 100644
--- a/fluxer_api/src/api/database/types/UserTypes.ts
+++ b/fluxer_api/src/api/database/types/UserTypes.ts
@@ -75,6 +75,8 @@ export interface UserRow {
deletion_reason_code: Nullish<number>;
deletion_public_reason: Nullish<string>;
deletion_audit_log_reason: Nullish<string>;
+ deletion_scheduled_by?: Nullish<UserID>;
+ deletion_scheduled_at?: Nullish<Date>;
acls: Nullish<Set<string>>;
traits: Nullish<Set<string>>;
first_refund_at: Nullish<Date>;
@@ -139,6 +141,8 @@ export const USER_COLUMNS = [
'deletion_reason_code',
'deletion_public_reason',
'deletion_audit_log_reason',
+ 'deletion_scheduled_by',
+ 'deletion_scheduled_at',
'acls',
'traits',
'first_refund_at',
@@ -202,6 +206,8 @@ export const EMPTY_USER_ROW: UserRow = {
deletion_reason_code: null,
deletion_public_reason: null,
deletion_audit_log_reason: null,
+ deletion_scheduled_by: null,
+ deletion_scheduled_at: null,
acls: null,
traits: null,
first_refund_at: null,
diff --git a/fluxer_api/src/api/guild/repositories/GuildModerationRepository.ts b/fluxer_api/src/api/guild/repositories/GuildModerationRepository.ts
index 049eaa8bd..9a3c17393 100644
--- a/fluxer_api/src/api/guild/repositories/GuildModerationRepository.ts
+++ b/fluxer_api/src/api/guild/repositories/GuildModerationRepository.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {GuildID, UserID} from '@app/api/BrandedTypes';
-import {BatchBuilder, fetchMany, fetchOne} from '@app/api/database/CassandraQueryExecution';
+import {BatchBuilder, executeGroupedBatches, fetchMany, fetchOne} from '@app/api/database/CassandraQueryExecution';
import {Db, type DbOp, type QueryTemplate, type WhereExpr} from '@app/api/database/CassandraTypes';
import {executeVersionedUpdate} from '@app/api/database/CassandraVersionedUpdate';
import type {
@@ -112,15 +112,13 @@ export class GuildModerationRepository extends IGuildModerationRepository {
async deleteAllBansForUser(userId: UserID): Promise<void> {
const bans = await fetchMany<GuildBanByUserIdRow>(FETCH_GUILD_BANS_BY_USER_ID_QUERY, {user_id: userId});
- const batch = new BatchBuilder();
- for (const ban of bans) {
- batch.addPrepared(GuildBans.deleteByPk({guild_id: ban.guild_id, user_id: userId}));
- batch.addPrepared(GuildBansByUserId.deleteByPk({user_id: userId, guild_id: ban.guild_id}));
- if (ban.email) {
- batch.addPrepared(GuildBansByEmail.deleteByPk({guild_id: ban.guild_id, email: ban.email}));
- }
- }
- await batch.execute();
+ await executeGroupedBatches(
+ bans.map((ban) => [
+ GuildBans.deleteByPk({guild_id: ban.guild_id, user_id: userId}),
+ GuildBansByUserId.deleteByPk({user_id: userId, guild_id: ban.guild_id}),
+ ...(ban.email ? [GuildBansByEmail.deleteByPk({guild_id: ban.guild_id, email: ban.email})] : []),
+ ]),
+ );
}
async getBanByEmail(guildId: GuildID, email: string): Promise<GuildBan | null> {
diff --git a/fluxer_api/src/api/guild/services/GuildMemberService.ts b/fluxer_api/src/api/guild/services/GuildMemberService.ts
index 9b498d73b..b261c3f0d 100644
--- a/fluxer_api/src/api/guild/services/GuildMemberService.ts
+++ b/fluxer_api/src/api/guild/services/GuildMemberService.ts
@@ -309,7 +309,6 @@ export class GuildMemberService {
sendJoinMessage?: boolean;
skipGuildLimitCheck?: boolean;
skipBanCheck?: boolean;
- skipRiskGate?: boolean;
isTemporary?: boolean;
joinSourceType?: JoinSourceType;
sourceInviteCode?: InviteCode;
diff --git a/fluxer_api/src/api/guild/services/GuildModerationService.ts b/fluxer_api/src/api/guild/services/GuildModerationService.ts
index 678cb054a..41ee52ffe 100644
--- a/fluxer_api/src/api/guild/services/GuildModerationService.ts
+++ b/fluxer_api/src/api/guild/services/GuildModerationService.ts
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {GuildID, UserID} from '@app/api/BrandedTypes';
+import {getIpBanBlastRadiusVerdict, isSingleIpBanCandidate} from '@app/api/ban/IpBanCgnatGuard';
+import {isIpBanExempt} from '@app/api/ban/IpBanExemptions';
import type {GuildAuditLogService} from '@app/api/guild/GuildAuditLogService';
import type {GuildAuditLogChange} from '@app/api/guild/GuildAuditLogTypes';
import {mapGuildBansToResponse} from '@app/api/guild/GuildModel';
@@ -12,8 +14,6 @@ import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import {Logger} from '@app/api/Logger';
import type {RequestCache} from '@app/api/middleware/RequestCacheMiddleware';
import type {GuildBan} from '@app/api/models/GuildBan';
-import {getIpBanBlastRadiusVerdict, isSingleIpBanCandidate} from '@app/api/risk/IpBanCgnatGuard';
-import {isIpBanExempt} from '@app/api/risk/IpBanExemptions';
import type {IUserRepository} from '@app/api/user/IUserRepository';
import type {WorkerTaskName} from '@app/api/worker/WorkerLaneConfig';
import {AuditLogActionType} from '@fluxer/constants/src/AuditLogActionType';
diff --git a/fluxer_api/src/api/guild/services/member/GuildMemberOperationsService.ts b/fluxer_api/src/api/guild/services/member/GuildMemberOperationsService.ts
index a019b883b..680a5a59e 100644
--- a/fluxer_api/src/api/guild/services/member/GuildMemberOperationsService.ts
+++ b/fluxer_api/src/api/guild/services/member/GuildMemberOperationsService.ts
@@ -3,7 +3,6 @@
import {requireEmailVerified} from '@app/api/auth/EmailVerificationUtils';
import type {GuildID, InviteCode, RoleID, UserID} from '@app/api/BrandedTypes';
import {createChannelID, createRoleID} from '@app/api/BrandedTypes';
-import {Config} from '@app/api/Config';
import type {ChannelService} from '@app/api/channel/services/ChannelService';
import {assertMutableUserId} from '@app/api/constants/Core';
import type {GuildMemberRow} from '@app/api/database/types/GuildTypes';
@@ -16,6 +15,8 @@ import type {GuildMemberAuthService} from '@app/api/guild/services/member/GuildM
import type {GuildMemberEventService} from '@app/api/guild/services/member/GuildMemberEventService';
import type {GuildMemberSearchIndexService} from '@app/api/guild/services/member/GuildMemberSearchIndexService';
import type {GuildMemberValidationService} from '@app/api/guild/services/member/GuildMemberValidationService';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import type {JoinSource} from '@app/api/infrastructure/activity/Contract.generated';
import {contentModerationService} from '@app/api/infrastructure/ContentModerationService';
import type {EntityAssetService, PreparedAssetUpload} from '@app/api/infrastructure/EntityAssetService';
import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
@@ -26,24 +27,13 @@ import {resolveLimitSafe} from '@app/api/limits/LimitConfigUtils';
import {createLimitMatchContext} from '@app/api/limits/LimitMatchContextBuilder';
import {profileSubstringBlocklistCache} from '@app/api/middleware/ProfileSubstringBlocklistCache';
import type {RequestCache} from '@app/api/middleware/RequestCacheMiddleware';
-import type {Guild} from '@app/api/models/Guild';
import type {GuildMember} from '@app/api/models/GuildMember';
import type {User} from '@app/api/models/User';
import type {UserGuildSettings} from '@app/api/models/UserGuildSettings';
import type {UserSettings} from '@app/api/models/UserSettings';
-import {
- DEFAULT_PHONE_GATE_MEMBER_THRESHOLD,
- evaluateDeferredPhoneGate,
- getDeferredPhoneGateConfig,
- guildTriggersPhoneGate,
-} from '@app/api/risk/DeferredPhoneGate';
import type {IUserRepository} from '@app/api/user/IUserRepository';
-import {getEffectiveSuspiciousFlags, isProfileSubstringExempt} from '@app/api/user/UserHelpers';
-import {
- mapUserGuildSettingsToResponse,
- mapUserSettingsToResponse,
- mapUserToPrivateResponse,
-} from '@app/api/user/UserMappers';
+import {isProfileSubstringExempt} from '@app/api/user/UserHelpers';
+import {mapUserGuildSettingsToResponse, mapUserSettingsToResponse} from '@app/api/user/UserMappers';
import {addGuildToUncategorizedFolder, removeGuildFromUserFolders} from '@app/api/user/utils/GuildFolderUtils';
import {AuditLogActionType} from '@fluxer/constants/src/AuditLogActionType';
import {Permissions} from '@fluxer/constants/src/ChannelConstants';
@@ -55,9 +45,7 @@ import {
} from '@fluxer/constants/src/GuildConstants';
import {
DEFAULT_GUILD_FOLDER_ICON,
- DEFERRED_PHONE_ON_COMMUNITY_JOIN,
type MentionReplyPreference,
- PHONE_REQUIREMENT_FLAGS,
UserNotificationSettings,
} from '@fluxer/constants/src/UserConstants';
import {ValidationErrorCodes} from '@fluxer/constants/src/ValidationErrorCodes';
@@ -69,12 +57,10 @@ import {MaxGuildsError} from '@fluxer/errors/src/domains/guild/MaxGuildsError';
import {UnknownGuildError} from '@fluxer/errors/src/domains/guild/UnknownGuildError';
import {UnknownGuildMemberError} from '@fluxer/errors/src/domains/guild/UnknownGuildMemberError';
import {CommunicationDisabledError} from '@fluxer/errors/src/domains/moderation/CommunicationDisabledError';
-import {AccountSuspiciousActivityError} from '@fluxer/errors/src/domains/user/AccountSuspiciousActivityError';
import {UserNotInVoiceError} from '@fluxer/errors/src/domains/user/UserNotInVoiceError';
import {DEFAULT_STOCK_LIMITS} from '@fluxer/limits/src/LimitDefaults';
import type {GuildMemberResponse} from '@fluxer/schema/src/domains/guild/GuildMemberSchemas';
import type {GuildMemberUpdateRequest} from '@fluxer/schema/src/domains/guild/GuildRequestSchemas';
-import {snowflakeToDate} from '@fluxer/snowflake/src/Snowflake';
import type {IRateLimitService} from '@pkgs/rate_limit/src/IRateLimitService';
import {ms} from 'itty-time';
@@ -136,6 +122,25 @@ function hasSelfProfileCustomizationUpdate(
return EMAIL_VERIFICATION_REQUIRED_SELF_PROFILE_FIELDS.some((field) => data[field] !== undefined);
}
+function joinSourceName(type: JoinSourceType): JoinSource {
+ switch (type) {
+ case JoinSourceTypes.CREATOR:
+ return 'creator';
+ case JoinSourceTypes.INSTANT_INVITE:
+ return 'invite';
+ case JoinSourceTypes.VANITY_URL:
+ return 'vanity';
+ case JoinSourceTypes.BOT_INVITE:
+ return 'bot_invite';
+ case JoinSourceTypes.ADMIN_FORCE_ADD:
+ return 'admin_force_add';
+ case JoinSourceTypes.DISCOVERY:
+ return 'discovery';
+ default:
+ return 'other';
+ }
+}
+
export class GuildMemberOperationsService {
constructor(
private readonly guildRepository: IGuildRepositoryAggregate,
@@ -406,75 +411,6 @@ export class GuildMemberOperationsService {
await this.gatewayService.leaveGuild({userId: targetId, guildId});
}
- private async applyDeferredPhoneGate(user: User, guild: Guild): Promise<void> {
- if (user.hasVerifiedPhone) {
- return;
- }
- const rawFlags = user.suspiciousActivityFlags ?? 0;
- if ((rawFlags & (DEFERRED_PHONE_ON_COMMUNITY_JOIN | PHONE_REQUIREMENT_FLAGS)) === 0) {
- return;
- }
- const {status, config} = await getDeferredPhoneGateConfig();
- const logContext = {
- userId: user.id.toString(),
- guildId: guild.id.toString(),
- discoverable: guild.features.has(GuildFeatures.DISCOVERABLE),
- memberCount: guild.memberCount,
- accountAgeMs: Date.now() - snowflakeToDate(BigInt(user.id)).getTime(),
- };
- if (
- !Config.abusePolicy.phoneFlagging.enabled &&
- (getEffectiveSuspiciousFlags(user) & PHONE_REQUIREMENT_FLAGS) === 0
- ) {
- Logger.info(logContext, 'deferred_phone_gate.skipped_phone_flagging_disabled');
- return;
- }
- if (status !== 'ok') {
- const undeferredFlags = getEffectiveSuspiciousFlags({
- ...user,
- suspiciousActivityFlags: rawFlags & ~DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- } as User);
- if (
- (undeferredFlags & PHONE_REQUIREMENT_FLAGS) === 0 ||
- !guildTriggersPhoneGate(guild, DEFAULT_PHONE_GATE_MEMBER_THRESHOLD)
- ) {
- return;
- }
- Logger.info(logContext, `deferred_phone_gate.enforced_while_${status}`);
- throw new AccountSuspiciousActivityError(undeferredFlags);
- }
- const liveFlags = getEffectiveSuspiciousFlags(user);
- if ((liveFlags & PHONE_REQUIREMENT_FLAGS) !== 0) {
- if (!guildTriggersPhoneGate(guild, config.memberThreshold)) {
- return;
- }
- Logger.info(logContext, 'deferred_phone_gate.blocked_unsatisfied_phone_requirement');
- throw new AccountSuspiciousActivityError(liveFlags);
- }
- const outcome = evaluateDeferredPhoneGate(user, guild, config, Date.now());
- if (!outcome.applies) {
- Logger.info(logContext, `deferred_phone_gate.skipped_${outcome.reason}`);
- return;
- }
- const promotedFlags = getEffectiveSuspiciousFlags({...user, suspiciousActivityFlags: outcome.flags} as User);
- if (promotedFlags === 0) {
- Logger.info(logContext, 'deferred_phone_gate.skipped_unenforceable');
- return;
- }
- const updatedUser = await this.userRepository.patchUpsert(
- user.id,
- {suspicious_activity_flags: outcome.flags},
- user.toRow(),
- );
- await this.gatewayService.dispatchPresence({
- userId: user.id,
- event: 'USER_UPDATE',
- data: mapUserToPrivateResponse(updatedUser),
- });
- Logger.info(logContext, 'deferred_phone_gate.applied');
- throw new AccountSuspiciousActivityError(promotedFlags);
- }
-
async addUserToGuild(
params: {
userId: UserID;
@@ -482,7 +418,6 @@ export class GuildMemberOperationsService {
sendJoinMessage?: boolean;
skipGuildLimitCheck?: boolean;
skipBanCheck?: boolean;
- skipRiskGate?: boolean;
isTemporary?: boolean;
joinSourceType?: JoinSourceType;
sourceInviteCode?: InviteCode;
@@ -500,7 +435,6 @@ export class GuildMemberOperationsService {
sendJoinMessage = true,
skipGuildLimitCheck = false,
skipBanCheck = false,
- skipRiskGate = false,
isTemporary = false,
joinSourceType = JoinSourceTypes.INSTANT_INVITE,
sourceInviteCode = null,
@@ -522,9 +456,6 @@ export class GuildMemberOperationsService {
if (!skipGuildLimitCheck) {
await this.enforceGuildLimit(user, userGuildsCount);
}
- if (!skipRiskGate && !user.isBot) {
- await this.applyDeferredPhoneGate(user, guild);
- }
const maxGuildMembers = resolveMaxGuildMembersLimit({
guildFeatures: guild.features,
snapshot: this.limitConfigService.getConfigSnapshot(),
@@ -571,6 +502,15 @@ export class GuildMemberOperationsService {
if (sendJoinMessage && !(guild.systemChannelFlags & SystemChannelFlags.SUPPRESS_JOIN_NOTIFICATIONS)) {
await this.channelService.messages.system.sendJoinSystemMessage({guildId, userId, requestCache});
}
+ void emitActivity('guild_joined', userId.toString(), {
+ user_id: userId.toString(),
+ guild_id: guildId.toString(),
+ member_count: guild.memberCount + 1,
+ discoverable: guild.features.has(GuildFeatures.DISCOVERABLE),
+ invite_code: sourceInviteCode,
+ inviter_id: inviterId ? inviterId.toString() : null,
+ join_source: joinSourceName(joinSourceType),
+ });
if (user.isBot) {
await this.recordGuildAuditLog({
guildId,
diff --git a/fluxer_api/src/api/guild/services/member/GuildMemberValidationService.ts b/fluxer_api/src/api/guild/services/member/GuildMemberValidationService.ts
index 2c5fdfcdc..210c3881b 100644
--- a/fluxer_api/src/api/guild/services/member/GuildMemberValidationService.ts
+++ b/fluxer_api/src/api/guild/services/member/GuildMemberValidationService.ts
@@ -2,11 +2,11 @@
import type {GuildID, RoleID, UserID} from '@app/api/BrandedTypes';
import {guildIdToRoleId} from '@app/api/BrandedTypes';
+import {getIpBanBlastRadiusVerdict, isSingleIpBanCandidate} from '@app/api/ban/IpBanCgnatGuard';
+import {isIpBanExempt} from '@app/api/ban/IpBanExemptions';
import type {IGuildRepositoryAggregate} from '@app/api/guild/repositories/IGuildRepositoryAggregate';
import {Logger} from '@app/api/Logger';
import type {GuildMember} from '@app/api/models/GuildMember';
-import {getIpBanBlastRadiusVerdict, isSingleIpBanCandidate} from '@app/api/risk/IpBanCgnatGuard';
-import {isIpBanExempt} from '@app/api/risk/IpBanExemptions';
import type {IUserRepository} from '@app/api/user/IUserRepository';
import {Permissions} from '@fluxer/constants/src/ChannelConstants';
import {ValidationErrorCodes} from '@fluxer/constants/src/ValidationErrorCodes';
diff --git a/fluxer_api/src/api/infrastructure/activity/AccountChangeEvents.ts b/fluxer_api/src/api/infrastructure/activity/AccountChangeEvents.ts
new file mode 100644
index 000000000..a76970a42
--- /dev/null
+++ b/fluxer_api/src/api/infrastructure/activity/AccountChangeEvents.ts
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createHash} from 'node:crypto';
+import type {UserRow} from '@app/api/database/types/UserTypes';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import {currentAccountChangeSource} from '@app/api/infrastructure/activity/ActivityMeta';
+import type {AdminActionKind, ChangeSource} from '@app/api/infrastructure/activity/Contract.generated';
+
+function timeMs(value: Date | null | undefined): number | null {
+ return value ? value.getTime() : null;
+}
+
+function isRelevantChange(previous: UserRow, updated: UserRow): boolean {
+ return (
+ (previous.flags ?? 0n) !== (updated.flags ?? 0n) ||
+ (previous.suspicious_activity_flags ?? 0) !== (updated.suspicious_activity_flags ?? 0) ||
+ (previous.has_verified_phone ?? false) !== (updated.has_verified_phone ?? false) ||
+ timeMs(previous.temp_banned_until) !== timeMs(updated.temp_banned_until) ||
+ timeMs(previous.pending_deletion_at) !== timeMs(updated.pending_deletion_at) ||
+ (previous.deletion_reason_code ?? null) !== (updated.deletion_reason_code ?? null)
+ );
+}
+
+export async function emitAccountChangedIfRelevant(
+ previous: UserRow | null,
+ updated: UserRow,
+ source?: ChangeSource,
+): Promise<void> {
+ if (!previous || !isRelevantChange(previous, updated)) return;
+ const userId = updated.user_id.toString();
+ const data = {
+ user_id: userId,
+ source: source ?? currentAccountChangeSource(),
+ flags: (updated.flags ?? 0n).toString(),
+ flags_before: (previous.flags ?? 0n).toString(),
+ suspicious_flags: updated.suspicious_activity_flags ?? 0,
+ suspicious_flags_before: previous.suspicious_activity_flags ?? 0,
+ has_verified_phone: updated.has_verified_phone ?? false,
+ temp_banned_until_ms: timeMs(updated.temp_banned_until),
+ pending_deletion_at_ms: timeMs(updated.pending_deletion_at),
+ deletion_reason_code: updated.deletion_reason_code ?? null,
+ };
+ const digest = createHash('sha256').update(JSON.stringify(data)).digest('base64url').slice(0, 16);
+ await emitActivity('account_changed', userId, data, null, `${userId}:${updated.version}:${digest}`);
+}
+
+export async function emitAdminAction(
+ adminId: bigint,
+ targetId: bigint,
+ action: AdminActionKind,
+ details: {reasonCode?: number | null; durationHours?: number | null; ips?: Iterable<string>} = {},
+): Promise<void> {
+ const target = targetId.toString();
+ await emitActivity('admin_action', target, {
+ admin_id: adminId.toString(),
+ target_id: target,
+ action,
+ reason_code: details.reasonCode ?? null,
+ duration_h: details.durationHours ?? null,
+ ips: [...(details.ips ?? [])],
+ });
+}
diff --git a/fluxer_api/src/api/infrastructure/activity/ActivityEvents.ts b/fluxer_api/src/api/infrastructure/activity/ActivityEvents.ts
new file mode 100644
index 000000000..974ba0991
--- /dev/null
+++ b/fluxer_api/src/api/infrastructure/activity/ActivityEvents.ts
@@ -0,0 +1,359 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {currentActivityMeta} from '@app/api/infrastructure/activity/ActivityMeta';
+import {
+ ACTIVITY_SPOOL_KEY,
+ type ActivityDrainResult,
+ type ActivityPublisher,
+ type ActivitySpoolEntry,
+ drainActivitySpool,
+ spoolActivity,
+} from '@app/api/infrastructure/activity/ActivitySpool';
+import {
+ type Body,
+ EVENT_CLASS,
+ EVENT_MAJOR,
+ EVENT_TTL,
+ EVENTS_STREAM,
+ type EventKind,
+ eventSubject,
+ HEADER,
+ type Meta,
+} from '@app/api/infrastructure/activity/Contract.generated';
+import {Logger} from '@app/api/Logger';
+import {createSnowflake} from '@fluxer/snowflake/src/Snowflake';
+import {JetStreamApiError, type JetStreamClient, type JetStreamManager} from '@nats-io/jetstream';
+import {headers} from '@nats-io/transport-node';
+import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
+
+export type ActivityData<K extends EventKind> = Extract<Body, {kind: K}>['data'];
+type ActivityResult = 'published' | 'spooled' | 'dropped' | 'rejected';
+type ActivityKv = Pick<IKVProvider, 'rpush' | 'llen' | 'lrange' | 'ltrim'>;
+
+const PUBLISH_TIMEOUT_MS = 1000;
+const RETRY_DELAYS_MS = [100, 400];
+const QUEUE_CAPACITY = 20_000;
+const QUEUE_CONCURRENCY = 64;
+const STREAM_PROBE_INTERVAL_MS = 15_000;
+const STREAM_REPROBE_INTERVAL_MS = 2_000;
+const STREAM_NOT_FOUND = 10059;
+const SPOOL_DEPTH_INTERVAL_MS = 15_000;
+
+interface PendingActivity {
+ entry: ActivitySpoolEntry;
+ always: boolean;
+}
+
+type StreamState = 'present' | 'missing' | 'unknown';
+type EmitMode = 'publish' | 'spool' | 'off';
+
+interface ActivityRuntime {
+ publisher: ActivityPublisher;
+ kv: ActivityKv;
+ mode: () => EmitMode;
+ stop: () => void;
+}
+
+let runtime: ActivityRuntime | null = null;
+const queue: Array<PendingActivity> = [];
+let inFlight = 0;
+let idleWaiters: Array<() => void> = [];
+const counts = new Map<string, number>();
+const drainCounts = new Map<string, number>();
+let spoolDepth = 0;
+
+function delay(ms: number): Promise<void> {
+ return new Promise((resolve) => {
+ setTimeout(resolve, ms).unref?.();
+ });
+}
+
+function count(kind: EventKind, result: ActivityResult): void {
+ const key = `kind="${kind}",result="${result}"`;
+ counts.set(key, (counts.get(key) ?? 0) + 1);
+}
+
+function isRejection(error: unknown): boolean {
+ return error instanceof JetStreamApiError || (error instanceof Error && error.name === 'JetStreamNotEnabled');
+}
+
+export function jetStreamActivityPublisher(js: JetStreamClient): ActivityPublisher {
+ return {
+ async publish(subject, payload, options) {
+ const h = headers();
+ if (options.spooled) h.set(HEADER.spooled, '1');
+ await js.publish(subject, payload, {
+ msgID: options.msgID,
+ ttl: options.ttl,
+ timeout: PUBLISH_TIMEOUT_MS,
+ headers: h,
+ });
+ },
+ };
+}
+
+function freshActivityId(nowMs = Date.now()): string {
+ return createSnowflake({
+ timestamp: nowMs,
+ workerId: Math.floor(Math.random() * 1024),
+ sequence: Math.floor(Math.random() * 4096),
+ }).toString();
+}
+
+async function publishWithRetry(publisher: ActivityPublisher, entry: ActivitySpoolEntry): Promise<ActivityResult> {
+ for (let attempt = 0; ; attempt++) {
+ try {
+ await publisher.publish(entry.subject, entry.data, {msgID: entry.id, ttl: entry.ttl, spooled: false});
+ return 'published';
+ } catch (error) {
+ if (isRejection(error)) {
+ Logger.warn({err: error, kind: entry.kind}, 'Activity event publish rejected');
+ return 'rejected';
+ }
+ const wait = RETRY_DELAYS_MS[attempt];
+ if (wait === undefined) {
+ Logger.warn({err: error, kind: entry.kind}, 'Activity event publish failed');
+ return 'spooled';
+ }
+ await delay(wait);
+ }
+ }
+}
+
+async function spool(kv: ActivityKv, entry: ActivitySpoolEntry, always: boolean): Promise<boolean> {
+ try {
+ const outcome = await spoolActivity(kv, entry, always);
+ if (outcome === 'dropped') {
+ count(entry.kind, 'dropped');
+ return false;
+ }
+ spoolDepth++;
+ return true;
+ } catch (error) {
+ Logger.error({err: error, kind: entry.kind, id: entry.id}, 'Activity event could not be spooled');
+ count(entry.kind, 'dropped');
+ return false;
+ }
+}
+
+async function deliver(item: PendingActivity): Promise<void> {
+ const active = runtime;
+ if (!active) {
+ count(item.entry.kind, 'dropped');
+ return;
+ }
+ const result = await publishWithRetry(active.publisher, item.entry);
+ if (result === 'published') {
+ count(item.entry.kind, 'published');
+ return;
+ }
+ if (result === 'rejected') count(item.entry.kind, 'rejected');
+ if ((await spool(active.kv, item.entry, item.always)) && result === 'spooled') {
+ count(item.entry.kind, 'spooled');
+ }
+}
+
+function pump(): void {
+ while (inFlight < QUEUE_CONCURRENCY && queue.length > 0) {
+ const item = queue.shift()!;
+ inFlight++;
+ void deliver(item).finally(() => {
+ inFlight--;
+ pump();
+ });
+ }
+ if (inFlight === 0 && queue.length === 0) {
+ const waiters = idleWaiters;
+ idleWaiters = [];
+ for (const resolve of waiters) resolve();
+ }
+}
+
+async function buildEntry<K extends EventKind>(
+ kind: K,
+ key: string,
+ data: ActivityData<K>,
+ meta: Meta | null,
+ naturalId: string | null,
+ atMs: number,
+): Promise<ActivitySpoolEntry> {
+ const id = `${kind}:${naturalId ?? freshActivityId(atMs)}`;
+ const event = {
+ v: EVENT_MAJOR[kind],
+ id,
+ at_ms: atMs,
+ key,
+ meta: meta ?? (await currentActivityMeta()),
+ kind,
+ data,
+ };
+ return {kind, subject: eventSubject(kind, key), id, ttl: EVENT_TTL[kind], at_ms: atMs, data: JSON.stringify(event)};
+}
+
+export async function emitActivity<K extends EventKind>(
+ kind: K,
+ key: string,
+ data: ActivityData<K>,
+ meta: Meta | null = null,
+ naturalId: string | null = null,
+): Promise<void> {
+ const active = runtime;
+ if (!active) return;
+ const mode = active.mode();
+ if (mode === 'off') {
+ count(kind, 'dropped');
+ return;
+ }
+ const fact = EVENT_CLASS[kind] === 'fact';
+ try {
+ const entry = await buildEntry(kind, key, data, meta, naturalId, Date.now());
+ if (mode === 'spool') {
+ if (await spool(active.kv, entry, fact)) count(kind, 'rejected');
+ return;
+ }
+ if (fact) {
+ await deliver({entry, always: true});
+ return;
+ }
+ if (queue.length >= QUEUE_CAPACITY) {
+ if (runtime && (await spool(runtime.kv, entry, false))) count(kind, 'spooled');
+ return;
+ }
+ queue.push({entry, always: false});
+ pump();
+ } catch (error) {
+ Logger.error({err: error, kind}, 'Activity event could not be built');
+ count(kind, 'dropped');
+ }
+}
+
+export function idleActivityEvents(): Promise<void> {
+ if (inFlight === 0 && queue.length === 0) return Promise.resolve();
+ return new Promise((resolve) => {
+ idleWaiters.push(resolve);
+ });
+}
+
+export async function drainActivitySpoolNow(
+ options: {budgetMs?: number; keepLock?: () => Promise<boolean>} = {},
+): Promise<ActivityDrainResult | null> {
+ const active = runtime;
+ if (active?.mode() !== 'publish') return null;
+ const result = await drainActivitySpool(active.publisher, active.kv, options);
+ spoolDepth = result.remaining;
+ for (const [name, value] of [
+ ['published', result.published],
+ ['expired', result.expired],
+ ['failed', result.failed],
+ ] as const) {
+ if (value > 0) drainCounts.set(name, (drainCounts.get(name) ?? 0) + value);
+ }
+ return result;
+}
+
+export interface ActivityEventsOptions {
+ publisher: ActivityPublisher;
+ kv: ActivityKv;
+ jsm?: Pick<JetStreamManager, 'streams'> | null;
+ spoolWhileMissing?: boolean;
+}
+
+async function probeStream(jsm: Pick<JetStreamManager, 'streams'>): Promise<StreamState> {
+ try {
+ await jsm.streams.info(EVENTS_STREAM);
+ return 'present';
+ } catch (error) {
+ if (error instanceof JetStreamApiError && error.code === STREAM_NOT_FOUND) return 'missing';
+ Logger.warn({err: error}, 'Activity stream probe failed');
+ return 'unknown';
+ }
+}
+
+export async function startActivityEvents(options: ActivityEventsOptions): Promise<void> {
+ stopActivityEvents();
+ const {jsm} = options;
+ let state: StreamState = jsm ? await probeStream(jsm) : 'present';
+ const timers: Array<ReturnType<typeof setTimeout>> = [];
+ const whenMissing: EmitMode = options.spoolWhileMissing ? 'spool' : 'off';
+ let stopped = false;
+ const schedule = (probe: Pick<JetStreamManager, 'streams'>) => {
+ if (stopped || state === 'present') return;
+ const wait = state === 'unknown' ? STREAM_REPROBE_INTERVAL_MS : STREAM_PROBE_INTERVAL_MS;
+ const timer = setTimeout(() => {
+ void probeStream(probe).then((next) => {
+ if (next !== state) Logger.info({stream: EVENTS_STREAM, state: next}, 'Activity stream state changed');
+ state = next;
+ schedule(probe);
+ });
+ }, wait);
+ timer.unref?.();
+ timers.push(timer);
+ };
+ if (jsm && state !== 'present') {
+ Logger.info({stream: EVENTS_STREAM, state}, 'Activity stream not confirmed, probing until it exists');
+ schedule(jsm);
+ }
+ const depth = setInterval(() => {
+ void options.kv
+ .llen(ACTIVITY_SPOOL_KEY)
+ .then((value) => {
+ spoolDepth = value;
+ })
+ .catch(() => undefined);
+ }, SPOOL_DEPTH_INTERVAL_MS);
+ depth.unref?.();
+ timers.push(depth);
+ runtime = {
+ publisher: options.publisher,
+ kv: options.kv,
+ mode: () => (state === 'missing' ? whenMissing : 'publish'),
+ stop: () => {
+ stopped = true;
+ for (const timer of timers) {
+ clearTimeout(timer);
+ clearInterval(timer);
+ }
+ },
+ };
+}
+
+export async function shutdownActivityEvents(timeoutMs = 2000): Promise<void> {
+ await Promise.race([idleActivityEvents(), delay(timeoutMs)]);
+ stopActivityEvents();
+}
+
+export function stopActivityEvents(): void {
+ runtime?.stop();
+ runtime = null;
+}
+
+export function renderActivityMetrics(): string {
+ const lines = [
+ '# HELP fluxer_api_activity_events_total Activity events by kind and result',
+ '# TYPE fluxer_api_activity_events_total counter',
+ ...[...counts].map(([labels, value]) => `fluxer_api_activity_events_total{${labels}} ${value}`),
+ '# HELP fluxer_api_activity_spool_depth Activity events waiting in the spool',
+ '# TYPE fluxer_api_activity_spool_depth gauge',
+ `fluxer_api_activity_spool_depth ${spoolDepth}`,
+ '# HELP fluxer_api_activity_spool_drained_total Spooled activity events by drain result',
+ '# TYPE fluxer_api_activity_spool_drained_total counter',
+ ...[...drainCounts].map(
+ ([result, value]) => `fluxer_api_activity_spool_drained_total{result="${result}"} ${value}`,
+ ),
+ ];
+ return lines.join('\n');
+}
+
+export function resetActivityEventsForTests(): void {
+ stopActivityEvents();
+ queue.length = 0;
+ inFlight = 0;
+ idleWaiters = [];
+ counts.clear();
+ drainCounts.clear();
+ spoolDepth = 0;
+}
+
+export function activityCountForTests(kind: EventKind, result: ActivityResult): number {
+ return counts.get(`kind="${kind}",result="${result}"`) ?? 0;
+}
diff --git a/fluxer_api/src/api/infrastructure/activity/ActivityMeta.ts b/fluxer_api/src/api/infrastructure/activity/ActivityMeta.ts
new file mode 100644
index 000000000..2d25f6005
--- /dev/null
+++ b/fluxer_api/src/api/infrastructure/activity/ActivityMeta.ts
@@ -0,0 +1,86 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {AsyncLocalStorage} from 'node:async_hooks';
+import type {ChangeSource, Channel, Meta} from '@app/api/infrastructure/activity/Contract.generated';
+import {Logger} from '@app/api/Logger';
+import type {HonoEnv} from '@app/api/types/HonoEnv';
+import {lookupGeoip} from '@app/api/utils/IpUtils';
+import {getRequestClientIp} from '@app/api/utils/RequestClientIp';
+import {stripApiPrefix} from '@app/api/utils/RequestPathUtils';
+import {parseAcceptLanguage} from '@pkgs/locale/src/LocaleService';
+import type {Context} from 'hono';
+import {createMiddleware} from 'hono/factory';
+
+const CANARY_ORIGINS = new Set(['https://canary.fluxer.com', 'https://web.canary.fluxer.app']);
+const UA_MAX_CHARS = 512;
+
+export interface ActivityRequestContext {
+ ip: string | null;
+ ua: string | null;
+ locale: string | null;
+ requestId: string | null;
+ channel: Channel;
+ source: ChangeSource;
+}
+
+const requestContext = new AsyncLocalStorage<ActivityRequestContext>();
+const sourceContext = new AsyncLocalStorage<ChangeSource>();
+let processChannel: Channel = 'other';
+
+export function setActivityProcessChannel(channel: Channel): void {
+ processChannel = channel;
+}
+
+export function activityMetaFromContext(ctx: Context<HonoEnv>): ActivityRequestContext {
+ const origin = ctx.req.header('origin');
+ const ua = ctx.req.header('user-agent');
+ const acceptLanguage = ctx.req.header('accept-language');
+ return {
+ ip: getRequestClientIp(ctx),
+ ua: ua ? ua.slice(0, UA_MAX_CHARS) : null,
+ locale: acceptLanguage ? parseAcceptLanguage(acceptLanguage) : null,
+ requestId: ctx.get('requestId') ?? null,
+ channel: origin && CANARY_ORIGINS.has(origin) ? 'canary' : 'stable',
+ source: stripApiPrefix(ctx.req.path).startsWith('/admin/') ? 'admin' : 'other',
+ };
+}
+
+export const ActivityContextMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
+ await requestContext.run(activityMetaFromContext(ctx), next);
+});
+
+export function withAccountChangeSource<T>(source: ChangeSource, fn: () => T): T {
+ return sourceContext.run(source, fn);
+}
+
+export function currentAccountChangeSource(): ChangeSource {
+ return sourceContext.getStore() ?? requestContext.getStore()?.source ?? 'other';
+}
+
+export function workerMeta(): Meta {
+ return {ip: null, country: null, ua: null, locale: null, channel: 'worker', request_id: null};
+}
+
+async function countryOf(ip: string): Promise<string | null> {
+ try {
+ return (await lookupGeoip(ip)).countryCode;
+ } catch (error) {
+ Logger.debug({error}, 'Activity meta country lookup failed');
+ return null;
+ }
+}
+
+export async function currentActivityMeta(): Promise<Meta> {
+ const context = requestContext.getStore();
+ if (!context) {
+ return {...workerMeta(), channel: processChannel};
+ }
+ return {
+ ip: context.ip,
+ country: context.ip ? await countryOf(context.ip) : null,
+ ua: context.ua,
+ locale: context.locale,
+ channel: context.channel,
+ request_id: context.requestId,
+ };
+}
diff --git a/fluxer_api/src/api/infrastructure/activity/ActivitySpool.ts b/fluxer_api/src/api/infrastructure/activity/ActivitySpool.ts
new file mode 100644
index 000000000..a5bf94c59
--- /dev/null
+++ b/fluxer_api/src/api/infrastructure/activity/ActivitySpool.ts
@@ -0,0 +1,121 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import type {EventKind} from '@app/api/infrastructure/activity/Contract.generated';
+import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
+
+export const ACTIVITY_SPOOL_KEY = 'activity:spool';
+export const ACTIVITY_SPOOL_SIGNAL_CAP = 200_000;
+export const ACTIVITY_SPOOL_MAX_AGE_MS = 7 * 24 * 60 * 60 * 1000;
+const DRAIN_BATCH = 200;
+export const DRAIN_BUDGET_MS = 15_000;
+
+export interface ActivitySpoolEntry {
+ kind: EventKind;
+ subject: string;
+ id: string;
+ ttl: string;
+ at_ms: number;
+ data: string;
+}
+
+export interface ActivityPublishOptions {
+ msgID: string;
+ ttl: string;
+ spooled: boolean;
+}
+
+export interface ActivityPublisher {
+ publish(subject: string, payload: string, options: ActivityPublishOptions): Promise<void>;
+}
+
+type SpoolStore = Pick<IKVProvider, 'rpush' | 'llen' | 'lrange' | 'ltrim'>;
+
+export interface ActivityDrainResult {
+ published: number;
+ expired: number;
+ failed: number;
+ remaining: number;
+ error: unknown;
+}
+
+export async function spoolActivity(
+ kv: SpoolStore,
+ entry: ActivitySpoolEntry,
+ always: boolean,
+): Promise<'spooled' | 'dropped'> {
+ if (!always && (await kv.llen(ACTIVITY_SPOOL_KEY)) >= ACTIVITY_SPOOL_SIGNAL_CAP) {
+ return 'dropped';
+ }
+ await kv.rpush(ACTIVITY_SPOOL_KEY, JSON.stringify(entry));
+ return 'spooled';
+}
+
+function parseJson(raw: string): unknown {
+ try {
+ return JSON.parse(raw);
+ } catch {
+ return null;
+ }
+}
+
+function parseEntry(raw: string): ActivitySpoolEntry | null {
+ const value = parseJson(raw) as Partial<ActivitySpoolEntry> | null;
+ if (
+ value &&
+ typeof value.subject === 'string' &&
+ typeof value.id === 'string' &&
+ typeof value.ttl === 'string' &&
+ typeof value.at_ms === 'number' &&
+ typeof value.data === 'string'
+ ) {
+ return value as ActivitySpoolEntry;
+ }
+ return null;
+}
+
+export async function drainActivitySpool(
+ publisher: ActivityPublisher,
+ kv: SpoolStore,
+ options: {nowMs?: () => number; budgetMs?: number; keepLock?: () => Promise<boolean>} = {},
+): Promise<ActivityDrainResult> {
+ const now = options.nowMs ?? Date.now;
+ const deadline = now() + (options.budgetMs ?? DRAIN_BUDGET_MS);
+ const result: ActivityDrainResult = {published: 0, expired: 0, failed: 0, remaining: 0, error: null};
+ while (now() < deadline) {
+ const batch = await kv.lrange(ACTIVITY_SPOOL_KEY, 0, DRAIN_BATCH - 1);
+ if (batch.length === 0) break;
+ let consumed = 0;
+ for (const raw of batch) {
+ if (now() >= deadline) break;
+ const entry = parseEntry(raw);
+ if (!entry) {
+ result.failed++;
+ consumed++;
+ continue;
+ }
+ if (entry.at_ms < now() - ACTIVITY_SPOOL_MAX_AGE_MS) {
+ result.expired++;
+ consumed++;
+ continue;
+ }
+ try {
+ await publisher.publish(entry.subject, entry.data, {msgID: entry.id, ttl: entry.ttl, spooled: true});
+ } catch (error) {
+ result.error = error;
+ break;
+ }
+ result.published++;
+ consumed++;
+ }
+ if (consumed > 0) {
+ if (options.keepLock && !(await options.keepLock())) {
+ result.error = new Error('activity spool drain lock lost before trim');
+ break;
+ }
+ await kv.ltrim(ACTIVITY_SPOOL_KEY, consumed, -1);
+ }
+ if (result.error !== null || consumed < batch.length) break;
+ }
+ result.remaining = await kv.llen(ACTIVITY_SPOOL_KEY);
+ return result;
+}
diff --git a/fluxer_api/src/api/infrastructure/activity/Contract.generated.ts b/fluxer_api/src/api/infrastructure/activity/Contract.generated.ts
new file mode 100644
index 000000000..529705531
--- /dev/null
+++ b/fluxer_api/src/api/infrastructure/activity/Contract.generated.ts
@@ -0,0 +1,158 @@
+import {createHash} from 'node:crypto';
+
+export type Id = string;
+export type Flags64 = string;
+export type Channel = "stable" | "canary" | "worker" | "internal" | "import" | "other";
+export type Meta = { ip: string | null, country: string | null, ua: string | null, locale: string | null, channel: Channel, request_id: string | null, };
+export type Kind = "registration" | "email_changed" | "profile_updated" | "account_changed" | "admin_action" | "account_deleted" | "report_filed" | "email_bounced" | "action_outcome" | "login" | "session_started" | "guild_joined" | "dm_opened" | "message_created" | "friend_request" | "http_errors" | "user_blocked";
+export type Event = { v: number, id: string, at_ms: number, key: string, meta: Meta, } & ({ "kind": "registration", "data": Registration } | { "kind": "email_changed", "data": EmailChanged } | { "kind": "profile_updated", "data": ProfileUpdated } | { "kind": "account_changed", "data": AccountChanged } | { "kind": "admin_action", "data": AdminAction } | { "kind": "account_deleted", "data": AccountDeleted } | { "kind": "report_filed", "data": ReportFiled } | { "kind": "email_bounced", "data": EmailBounced } | { "kind": "action_outcome", "data": ActionOutcome } | { "kind": "login", "data": Login } | { "kind": "session_started", "data": SessionStarted } | { "kind": "guild_joined", "data": GuildJoined } | { "kind": "dm_opened", "data": DmOpened } | { "kind": "message_created", "data": MessageCreated } | { "kind": "friend_request", "data": FriendRequest } | { "kind": "http_errors", "data": HttpErrors } | { "kind": "user_blocked", "data": UserBlocked });
+export type Body = { "kind": "registration", "data": Registration } | { "kind": "email_changed", "data": EmailChanged } | { "kind": "profile_updated", "data": ProfileUpdated } | { "kind": "account_changed", "data": AccountChanged } | { "kind": "admin_action", "data": AdminAction } | { "kind": "account_deleted", "data": AccountDeleted } | { "kind": "report_filed", "data": ReportFiled } | { "kind": "email_bounced", "data": EmailBounced } | { "kind": "action_outcome", "data": ActionOutcome } | { "kind": "login", "data": Login } | { "kind": "session_started", "data": SessionStarted } | { "kind": "guild_joined", "data": GuildJoined } | { "kind": "dm_opened", "data": DmOpened } | { "kind": "message_created", "data": MessageCreated } | { "kind": "friend_request", "data": FriendRequest } | { "kind": "http_errors", "data": HttpErrors } | { "kind": "user_blocked", "data": UserBlocked };
+export type Registration = { user_id: Id, method: RegMethod, email: string | null, username: string, username_user_chosen: boolean, global_name: string | null, locale: string | null, timezone: string | null, invite_code: string | null, suspicious_flags: number, flags: Flags64, };
+export type RegMethod = "password" | "unclaimed" | "oauth" | "other";
+export type EmailChanged = { user_id: Id, new_email: string, was_unclaimed: boolean, has_ever_purchased: boolean, suspicious_flags: number, suspicious_flags_before: number | null, };
+export type ProfileUpdated = { user_id: Id, username: string | null, global_name: string | null, bio: string | null, avatar_hash: string | null, pronouns: string | null, };
+export type AccountChanged = { user_id: Id, source: ChangeSource, flags: Flags64, flags_before: Flags64, suspicious_flags: number, suspicious_flags_before: number, has_verified_phone: boolean, temp_banned_until_ms: number | null, pending_deletion_at_ms: number | null, deletion_reason_code: number | null, };
+export type ChangeSource = "registration" | "email_verify" | "phone_verify" | "admin" | "bulk" | "session_start" | "action" | "deletion" | "login" | "other";
+export type AdminAction = { admin_id: Id, target_id: Id, action: AdminActionKind, reason_code: number | null, duration_h: number | null, ips: Array<string>, };
+export type AdminActionKind = "update_flags" | "set_suspicious_flags" | "disable_suspicious" | "temp_ban" | "unban" | "schedule_deletion" | "cancel_deletion" | "set_phone_verified";
+export type AccountDeleted = { user_id: Id, };
+export type ReportFiled = { report_id: Id, reporter_id: Id, category: string, target_type: ReportTarget, reported_user_id: Id | null, guild_id: Id | null, message_id: Id | null, channel_id: Id | null, };
+export type ReportTarget = "message" | "user" | "guild" | "dsa";
+export type EmailBounced = { user_id: Id, kind: BounceKind, provider_event_id: string, email_domain: string, };
+export type BounceKind = "hard" | "complaint" | "soft";
+export type PhoneMethod = "outbound" | "inbound";
+export type Login = { user_id: Id, ok: boolean, failure: string | null, mfa: boolean, new_ip: boolean, };
+export type SessionStarted = { user_id: Id, is_bot: boolean, has_verified_phone: boolean, flags: Flags64, suspicious_flags: number, has_ever_paid: boolean, };
+export type GuildJoined = { user_id: Id, guild_id: Id, member_count: number, discoverable: boolean, invite_code: string | null, inviter_id: Id | null, join_source: JoinSource, };
+export type JoinSource = "creator" | "invite" | "vanity" | "bot_invite" | "admin_force_add" | "discovery" | "other";
+export type DmOpened = { user_id: Id, recipient_id: Id, channel_id: Id, recipient_is_friend: boolean, delivered: boolean, };
+export type MessageCreated = { user_id: Id, message_id: Id, channel_id: Id, channel_type: ChannelType, guild_id: Id | null, dm_recipient_id: Id | null, recipient_is_friend: boolean, channel_prior_messages: boolean, is_bot: boolean, content: string, attachment_count: number, attachment_names: Array<string>, link_domains: Array<string>, invite_codes: Array<string>, invite_guild_ids: Array<Id | null>, invite_guild_owner_ids: Array<Id | null>, mention_user_ids: Array<Id>, mentions_recipient: boolean, mention_everyone: boolean, author_owns_guild: boolean, guild_member_count: number | null, delivered: boolean, };
+export type ChannelType = "dm" | "group_dm" | "guild";
+export type FriendRequest = { user_id: Id, target_id: Id, delivered: boolean, };
+export type UserBlocked = { blocker_id: Id, blocked_id: Id, };
+export type HttpErrors = { ip: string, window_ms: number, s401: number, s403: number, s404: number, s429: number, other_4xx: number, auth_failures: number, token_hashes: Array<string>, };
+export type ActionEnvelope = { v: number, id: string, key: string, issued_at_ms: number, expires_at_ms: number, } & ({ "type": "set_suspicious_flags", user_id: Id, set: number, clear: number, if_current: number | null, } | { "type": "set_spammer", user_id: Id, on: boolean, } | { "type": "phone_verified", user_id: Id, method: PhoneMethod, clear_suspicious: number, } | { "type": "temp_ban_ip", ip: string, until_ms: number, } | { "type": "review", user_id: Id, });
+export type Action = { "type": "set_suspicious_flags", user_id: Id, set: number, clear: number, if_current: number | null, } | { "type": "set_spammer", user_id: Id, on: boolean, } | { "type": "phone_verified", user_id: Id, method: PhoneMethod, clear_suspicious: number, } | { "type": "temp_ban_ip", ip: string, until_ms: number, } | { "type": "review", user_id: Id, };
+export type ActionOutcome = { action_id: string, action_type: string, status: OutcomeStatus, detail: string | null, observed: Observed | null, };
+export type OutcomeStatus = "applied" | "noop" | "conflict" | "expired" | "ineligible" | "exempt" | "unsupported" | "failed";
+export type Observed = { flags: Flags64, suspicious_flags: number, has_verified_phone: boolean, deleted: boolean, };
+export type StartReq = { v: number, user_id: Id, user_flags: Flags64, has_verified_phone: boolean, phone: string, requested_channel: PhoneChannel | null, client_ip: string, captcha_passed: boolean, };
+export type PhoneChannel = "sms" | "inbound_challenge";
+export type StartReply = { "result": "sms_sent" } | { "result": "inbound_challenge" } & Challenge | { "result": "error" } & PhoneError;
+export type Challenge = { challenge_code: string, our_number: string, expires_at_ms: number, };
+export type CheckReq = { v: number, user_id: Id, user_flags: Flags64, phone: string, code: string, client_ip: string, };
+export type CheckReply = { "result": "verified", action: ActionEnvelope, } | { "result": "error" } & PhoneError;
+export type ChallengeReq = { v: number, user_id: Id, };
+export type ChallengeReply = { "result": "inbound_challenge" } & Challenge | { "result": "error" } & PhoneError;
+export type PhoneError = { code: PhoneErrorCode, retry_after_s: number | null, rate_limit_scope: RateLimitScope | null, limit: number | null, message: string | null, };
+export type PhoneErrorCode = "invalid_phone" | "country_not_supported" | "lookup_unavailable" | "not_in_service" | "not_mobile" | "needs_review" | "inbound_required" | "already_used" | "captcha_required" | "invalid_code" | "rate_limited" | "unavailable" | "deadline_exceeded" | "unsupported_contract";
+export type RateLimitScope = "user" | "shared";
+export type InboundSms = { v: number, received_at_ms: number, signature: string, body: string, };
+
+export const CONTRACT_VERSION = 1;
+export const EVENTS_STREAM = 'EVENTS';
+export const ACTIONS_STREAM = 'ACTIONS';
+export const ACTION_PARTITIONS = 64;
+export const MAX_ACTION_ATTEMPTS = 10;
+export const LISTS_BUCKET = 'lists';
+export const SHARED_LISTS = ['ip_blocked', 'email_tld_blocked', 'email_domain_exempt'] as const;
+export const PHONE_INBOUND_SUBJECT = 'phone.inbound';
+export const RPC_PHONE_START = 'rpc.phone.v1.start';
+export const RPC_PHONE_CHECK = 'rpc.phone.v1.check';
+export const RPC_PHONE_CHALLENGE = 'rpc.phone.v1.challenge';
+export const PHONE_RPC_VERSION = 1;
+export const PHONE_DEADLINE_MS = {start: 12000, check: 10000, challenge: 3000} as const;
+export const PHONE_RETRY_MIN_REMAINING_MS = 4000;
+export const PHONE_CLIENT_TIMEOUT_SLACK_MS = 250;
+export const HEADER = {
+ msgId: 'Nats-Msg-Id',
+ ttl: 'Nats-TTL',
+ spooled: 'Fluxer-Spooled',
+ deadline: 'Fluxer-Deadline',
+ idempotencyKey: 'Fluxer-Idempotency-Key',
+ requestId: 'Fluxer-Request-Id',
+ twilioSignature: 'X-Twilio-Signature',
+} as const;
+export type EventKind = Kind;
+export const EVENT_KINDS: ReadonlyArray<EventKind> = [
+ 'registration',
+ 'email_changed',
+ 'profile_updated',
+ 'account_changed',
+ 'admin_action',
+ 'account_deleted',
+ 'report_filed',
+ 'email_bounced',
+ 'action_outcome',
+ 'login',
+ 'session_started',
+ 'guild_joined',
+ 'dm_opened',
+ 'message_created',
+ 'friend_request',
+ 'http_errors',
+ 'user_blocked',
+];
+export const EVENT_MAJOR: Record<EventKind, number> = {
+ registration: 1,
+ email_changed: 1,
+ profile_updated: 1,
+ account_changed: 1,
+ admin_action: 1,
+ account_deleted: 1,
+ report_filed: 1,
+ email_bounced: 1,
+ action_outcome: 1,
+ login: 1,
+ session_started: 1,
+ guild_joined: 1,
+ dm_opened: 1,
+ message_created: 1,
+ friend_request: 1,
+ http_errors: 1,
+ user_blocked: 1,
+};
+export const EVENT_TTL: Record<EventKind, string> = {
+ registration: 'never',
+ email_changed: 'never',
+ profile_updated: '3024000',
+ account_changed: 'never',
+ admin_action: 'never',
+ account_deleted: 'never',
+ report_filed: 'never',
+ email_bounced: 'never',
+ action_outcome: 'never',
+ login: '3024000',
+ session_started: '3024000',
+ guild_joined: '3024000',
+ dm_opened: '259200',
+ message_created: '259200',
+ friend_request: '259200',
+ http_errors: '3600',
+ user_blocked: '259200',
+};
+export const EVENT_CLASS: Record<EventKind, 'fact' | 'signal'> = {
+ registration: 'fact',
+ email_changed: 'fact',
+ profile_updated: 'fact',
+ account_changed: 'fact',
+ admin_action: 'fact',
+ account_deleted: 'fact',
+ report_filed: 'fact',
+ email_bounced: 'fact',
+ action_outcome: 'fact',
+ login: 'signal',
+ session_started: 'signal',
+ guild_joined: 'signal',
+ dm_opened: 'signal',
+ message_created: 'signal',
+ friend_request: 'signal',
+ http_errors: 'signal',
+ user_blocked: 'signal',
+};
+export const effectsConsumer = (p: number): string => `effects-${String(p).padStart(2, '0')}`;
+export function keyToken(key: string): string {
+ if (/^\d+$/.test(key)) return key;
+ return createHash('sha256').update(key).digest('hex').slice(0, 16);
+}
+export const eventSubject = (kind: EventKind, key: string): string => `evt.in.${kind}.${keyToken(key)}`;
diff --git a/fluxer_api/src/api/infrastructure/activity/SharedLists.ts b/fluxer_api/src/api/infrastructure/activity/SharedLists.ts
new file mode 100644
index 000000000..c4b3f8c47
--- /dev/null
+++ b/fluxer_api/src/api/infrastructure/activity/SharedLists.ts
@@ -0,0 +1,126 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {LISTS_BUCKET, SHARED_LISTS} from '@app/api/infrastructure/activity/Contract.generated';
+import {Logger} from '@app/api/Logger';
+import {type ConsumerMessages, DeliverPolicy, type JetStreamClient} from '@nats-io/jetstream';
+
+export type SharedListName = (typeof SHARED_LISTS)[number];
+
+const RETRY_DELAY_MS = 30_000;
+const STREAM_NAME = `KV_${LISTS_BUCKET}`;
+const SUBJECT_PREFIX = `$KV.${LISTS_BUCKET}.`;
+const KV_OPERATION_HEADER = 'KV-Operation';
+
+const lists = new Map<string, ReadonlySet<string>>();
+interface WatchState {
+ stopped: boolean;
+ messages: ConsumerMessages | null;
+ retry: ReturnType<typeof setTimeout> | null;
+}
+
+let watcher: WatchState | null = null;
+
+function isSharedListName(name: string): name is SharedListName {
+ return (SHARED_LISTS as ReadonlyArray<string>).includes(name);
+}
+
+export function parseSharedList(value: string): ReadonlySet<string> {
+ const entries = new Set<string>();
+ for (const line of value.split('\n')) {
+ const entry = line.trim().toLowerCase();
+ if (entry) entries.add(entry);
+ }
+ return entries;
+}
+
+export function applySharedListUpdate(name: string, value: string | null): void {
+ if (!isSharedListName(name)) return;
+ if (value === null) {
+ lists.delete(name);
+ return;
+ }
+ lists.set(name, parseSharedList(value));
+}
+
+export function sharedListHas(name: SharedListName, value: string | null | undefined): boolean {
+ if (!value) return false;
+ return lists.get(name)?.has(value.trim().toLowerCase()) ?? false;
+}
+
+export function isBlockedEmailDomain(domain: string | null | undefined): boolean {
+ const tld = domain?.split('.').pop();
+ return !!tld && sharedListHas('email_tld_blocked', tld);
+}
+
+export function sharedListSizes(): Record<SharedListName, number | null> {
+ const sizes = {} as Record<SharedListName, number | null>;
+ for (const name of SHARED_LISTS) {
+ sizes[name] = lists.get(name)?.size ?? null;
+ }
+ return sizes;
+}
+
+export function renderSharedListMetrics(): string {
+ const lines = [
+ '# HELP fluxer_api_shared_list_entries Entries in each shared list, absent while the list is missing',
+ '# TYPE fluxer_api_shared_list_entries gauge',
+ ];
+ for (const [name, size] of Object.entries(sharedListSizes())) {
+ if (size !== null) lines.push(`fluxer_api_shared_list_entries{list="${name}"} ${size}`);
+ }
+ return lines.join('\n');
+}
+
+async function watchOnce(js: JetStreamClient, state: WatchState): Promise<void> {
+ const consumer = await js.consumers.get(STREAM_NAME, {
+ filter_subjects: [`${SUBJECT_PREFIX}>`],
+ deliver_policy: DeliverPolicy.LastPerSubject,
+ });
+ const messages = await consumer.consume();
+ state.messages = messages;
+ if (state.stopped) {
+ await messages.close();
+ return;
+ }
+ for await (const msg of messages) {
+ const name = msg.subject.slice(SUBJECT_PREFIX.length);
+ const operation = msg.headers?.get(KV_OPERATION_HEADER);
+ applySharedListUpdate(name, operation === 'DEL' || operation === 'PURGE' ? null : msg.string());
+ }
+}
+
+function scheduleWatch(js: JetStreamClient, state: WatchState, delayMs: number): void {
+ state.retry = setTimeout(() => {
+ state.retry = null;
+ if (state.stopped) return;
+ watchOnce(js, state)
+ .catch((error: unknown) => {
+ Logger.debug({err: error}, 'Shared list watch unavailable, retrying');
+ })
+ .finally(() => {
+ state.messages = null;
+ if (!state.stopped) scheduleWatch(js, state, RETRY_DELAY_MS);
+ });
+ }, delayMs);
+ state.retry.unref?.();
+}
+
+export function startSharedListWatch(js: JetStreamClient): void {
+ stopSharedListWatch();
+ const state: WatchState = {stopped: false, messages: null, retry: null};
+ watcher = state;
+ scheduleWatch(js, state, 0);
+}
+
+export function stopSharedListWatch(): void {
+ if (!watcher) return;
+ watcher.stopped = true;
+ if (watcher.retry) clearTimeout(watcher.retry);
+ void watcher.messages?.close();
+ watcher = null;
+}
+
+export function resetSharedListsForTests(): void {
+ stopSharedListWatch();
+ lists.clear();
+}
diff --git a/fluxer_api/src/api/infrastructure/activity/tests/ActivityEvents.test.ts b/fluxer_api/src/api/infrastructure/activity/tests/ActivityEvents.test.ts
new file mode 100644
index 000000000..d0bff7756
--- /dev/null
+++ b/fluxer_api/src/api/infrastructure/activity/tests/ActivityEvents.test.ts
@@ -0,0 +1,340 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {emitAccountChangedIfRelevant} from '@app/api/infrastructure/activity/AccountChangeEvents';
+import {
+ activityCountForTests,
+ drainActivitySpoolNow,
+ emitActivity,
+ idleActivityEvents,
+ jetStreamActivityPublisher,
+ resetActivityEventsForTests,
+ startActivityEvents,
+} from '@app/api/infrastructure/activity/ActivityEvents';
+import {workerMeta} from '@app/api/infrastructure/activity/ActivityMeta';
+import {
+ ACTIVITY_SPOOL_KEY,
+ ACTIVITY_SPOOL_MAX_AGE_MS,
+ type ActivityPublisher,
+ type ActivityPublishOptions,
+ type ActivitySpoolEntry,
+ drainActivitySpool,
+} from '@app/api/infrastructure/activity/ActivitySpool';
+import {EVENTS_STREAM} from '@app/api/infrastructure/activity/Contract.generated';
+import {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
+import {JetStreamApiError, jetstream, jetstreamManager} from '@nats-io/jetstream';
+import {connect, type NatsConnection, nanos, TimeoutError} from '@nats-io/transport-node';
+import {afterAll, afterEach, beforeAll, describe, expect, it} from 'vitest';
+
+interface PublishCall {
+ subject: string;
+ payload: string;
+ options: ActivityPublishOptions;
+}
+
+class FakePublisher implements ActivityPublisher {
+ readonly calls: Array<PublishCall> = [];
+ failures: Array<Error> = [];
+
+ async publish(subject: string, payload: string, options: ActivityPublishOptions): Promise<void> {
+ this.calls.push({subject, payload, options});
+ const failure = this.failures.shift();
+ if (failure) throw failure;
+ }
+}
+
+const LOGIN = {user_id: '1174109840998400001', ok: true, failure: null, mfa: false, new_ip: false};
+const DELETED = {user_id: '1174109840998400001'};
+
+async function spooled(kv: MockKVProvider): Promise<Array<ActivitySpoolEntry>> {
+ return (await kv.lrange(ACTIVITY_SPOOL_KEY, 0, -1)).map((raw) => JSON.parse(raw) as ActivitySpoolEntry);
+}
+
+function rejection(): JetStreamApiError {
+ return new JetStreamApiError({code: 10047, err_code: 10047, description: 'maximum bytes exceeded'});
+}
+
+describe('activity events', () => {
+ afterEach(() => {
+ resetActivityEventsForTests();
+ });
+
+ it('publishes a fact with its natural id, ttl and envelope, and resolves after the ack', async () => {
+ const publisher = new FakePublisher();
+ const kv = new MockKVProvider();
+ await startActivityEvents({publisher, kv});
+ await emitActivity('account_deleted', DELETED.user_id, DELETED, workerMeta(), DELETED.user_id);
+ expect(publisher.calls).toHaveLength(1);
+ const [call] = publisher.calls;
+ expect(call.subject).toBe(`evt.in.account_deleted.${DELETED.user_id}`);
+ expect(call.options).toEqual({msgID: `account_deleted:${DELETED.user_id}`, ttl: 'never', spooled: false});
+ const envelope = JSON.parse(call.payload);
+ expect(envelope).toMatchObject({
+ v: 1,
+ id: `account_deleted:${DELETED.user_id}`,
+ key: DELETED.user_id,
+ kind: 'account_deleted',
+ data: DELETED,
+ meta: {channel: 'worker'},
+ });
+ expect(typeof envelope.at_ms).toBe('number');
+ expect(await spooled(kv)).toEqual([]);
+ expect(activityCountForTests('account_deleted', 'published')).toBe(1);
+ });
+
+ it('retries a timed out publish with the same message id', async () => {
+ const publisher = new FakePublisher();
+ publisher.failures = [new TimeoutError(), new TimeoutError()];
+ const kv = new MockKVProvider();
+ await startActivityEvents({publisher, kv});
+ await emitActivity('account_deleted', DELETED.user_id, DELETED, workerMeta(), DELETED.user_id);
+ expect(publisher.calls).toHaveLength(3);
+ expect(new Set(publisher.calls.map((call) => call.options.msgID)).size).toBe(1);
+ expect(await spooled(kv)).toEqual([]);
+ });
+
+ it('spools a fact once every retry failed, before the caller continues', async () => {
+ const publisher = new FakePublisher();
+ publisher.failures = [new TimeoutError(), new TimeoutError(), new TimeoutError()];
+ const kv = new MockKVProvider();
+ await startActivityEvents({publisher, kv});
+ await emitActivity('account_deleted', DELETED.user_id, DELETED, workerMeta(), DELETED.user_id);
+ const entries = await spooled(kv);
+ expect(entries).toHaveLength(1);
+ expect(entries[0]).toMatchObject({
+ kind: 'account_deleted',
+ id: `account_deleted:${DELETED.user_id}`,
+ ttl: 'never',
+ subject: `evt.in.account_deleted.${DELETED.user_id}`,
+ });
+ expect(activityCountForTests('account_deleted', 'spooled')).toBe(1);
+ });
+
+ it('spools a rejected publish without retrying and counts it as rejected', async () => {
+ const publisher = new FakePublisher();
+ publisher.failures = [rejection()];
+ const kv = new MockKVProvider();
+ await startActivityEvents({publisher, kv});
+ await emitActivity('account_deleted', DELETED.user_id, DELETED, workerMeta(), DELETED.user_id);
+ expect(publisher.calls).toHaveLength(1);
+ expect(await spooled(kv)).toHaveLength(1);
+ expect(activityCountForTests('account_deleted', 'rejected')).toBe(1);
+ });
+
+ it('queues signals without blocking the caller and gives each a fresh id', async () => {
+ const publisher = new FakePublisher();
+ const kv = new MockKVProvider();
+ await startActivityEvents({publisher, kv});
+ void emitActivity('login', LOGIN.user_id, LOGIN, workerMeta());
+ void emitActivity('login', LOGIN.user_id, LOGIN, workerMeta());
+ await new Promise((resolve) => setImmediate(resolve));
+ await idleActivityEvents();
+ expect(publisher.calls).toHaveLength(2);
+ const ids = publisher.calls.map((call) => call.options.msgID);
+ expect(ids[0]).toMatch(/^login:\d+$/);
+ expect(ids[0]).not.toBe(ids[1]);
+ expect(publisher.calls[0].options.ttl).toBe('3024000');
+ });
+
+ it('keys a block by the blocked user so it lands with their other signals', async () => {
+ const publisher = new FakePublisher();
+ const kv = new MockKVProvider();
+ await startActivityEvents({publisher, kv});
+ const block = {blocker_id: '1174110260428800002', blocked_id: LOGIN.user_id};
+ void emitActivity('user_blocked', block.blocked_id, block, workerMeta());
+ await new Promise((resolve) => setImmediate(resolve));
+ await idleActivityEvents();
+ expect(publisher.calls).toHaveLength(1);
+ const [call] = publisher.calls;
+ expect(call.subject).toBe(`evt.in.user_blocked.${LOGIN.user_id}`);
+ expect(call.options.ttl).toBe('259200');
+ expect(JSON.parse(call.payload)).toMatchObject({kind: 'user_blocked', key: LOGIN.user_id, data: block});
+ });
+
+ it('drains the spool in order with the original ids, marks them spooled and drops expired entries', async () => {
+ const failing = new FakePublisher();
+ failing.failures = [rejection(), rejection()];
+ const kv = new MockKVProvider();
+ await startActivityEvents({publisher: failing, kv});
+ await emitActivity('account_deleted', '1', {user_id: '1'}, workerMeta(), '1');
+ await emitActivity('account_deleted', '2', {user_id: '2'}, workerMeta(), '2');
+ const stale: ActivitySpoolEntry = {
+ kind: 'account_deleted',
+ subject: 'evt.in.account_deleted.3',
+ id: 'account_deleted:3',
+ ttl: 'never',
+ at_ms: Date.now() - ACTIVITY_SPOOL_MAX_AGE_MS - 1000,
+ data: '{}',
+ };
+ await kv.rpush(ACTIVITY_SPOOL_KEY, JSON.stringify(stale));
+ const draining = new FakePublisher();
+ await startActivityEvents({publisher: draining, kv});
+ const result = await drainActivitySpoolNow();
+ expect(result).toMatchObject({published: 2, expired: 1, failed: 0, remaining: 0});
+ expect(draining.calls.map((call) => call.options)).toEqual([
+ {msgID: 'account_deleted:1', ttl: 'never', spooled: true},
+ {msgID: 'account_deleted:2', ttl: 'never', spooled: true},
+ ]);
+ });
+
+ it('keeps undelivered entries at the head of the spool when a drain publish fails', async () => {
+ const kv = new MockKVProvider();
+ const failing = new FakePublisher();
+ failing.failures = [rejection(), rejection()];
+ await startActivityEvents({publisher: failing, kv});
+ await emitActivity('account_deleted', '1', {user_id: '1'}, workerMeta(), '1');
+ await emitActivity('account_deleted', '2', {user_id: '2'}, workerMeta(), '2');
+ const draining = new FakePublisher();
+ draining.failures = [new TimeoutError()];
+ await startActivityEvents({publisher: draining, kv});
+ const result = await drainActivitySpoolNow();
+ expect(result).toMatchObject({published: 0, remaining: 2});
+ expect((await spooled(kv)).map((entry) => entry.id)).toEqual(['account_deleted:1', 'account_deleted:2']);
+ });
+
+ it('gives two account changes written at the same version distinct ids', async () => {
+ const publisher = new FakePublisher();
+ await startActivityEvents({publisher, kv: new MockKVProvider()});
+ const row = (suspicious: number, flags: bigint) =>
+ ({user_id: 1174109840998400001n, version: 11, flags, suspicious_activity_flags: suspicious}) as never;
+ await emitAccountChangedIfRelevant(row(2, 0n), row(0, 0n), 'email_verify');
+ await emitAccountChangedIfRelevant(row(2, 0n), row(2, 1n << 43n), 'admin');
+ await emitAccountChangedIfRelevant(row(2, 0n), row(0, 0n), 'email_verify');
+ const ids = publisher.calls.map((call) => call.options.msgID);
+ expect(ids).toHaveLength(3);
+ expect(ids[0]).toMatch(/^account_changed:1174109840998400001:11:/u);
+ expect(ids[0]).not.toBe(ids[1]);
+ expect(ids[0]).toBe(ids[2]);
+ });
+
+ it('stays silent while the activity stream does not exist', async () => {
+ const publisher = new FakePublisher();
+ const kv = new MockKVProvider();
+ await startActivityEvents({
+ publisher,
+ kv,
+ jsm: {
+ streams: {
+ info: async () => {
+ throw new JetStreamApiError({code: 404, err_code: 10059, description: 'stream not found'});
+ },
+ },
+ } as never,
+ });
+ await emitActivity('account_deleted', DELETED.user_id, DELETED, workerMeta(), DELETED.user_id);
+ expect(publisher.calls).toEqual([]);
+ expect(await spooled(kv)).toEqual([]);
+ expect(activityCountForTests('account_deleted', 'dropped')).toBe(1);
+ });
+
+ it('spools and counts rejected while the stream is missing when asked to', async () => {
+ const publisher = new FakePublisher();
+ const kv = new MockKVProvider();
+ await startActivityEvents({
+ publisher,
+ kv,
+ spoolWhileMissing: true,
+ jsm: {
+ streams: {
+ info: async () => {
+ throw new JetStreamApiError({code: 404, err_code: 10059, description: 'stream not found'});
+ },
+ },
+ } as never,
+ });
+ await emitActivity('account_deleted', DELETED.user_id, DELETED, workerMeta(), DELETED.user_id);
+ expect(publisher.calls).toEqual([]);
+ expect((await spooled(kv)).map((entry) => entry.id)).toEqual([`account_deleted:${DELETED.user_id}`]);
+ expect(activityCountForTests('account_deleted', 'rejected')).toBe(1);
+ expect(await drainActivitySpoolNow()).toBeNull();
+ });
+
+ it('keeps publishing when the stream probe fails for a transient reason', async () => {
+ const publisher = new FakePublisher();
+ const kv = new MockKVProvider();
+ await startActivityEvents({
+ publisher,
+ kv,
+ jsm: {
+ streams: {
+ info: async () => {
+ throw new TimeoutError();
+ },
+ },
+ } as never,
+ });
+ await emitActivity('account_deleted', DELETED.user_id, DELETED, workerMeta(), DELETED.user_id);
+ expect(publisher.calls.map((call) => call.options.msgID)).toEqual([`account_deleted:${DELETED.user_id}`]);
+ expect(activityCountForTests('account_deleted', 'published')).toBe(1);
+ });
+
+ it('stops a drain at its budget inside a batch and never trims after losing the lock', async () => {
+ const kv = new MockKVProvider();
+ for (const id of ['1', '2', '3']) {
+ const entry: ActivitySpoolEntry = {
+ kind: 'account_deleted',
+ subject: `evt.in.account_deleted.${id}`,
+ id: `account_deleted:${id}`,
+ ttl: 'never',
+ at_ms: Date.now(),
+ data: '{}',
+ };
+ await kv.rpush(ACTIVITY_SPOOL_KEY, JSON.stringify(entry));
+ }
+ let clock = 0;
+ const slow: ActivityPublisher = {
+ publish: async () => {
+ clock += 600;
+ },
+ };
+ const partial = await drainActivitySpool(slow, kv, {nowMs: () => clock, budgetMs: 1_000});
+ expect(partial).toMatchObject({published: 2, remaining: 1});
+ const lost = await drainActivitySpool(new FakePublisher(), kv, {keepLock: async () => false});
+ expect(lost.published).toBe(1);
+ expect(lost.remaining).toBe(1);
+ expect((await spooled(kv)).map((entry) => entry.id)).toEqual(['account_deleted:3']);
+ });
+});
+
+const NATS_URL = process.env.FLUXER_TEST_ACTIVITY_NATS_URL;
+
+describe.skipIf(!NATS_URL)('activity events against JetStream', () => {
+ let nc: NatsConnection;
+ beforeAll(async () => {
+ nc = await connect({servers: NATS_URL, token: process.env.FLUXER_TEST_ACTIVITY_NATS_TOKEN});
+ const jsm = await jetstreamManager(nc);
+ await jsm.streams.delete(EVENTS_STREAM).catch(() => undefined);
+ await jsm.streams.add({
+ name: EVENTS_STREAM,
+ subjects: ['evt.in.*.*', 'evt.p.*.*'],
+ subject_transform: {src: 'evt.in.*.*', dest: 'evt.p.{{partition(64,2)}}.{{wildcard(1)}}'},
+ allow_msg_ttl: true,
+ duplicate_window: nanos(600_000),
+ });
+ });
+ afterEach(() => {
+ resetActivityEventsForTests();
+ });
+ afterAll(async () => {
+ await nc?.close();
+ });
+
+ it('lands a fact on its partition subject with the msg id and ttl, and drops the spooled copy as a duplicate', async () => {
+ const kv = new MockKVProvider();
+ const publisher = jetStreamActivityPublisher(jetstream(nc));
+ await startActivityEvents({publisher, kv, jsm: await jetstreamManager(nc)});
+ await emitActivity('account_deleted', '1174109840998400001', {user_id: '1174109840998400001'}, workerMeta(), 'x1');
+ await publisher.publish('evt.in.account_deleted.1174109840998400001', '{}', {
+ msgID: 'account_deleted:x1',
+ ttl: 'never',
+ spooled: true,
+ });
+ const jsm = await jetstreamManager(nc);
+ const info = await jsm.streams.info(EVENTS_STREAM);
+ expect(info.state.messages).toBe(1);
+ const stored = await jsm.streams.getMessage(EVENTS_STREAM, {seq: info.state.last_seq});
+ expect(stored?.subject).toMatch(/^evt\.p\.\d{1,2}\.account_deleted$/u);
+ expect(stored?.header.get('Nats-Msg-Id')).toBe('account_deleted:x1');
+ expect(stored?.header.get('Nats-TTL')).toBe('never');
+ expect(await kv.llen(ACTIVITY_SPOOL_KEY)).toBe(0);
+ });
+});
diff --git a/fluxer_api/src/api/instance/InstanceConfigRepository.ts b/fluxer_api/src/api/instance/InstanceConfigRepository.ts
index 4ab7d5915..dcb9a9ab3 100644
--- a/fluxer_api/src/api/instance/InstanceConfigRepository.ts
+++ b/fluxer_api/src/api/instance/InstanceConfigRepository.ts
@@ -14,7 +14,6 @@ import {InstanceConfigCache} from '@app/api/instance/InstanceConfigCache';
import {normalizeSsoAllowedEmailDomains} from '@app/api/instance/SsoConfigValidation';
import {Logger} from '@app/api/Logger';
import {isLimitConfigSnapshot} from '@app/api/limits/LimitConfigValidation';
-import {resolveDeferredPhoneGateEnabled, setCachedDeferredPhoneGateEnabled} from '@app/api/risk/DeferredPhoneGateCache';
import {
getEffectiveBillingConfig,
isBillingActive,
@@ -183,9 +182,6 @@ export interface InstancePolicyConfig {
gif_enabled: boolean | null;
youtube_enabled: boolean | null;
bluesky_enabled: boolean | null;
- deferred_phone_gate_enabled: boolean;
- deferred_phone_gate_window_hours: number;
- deferred_phone_gate_member_threshold: number;
}
type InstanceEmailProvider = 'smtp' | 'none';
@@ -681,7 +677,6 @@ function buildAppPublicConfig(config: z.infer<typeof StoredInstanceAppPublicSche
const InstancePolicyUpdateSchema = InstanceConfigUpdateRequest.shape.policy.unwrap().unwrap();
const InstancePolicyServiceUpdateSchema = InstancePolicyUpdateSchema.shape.services.unwrap().unwrap();
-const InstancePolicyPhoneGateUpdateSchema = InstancePolicyUpdateSchema.shape.deferred_phone_gate.unwrap().unwrap();
const StoredSnowflakeStringSchema = z
.string()
.refine((value) => value.length <= 19 && !/\D/.test(value) && SnowflakeType.safeParse(value).success);
@@ -694,9 +689,6 @@ const StoredInstancePolicySchema = z.object({
gif_enabled: InstancePolicyServiceUpdateSchema.shape.gif_enabled.default(null),
youtube_enabled: InstancePolicyServiceUpdateSchema.shape.youtube_enabled.default(null),
bluesky_enabled: InstancePolicyServiceUpdateSchema.shape.bluesky_enabled.default(null),
- deferred_phone_gate_enabled: InstancePolicyPhoneGateUpdateSchema.shape.enabled.default(false),
- deferred_phone_gate_window_hours: InstancePolicyPhoneGateUpdateSchema.shape.window_hours.default(6),
- deferred_phone_gate_member_threshold: InstancePolicyPhoneGateUpdateSchema.shape.member_threshold.default(50),
}) satisfies z.ZodType<InstancePolicyConfig>;
function decodeInstancePolicyConfig(value: unknown): InstancePolicyConfig {
@@ -1291,7 +1283,7 @@ export class InstanceConfigRepository {
parseStoredAltchaCaptchaConfig(snapshot.get(ALTCHA_CAPTCHA_CONFIG_KEY) ?? null);
parseStoredProfileTimezoneConfig(snapshot.get(PROFILE_TIMEZONE_CONFIG_KEY) ?? null);
parseStoredExperimentDeliveryConfig(snapshot.get(EXPERIMENT_DELIVERY_CONFIG_KEY) ?? null);
- const policy = parseStoredInstancePolicyConfig(snapshot.get(INSTANCE_POLICY_CONFIG_KEY) ?? null);
+ parseStoredInstancePolicyConfig(snapshot.get(INSTANCE_POLICY_CONFIG_KEY) ?? null);
checkStoredConfig('registration', () =>
parseStoredRegistrationConfig(snapshot.get(REGISTRATION_CONFIG_KEY) ?? null),
);
@@ -1319,7 +1311,6 @@ export class InstanceConfigRepository {
checkStoredConfig('media', () => parseStoredInstanceMediaConfig(snapshot.get(INSTANCE_MEDIA_CONFIG_KEY) ?? null));
setStoredBillingConfig(parseStoredInstanceBillingConfig(snapshot.get(INSTANCE_BILLING_CONFIG_KEY) ?? null));
const appPublic = parseStoredAppPublicConfig(snapshot.get(APP_PUBLIC_CONFIG_KEY) ?? null);
- setCachedDeferredPhoneGateEnabled(resolveDeferredPhoneGateEnabled(policy));
setCachedDateOfBirthCollection(appPublic.registration.collect_date_of_birth);
}
@@ -1540,9 +1531,7 @@ export class InstanceConfigRepository {
async getInstancePolicyConfig(): Promise<InstancePolicyConfig> {
const raw = await this.getConfig(INSTANCE_POLICY_CONFIG_KEY);
- const policy = parseStoredInstancePolicyConfig(raw);
- setCachedDeferredPhoneGateEnabled(resolveDeferredPhoneGateEnabled(policy));
- return policy;
+ return parseStoredInstancePolicyConfig(raw);
}
async readStoredInstancePolicyConfig(): Promise<InstancePolicyConfig> {
@@ -1568,7 +1557,6 @@ export class InstanceConfigRepository {
return {value: Object.keys(patch).length === 0 ? null : JSON.stringify(config), result: config};
});
if (written) await this.publishRefresh(cache.sourceId);
- setCachedDeferredPhoneGateEnabled(resolveDeferredPhoneGateEnabled(next));
return next;
}
diff --git a/fluxer_api/src/api/instance/SingleCommunityService.ts b/fluxer_api/src/api/instance/SingleCommunityService.ts
index db92eae51..5d118213b 100644
--- a/fluxer_api/src/api/instance/SingleCommunityService.ts
+++ b/fluxer_api/src/api/instance/SingleCommunityService.ts
@@ -32,7 +32,6 @@ export class SingleCommunityService {
}
try {
await this.guildMemberService.addUserToGuild({
- skipRiskGate: true,
userId,
guildId,
skipGuildLimitCheck: true,
diff --git a/fluxer_api/src/api/jobs/JobLedgerRepository.test.ts b/fluxer_api/src/api/jobs/JobLedgerRepository.test.ts
index f236b5354..a33c5c396 100644
--- a/fluxer_api/src/api/jobs/JobLedgerRepository.test.ts
+++ b/fluxer_api/src/api/jobs/JobLedgerRepository.test.ts
@@ -69,7 +69,7 @@ describe('JobLedgerRepository listJobs status filter', () => {
it('matches the live status of a succeeded job rather than the creation-time bucket snapshot', async () => {
const repository = new JobLedgerRepository();
- await createJob(repository, 1n, 'syncDisposableEmailDomains');
+ await createJob(repository, 1n, 'syncUrlBlocklists');
await repository.markSucceeded(1n, null);
expect(await listJobIdsByStatus(repository, 'succeeded')).toEqual([1n]);
@@ -78,7 +78,7 @@ describe('JobLedgerRepository listJobs status filter', () => {
it('matches the live status of a dead-lettered job', async () => {
const repository = new JobLedgerRepository();
- await createJob(repository, 2n, 'syncDisposableEmailDomains');
+ await createJob(repository, 2n, 'syncUrlBlocklists');
await repository.markDeadletter(2n, 'boom');
expect(await listJobIdsByStatus(repository, 'deadletter')).toEqual([2n]);
@@ -87,7 +87,7 @@ describe('JobLedgerRepository listJobs status filter', () => {
it('still returns a job that has not left the queue under status=queued', async () => {
const repository = new JobLedgerRepository();
- await createJob(repository, 3n, 'syncDisposableEmailDomains');
+ await createJob(repository, 3n, 'syncUrlBlocklists');
expect(await listJobIdsByStatus(repository, 'queued')).toEqual([3n]);
expect(await listJobIdsByStatus(repository, 'running')).toEqual([]);
@@ -95,7 +95,7 @@ describe('JobLedgerRepository listJobs status filter', () => {
it('keeps the other filters working alongside the status filter', async () => {
const repository = new JobLedgerRepository();
- await createJob(repository, 4n, 'syncDisposableEmailDomains');
+ await createJob(repository, 4n, 'syncUrlBlocklists');
await createJob(repository, 5n, 'processExpiredPremium');
await repository.markSucceeded(4n, null);
await repository.markSucceeded(5n, null);
@@ -124,7 +124,7 @@ describe('JobLedgerRepository listJobs pagination', () => {
it('emits a cursor for a page that filled exactly on the bucket boundary', async () => {
const repository = new JobLedgerRepository();
for (let index = 0; index < 3; index++) {
- await createJob(repository, BigInt(index + 1), 'syncDisposableEmailDomains');
+ await createJob(repository, BigInt(index + 1), 'syncUrlBlocklists');
}
const result = await repository.listJobs({limit: 3, cursor: null, filters: {}, maxLookbackDays: 1});
@@ -135,7 +135,7 @@ describe('JobLedgerRepository listJobs pagination', () => {
it('emits no cursor for a page that did not fill', async () => {
const repository = new JobLedgerRepository();
- await createJob(repository, 1n, 'syncDisposableEmailDomains');
+ await createJob(repository, 1n, 'syncUrlBlocklists');
const result = await repository.listJobs({limit: 3, cursor: null, filters: {}, maxLookbackDays: 1});
@@ -146,7 +146,7 @@ describe('JobLedgerRepository listJobs pagination', () => {
it('returns every match of a task type filter that sits past the unfiltered page window', async () => {
const repository = new JobLedgerRepository();
for (let index = 0; index < 60; index++) {
- await createJob(repository, BigInt(index + 1), 'syncDisposableEmailDomains');
+ await createJob(repository, BigInt(index + 1), 'syncUrlBlocklists');
}
for (let index = 0; index < 5; index++) {
await createJob(repository, BigInt(1_000 + index), 'processExpiredPremium');
diff --git a/fluxer_api/src/api/middleware/AbusiveIpAutoBanner.ts b/fluxer_api/src/api/middleware/AbusiveIpAutoBanner.ts
deleted file mode 100644
index 55d3594b7..000000000
--- a/fluxer_api/src/api/middleware/AbusiveIpAutoBanner.ts
+++ /dev/null
@@ -1,832 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createHash, randomUUID} from 'node:crypto';
-import {AdminRepository} from '@app/api/admin/AdminRepository';
-import {Config} from '@app/api/Config';
-import {IP_BAN_REFRESH_CHANNEL} from '@app/api/constants/IpBan';
-import {Logger} from '@app/api/Logger';
-import {ipBanCache} from '@app/api/middleware/IpBanMiddleware';
-import {getIpInfoService} from '@app/api/middleware/ServiceMiddleware';
-import {getKVClient} from '@app/api/middleware/ServiceRegistry';
-import {getCacheService} from '@app/api/middleware/ServiceSingletons';
-import {isAutoBanExemptAsn} from '@app/api/risk/AutoBanAsnExemptions';
-import {isIpBanExempt} from '@app/api/risk/IpBanExemptions';
-import type {HonoEnv} from '@app/api/types/HonoEnv';
-import {parseJsonRecord} from '@app/api/utils/JsonBoundaryUtils';
-import {extractClientIp} from '@fluxer/ip_utils/src/ClientIp';
-import {getSameIpDecisionKey, isPublicIpAddress, parseIpAddress} from '@fluxer/ip_utils/src/IpAddress';
-import type {IpInfoLookupResult} from '@pkgs/geoip/src/IpInfoService';
-import type {IKVProvider, IKVSubscription} from '@pkgs/kv_client/src/IKVProvider';
-import {createMiddleware} from 'hono/factory';
-
-type IpClass = 'datacenter' | 'anonymous' | 'mobile' | 'residential' | 'unknown' | 'exempt';
-type TriggerKind = 'score' | 'token_diversity' | 'score_and_token_diversity';
-
-interface AbuseRecord {
- score: number;
- windowStartMs: number;
- autoBanFired: boolean;
- triggeringReason: string | null;
- lookupIp: string;
- distinctTokenHashes: Set<string>;
-}
-
-interface OutboundEntry {
- scoreDelta: number;
- lookupIp: string;
- newTokenHashes: Set<string>;
-}
-
-interface OutboundDeltaBatchEntry {
- key: string;
- pending: OutboundEntry;
- scoreDelta: number;
- tokenHashes: Set<string>;
-}
-
-interface PersistentScoreState {
- count: number;
- lastWindowStartMs: number;
- expiresAtMs: number;
-}
-
-interface AbuseSignalIp {
- banKey: string;
- lookupIp: string;
-}
-
-interface AbuseSignalOptions {
- tokenHash?: string;
- weight?: number;
-}
-
-interface PeerIpClassHint {
- ipClass: IpClass;
- expiresAtMs: number;
-}
-
-interface OutboundIpClass {
- lookupIp: string;
- ipClass: IpClass;
-}
-
-interface ResolvedBanClass {
- ipClass: IpClass;
- authoritative: boolean;
- blocked: boolean;
-}
-
-const WINDOW_MS = positiveNumberFromEnv('FLUXER_ABUSE_WINDOW_MS', 60_000);
-const THRESHOLD_DATACENTER = positiveNumberFromEnv('FLUXER_ABUSE_THRESHOLD_DATACENTER', 20);
-const THRESHOLD_ANONYMOUS = positiveNumberFromEnv('FLUXER_ABUSE_THRESHOLD_ANONYMOUS', 500);
-const THRESHOLD_MOBILE = positiveNumberFromEnv('FLUXER_ABUSE_THRESHOLD_MOBILE', 1000);
-const THRESHOLD_RESIDENTIAL = positiveNumberFromEnv('FLUXER_ABUSE_THRESHOLD_RESIDENTIAL', 100);
-const TOKEN_DIVERSITY_DATACENTER = positiveNumberFromEnv('FLUXER_ABUSE_TOKEN_DIVERSITY_DATACENTER', 10);
-const TOKEN_DIVERSITY_ANONYMOUS = positiveNumberFromEnv('FLUXER_ABUSE_TOKEN_DIVERSITY_ANONYMOUS', 50);
-const TOKEN_DIVERSITY_MOBILE = positiveNumberFromEnv('FLUXER_ABUSE_TOKEN_DIVERSITY_MOBILE', 100);
-const TOKEN_DIVERSITY_RESIDENTIAL = positiveNumberFromEnv('FLUXER_ABUSE_TOKEN_DIVERSITY_RESIDENTIAL', 10);
-const AUTO_BAN_TTL_SECONDS = positiveNumberFromEnv('FLUXER_ABUSE_BAN_TTL_SEC', 86_400);
-const BATCH_FLUSH_MS = positiveNumberFromEnv('FLUXER_ABUSE_BATCH_FLUSH_MS', 500);
-const MAX_BATCH_TICKS = positiveNumberFromEnv('FLUXER_ABUSE_MAX_BATCH_TICKS', 5000);
-const MAX_NEW_TOKENS_PER_TICK = positiveNumberFromEnv('FLUXER_ABUSE_MAX_NEW_TOKENS_PER_TICK', 20);
-const MAX_TRACKED_IPS = positiveNumberFromEnv('FLUXER_ABUSE_MAX_TRACKED_IPS', 100_000);
-const MAX_TOKEN_HASHES_PER_IP = positiveNumberFromEnv('FLUXER_ABUSE_MAX_TOKEN_HASHES_PER_IP', 100);
-const MIN_SCORE_FOR_IP_LOOKUP = positiveNumberFromEnv('FLUXER_ABUSE_MIN_SCORE_FOR_LOOKUP', 20);
-const MIN_TOKENS_FOR_IP_LOOKUP = positiveNumberFromEnv('FLUXER_ABUSE_MIN_TOKENS_FOR_LOOKUP', 10);
-const REQUIRED_SCORE_WINDOWS_FOR_AUTO_BAN = positiveNumberFromEnv(
- 'FLUXER_ABUSE_REQUIRED_SCORE_WINDOWS_FOR_AUTO_BAN',
- 3,
-);
-const REPLICATION_CHANNEL = 'abuse_tracker:ticks';
-const IP_CLASS_CHANNEL = 'abuse_tracker:ipclass';
-const IP_CLASS_CLAIM_PREFIX = 'abuse:ipclass:claim:';
-const IP_CLASS_CLAIM_ENABLED = process.env.FLUXER_ABUSE_IP_CLASS_CLAIM_ENABLED !== '0';
-const IP_CLASS_CLAIM_TTL_SECONDS = positiveNumberFromEnv('FLUXER_ABUSE_IP_CLASS_CLAIM_TTL_SEC', 15);
-const DEFAULT_IP_CLASS_PENDING_TTL_MS = positiveNumberFromEnv('FLUXER_ABUSE_IP_CLASS_PENDING_TTL_MS', 20_000);
-const DEFAULT_IP_CLASS_NEGATIVE_TTL_MS = positiveNumberFromEnv('FLUXER_ABUSE_IP_CLASS_NEGATIVE_TTL_MS', 300_000);
-const DEFAULT_IP_CLASS_HINT_TTL_MS = positiveNumberFromEnv('FLUXER_ABUSE_IP_CLASS_HINT_TTL_MS', 600_000);
-const IP_CLASSES = ['datacenter', 'anonymous', 'mobile', 'residential', 'unknown', 'exempt'] as const;
-const POD_ID = process.env.HOSTNAME ?? randomUUID();
-
-type ReplicatedTick = [banKey: string, scoreDelta: number, tokenHashes: Array<string>, lookupIp: string];
-
-interface ReplicationMessage {
- sender: string;
- ticks: Array<ReplicatedTick>;
- ts: number;
-}
-
-type IpClassEntry = [banKey: string, lookupIp: string, ipClass: IpClass];
-
-interface IpClassMessage {
- sender: string;
- entries: Array<IpClassEntry>;
- ts: number;
-}
-
-const records = new Map<string, AbuseRecord>();
-const outboundDeltas = new Map<string, OutboundEntry>();
-const persistentScoreWindows = new Map<string, PersistentScoreState>();
-const ipClassCache = new Map<string, IpClass>();
-const ipClassPending = new Map<string, number>();
-const ipClassNegativeUntil = new Map<string, number>();
-const peerIpClassHints = new Map<string, PeerIpClassHint>();
-const outboundIpClasses = new Map<string, OutboundIpClass>();
-const pendingIpClassTasks = new Set<Promise<void>>();
-const recordedClientErrorRequests = new WeakSet<Request>();
-const pendingAutoBanTasks = new Set<Promise<void>>();
-const adminRepository = new AdminRepository();
-
-let abuseReplication: AbuseReplicationSubscriber | null = null;
-let ipClassPendingTtlMs = DEFAULT_IP_CLASS_PENDING_TTL_MS;
-let ipClassNegativeTtlMs = DEFAULT_IP_CLASS_NEGATIVE_TTL_MS;
-let ipClassHintTtlMs = DEFAULT_IP_CLASS_HINT_TTL_MS;
-
-function positiveNumberFromEnv(name: string, fallback: number): number {
- const raw = process.env[name];
- if (!raw) return fallback;
- const parsed = Number(raw);
- return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
-}
-
-function clientErrorWeight(status: number): number {
- if (status === 429) return 3;
- if (status === 401) return 0.75;
- if (status === 403) return 0.5;
- if (status === 404) return 0.25;
- if (status >= 400 && status < 500) return 0.25;
- return 0;
-}
-
-function normalizeSignalIp(ip: string | null): AbuseSignalIp | null {
- if (!ip) return null;
- const parsed = parseIpAddress(ip);
- if (!parsed) return null;
- if (!isPublicIpAddress(parsed.normalized)) return null;
- if (isIpBanExempt(parsed.normalized)) return null;
- const banKey = getSameIpDecisionKey(parsed.normalized) ?? parsed.normalized;
- return {banKey, lookupIp: parsed.normalized};
-}
-
-function classifyIpInfo(result: IpInfoLookupResult): IpClass {
- if (!result.available) return 'unknown';
- if (result.flags.isMobile || result.mobile.name) return 'mobile';
- if (result.anonymous.isAnonymous) return 'anonymous';
- if (result.flags.isHosting) return 'datacenter';
- return 'residential';
-}
-
-function scoreThresholdFor(ipClass: IpClass): number {
- switch (ipClass) {
- case 'datacenter':
- return THRESHOLD_DATACENTER;
- case 'anonymous':
- return THRESHOLD_ANONYMOUS;
- case 'mobile':
- return THRESHOLD_MOBILE;
- case 'residential':
- case 'unknown':
- case 'exempt':
- return THRESHOLD_RESIDENTIAL;
- }
-}
-
-function tokenDiversityThresholdFor(ipClass: IpClass): number {
- switch (ipClass) {
- case 'datacenter':
- return TOKEN_DIVERSITY_DATACENTER;
- case 'anonymous':
- return TOKEN_DIVERSITY_ANONYMOUS;
- case 'mobile':
- return TOKEN_DIVERSITY_MOBILE;
- case 'residential':
- case 'unknown':
- case 'exempt':
- return TOKEN_DIVERSITY_RESIDENTIAL;
- }
-}
-
-function shouldSkipAutoBanForIpClass(ipClass: IpClass): boolean {
- return ipClass === 'mobile';
-}
-
-function isIpClass(value: unknown): value is IpClass {
- return typeof value === 'string' && (IP_CLASSES as ReadonlyArray<string>).includes(value);
-}
-
-function getOwnIpClass(key: string, now: number): IpClass | null {
- const cached = ipClassCache.get(key);
- if (cached === undefined) return null;
- const negativeUntilMs = ipClassNegativeUntil.get(key);
- if (negativeUntilMs !== undefined && negativeUntilMs <= now) {
- ipClassCache.delete(key);
- ipClassNegativeUntil.delete(key);
- return null;
- }
- return cached;
-}
-
-function isOwnIpClassNegative(key: string, now: number): boolean {
- const negativeUntilMs = ipClassNegativeUntil.get(key);
- return negativeUntilMs !== undefined && negativeUntilMs > now;
-}
-
-function setOwnIpClass(key: string, lookupIp: string, ipClass: IpClass, negative: boolean): void {
- ipClassCache.set(key, ipClass);
- if (negative) {
- ipClassNegativeUntil.set(key, Date.now() + ipClassNegativeTtlMs);
- } else {
- ipClassNegativeUntil.delete(key);
- peerIpClassHints.delete(key);
- }
- ipClassPending.delete(key);
- if (!negative && ipClass !== 'unknown') {
- queueOutboundIpClass(key, lookupIp, ipClass);
- }
- const rec = records.get(key);
- if (rec) maybeFireAutoBan(key, rec);
-}
-
-function isIpClassPending(key: string, now: number): boolean {
- const expiresAtMs = ipClassPending.get(key);
- if (expiresAtMs === undefined) return false;
- if (expiresAtMs <= now) {
- ipClassPending.delete(key);
- return false;
- }
- return true;
-}
-
-function getPeerClassHint(key: string, now: number): IpClass | null {
- const hint = peerIpClassHints.get(key);
- if (!hint) return null;
- if (hint.expiresAtMs <= now) {
- peerIpClassHints.delete(key);
- return null;
- }
- return hint.ipClass;
-}
-
-function recordPeerClassHint(key: string, ipClass: IpClass): void {
- peerIpClassHints.set(key, {ipClass, expiresAtMs: Date.now() + ipClassHintTtlMs});
-}
-
-function isStricterThanUnknown(ipClass: IpClass): boolean {
- return (
- scoreThresholdFor(ipClass) <= scoreThresholdFor('unknown') &&
- tokenDiversityThresholdFor(ipClass) <= tokenDiversityThresholdFor('unknown')
- );
-}
-
-function resolveClassForBan(key: string, now: number): ResolvedBanClass {
- const own = getOwnIpClass(key, now);
- if (own !== null && !isOwnIpClassNegative(key, now)) return {ipClass: own, authoritative: true, blocked: false};
- const hint = getPeerClassHint(key, now);
- if (hint !== null && isStricterThanUnknown(hint)) return {ipClass: hint, authoritative: true, blocked: false};
- if (hint !== null) return {ipClass: 'unknown', authoritative: false, blocked: true};
- if (own !== null) return {ipClass: own, authoritative: true, blocked: false};
- return {ipClass: 'unknown', authoritative: false, blocked: isIpClassPending(key, now)};
-}
-
-function pruneIfNeeded(now: number): void {
- if (records.size < MAX_TRACKED_IPS) return;
- for (const [key, expiresAtMs] of ipClassPending) {
- if (expiresAtMs <= now) ipClassPending.delete(key);
- }
- for (const [key, hint] of peerIpClassHints) {
- if (hint.expiresAtMs <= now) peerIpClassHints.delete(key);
- }
- for (const [key, rec] of records) {
- if (rec.windowStartMs + WINDOW_MS < now && !ipClassPending.has(key)) {
- records.delete(key);
- ipClassCache.delete(key);
- ipClassNegativeUntil.delete(key);
- peerIpClassHints.delete(key);
- outboundIpClasses.delete(key);
- }
- if (records.size < MAX_TRACKED_IPS * 0.9) return;
- }
-}
-
-function getOrResetRecord(signalIp: AbuseSignalIp, now: number, reason: string): AbuseRecord {
- let rec = records.get(signalIp.banKey);
- if (!rec || rec.windowStartMs + WINDOW_MS < now) {
- pruneIfNeeded(now);
- rec = {
- score: 0,
- windowStartMs: now,
- autoBanFired: false,
- triggeringReason: reason,
- lookupIp: signalIp.lookupIp,
- distinctTokenHashes: new Set(),
- };
- records.set(signalIp.banKey, rec);
- return rec;
- }
- rec.lookupIp = signalIp.lookupIp;
- if (!rec.triggeringReason) rec.triggeringReason = reason;
- return rec;
-}
-
-function getOrInitOutbound(signalIp: AbuseSignalIp): OutboundEntry {
- let entry = outboundDeltas.get(signalIp.banKey);
- if (!entry) {
- entry = {scoreDelta: 0, lookupIp: signalIp.lookupIp, newTokenHashes: new Set()};
- outboundDeltas.set(signalIp.banKey, entry);
- return entry;
- }
- entry.lookupIp = signalIp.lookupIp;
- return entry;
-}
-
-function queueOutboundDelta(
- signalIp: AbuseSignalIp,
- weight: number,
- tokenHash: string | undefined,
- hadToken: boolean,
-): void {
- if (!abuseReplication?.isActive) return;
- if (!outboundDeltas.has(signalIp.banKey) && outboundDeltas.size >= MAX_TRACKED_IPS) return;
- const outbound = getOrInitOutbound(signalIp);
- outbound.scoreDelta += weight;
- if (tokenHash && !hadToken) {
- outbound.newTokenHashes.add(tokenHash);
- }
-}
-
-function shouldEnsureIpClassLookup(key: string, rec: AbuseRecord, now: number): boolean {
- if (getOwnIpClass(key, now) !== null || isIpClassPending(key, now)) return false;
- if (getPeerClassHint(key, now) !== null) return false;
- if (rec.score < MIN_SCORE_FOR_IP_LOOKUP && rec.distinctTokenHashes.size < MIN_TOKENS_FOR_IP_LOOKUP) return false;
- return ipBanCache.getMatch(rec.lookupIp) === null;
-}
-
-function markScoreThresholdWindow(key: string, rec: AbuseRecord, now: number): number {
- const expiresAtMs = rec.windowStartMs + WINDOW_MS * (REQUIRED_SCORE_WINDOWS_FOR_AUTO_BAN + 2);
- let state = persistentScoreWindows.get(key);
- if (!state || state.expiresAtMs <= now) {
- state = {
- count: 1,
- lastWindowStartMs: rec.windowStartMs,
- expiresAtMs,
- };
- persistentScoreWindows.set(key, state);
- return state.count;
- }
- state.expiresAtMs = expiresAtMs;
- if (state.lastWindowStartMs !== rec.windowStartMs) {
- state.count += 1;
- state.lastWindowStartMs = rec.windowStartMs;
- }
- return state.count;
-}
-
-async function claimIpClassLookup(key: string): Promise<boolean> {
- if (!IP_CLASS_CLAIM_ENABLED) return true;
- if (!abuseReplication?.isActive) return true;
- try {
- return await getKVClient().setnx(`${IP_CLASS_CLAIM_PREFIX}${key}`, POD_ID, IP_CLASS_CLAIM_TTL_SECONDS);
- } catch {
- return true;
- }
-}
-
-async function runIpClassLookup(key: string, lookupIp: string): Promise<void> {
- try {
- if (await isAutoBanExemptAsn(lookupIp)) {
- setOwnIpClass(key, lookupIp, 'exempt', false);
- return;
- }
- if (!(await claimIpClassLookup(key))) return;
- const result = await getIpInfoService().lookup(lookupIp, {source: 'AbusiveIpAutoBanner', reason: 'classify'});
- setOwnIpClass(key, lookupIp, classifyIpInfo(result), !result.available);
- } catch (err) {
- setOwnIpClass(key, lookupIp, 'unknown', true);
- Logger.warn({err, ip: lookupIp}, '[abuse-auto-ban] IP classification lookup failed');
- }
-}
-
-function ensureIpClassLookup(key: string, lookupIp: string): void {
- const now = Date.now();
- if (getOwnIpClass(key, now) !== null || isIpClassPending(key, now)) return;
- ipClassPending.set(key, now + ipClassPendingTtlMs);
- const task = runIpClassLookup(key, lookupIp);
- pendingIpClassTasks.add(task);
- void task.finally(() => {
- pendingIpClassTasks.delete(task);
- });
-}
-
-function maybeFireAutoBan(key: string, rec: AbuseRecord): void {
- if (rec.autoBanFired) return;
- const now = Date.now();
- if (ipBanCache.getMatch(rec.lookupIp) !== null) {
- rec.autoBanFired = true;
- return;
- }
- const resolved = resolveClassForBan(key, now);
- const ipClass = resolved.ipClass;
- const scoreThreshold = scoreThresholdFor(ipClass);
- const tokenThreshold = tokenDiversityThresholdFor(ipClass);
- const overScore = rec.score >= scoreThreshold;
- const overTokenDiversity = rec.distinctTokenHashes.size >= tokenThreshold;
- if (!overScore && !overTokenDiversity) return;
- if (resolved.blocked) {
- return;
- }
- if (ipClass === 'exempt') {
- rec.autoBanFired = true;
- Logger.warn(
- {ip: key, ipClass, score: rec.score, distinctTokens: rec.distinctTokenHashes.size},
- '[abuse-auto-ban] Skipping automatic IP ban because the ASN is exempt',
- );
- return;
- }
- if (shouldSkipAutoBanForIpClass(ipClass)) {
- rec.autoBanFired = true;
- Logger.warn(
- {ip: key, ipClass, score: rec.score, distinctTokens: rec.distinctTokenHashes.size},
- '[abuse-auto-ban] Skipping automatic IP ban because the IP class has high CGNAT blast-radius risk',
- );
- return;
- }
- if (overScore && !overTokenDiversity) {
- const persistentWindows = markScoreThresholdWindow(key, rec, Date.now());
- if (persistentWindows < REQUIRED_SCORE_WINDOWS_FOR_AUTO_BAN) {
- return;
- }
- }
- rec.autoBanFired = true;
- const trigger: TriggerKind = overScore
- ? overTokenDiversity
- ? 'score_and_token_diversity'
- : 'score'
- : 'token_diversity';
- const task = executeAutoBan(key, {
- lookupIp: rec.lookupIp,
- ipClass,
- score: rec.score,
- scoreThreshold,
- distinctTokens: rec.distinctTokenHashes.size,
- tokenDiversityThreshold: tokenThreshold,
- triggeringReason: rec.triggeringReason ?? 'unknown',
- trigger,
- });
- pendingAutoBanTasks.add(task);
- task.finally(() => pendingAutoBanTasks.delete(task));
-}
-
-async function executeAutoBan(
- key: string,
- ctx: {
- lookupIp: string;
- ipClass: IpClass;
- score: number;
- scoreThreshold: number;
- distinctTokens: number;
- tokenDiversityThreshold: number;
- triggeringReason: string;
- trigger: TriggerKind;
- },
-): Promise<void> {
- if (!isPublicIpAddress(ctx.lookupIp)) {
- return;
- }
- if (isIpBanExempt(ctx.lookupIp)) {
- return;
- }
- try {
- await adminRepository.banIpTemp(key, AUTO_BAN_TTL_SECONDS);
- ipBanCache.banTemp(key, AUTO_BAN_TTL_SECONDS);
- await getCacheService().publish(IP_BAN_REFRESH_CHANNEL, 'refresh');
- Logger.warn(
- {
- ip: key,
- ttlSeconds: AUTO_BAN_TTL_SECONDS,
- windowMs: WINDOW_MS,
- ...ctx,
- },
- '[abuse-auto-ban] Auto-banning abusive IP',
- );
- } catch (err) {
- const rec = records.get(key);
- if (rec) rec.autoBanFired = false;
- Logger.error({err, ip: key}, '[abuse-auto-ban] Auto-ban write failed; will retry on next signal');
- }
-}
-
-export function hashAuthToken(token: string): string {
- return createHash('sha256').update(token).digest('hex').slice(0, 32);
-}
-
-export function recordAbuseSignal(ip: string | null, reason: string, opts: AbuseSignalOptions = {}): void {
- const signalIp = normalizeSignalIp(ip);
- if (!signalIp) return;
- const weight = opts.weight ?? 1;
- if (!Number.isFinite(weight) || weight <= 0) return;
- const now = Date.now();
- const rec = getOrResetRecord(signalIp, now, reason);
- rec.score += weight;
- let hadToken = false;
- let queuedTokenHash: string | undefined;
- if (opts.tokenHash && rec.distinctTokenHashes.size < MAX_TOKEN_HASHES_PER_IP) {
- hadToken = rec.distinctTokenHashes.has(opts.tokenHash);
- rec.distinctTokenHashes.add(opts.tokenHash);
- queuedTokenHash = opts.tokenHash;
- }
- queueOutboundDelta(signalIp, weight, queuedTokenHash, hadToken);
- if (shouldEnsureIpClassLookup(signalIp.banKey, rec, now)) {
- ensureIpClassLookup(signalIp.banKey, signalIp.lookupIp);
- }
- maybeFireAutoBan(signalIp.banKey, rec);
-}
-
-export function recordHttpClientError(request: Request, status: number, reason = `http_${status}`): void {
- const weight = clientErrorWeight(status);
- if (weight <= 0) return;
- if (recordedClientErrorRequests.has(request)) return;
- recordedClientErrorRequests.add(request);
- const clientIp = extractClientIp(request, {
- trustClientIpHeader: Config.proxy.trust_client_ip_header,
- clientIpHeaderName: Config.proxy.client_ip_header,
- });
- recordAbuseSignal(clientIp, reason, {weight});
-}
-
-export const ClientErrorAbuseSignalMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
- await next();
- if (ctx.get('user')) return;
- recordHttpClientError(ctx.req.raw, ctx.res.status);
-});
-
-function applyReplicatedTick(tick: ReplicatedTick): void {
- const [banKey, scoreDelta, tokenHashes, lookupIp] = tick;
- const signalIp = normalizeSignalIp(lookupIp);
- if (!signalIp || signalIp.banKey !== banKey) return;
- const now = Date.now();
- const rec = getOrResetRecord(signalIp, now, 'replicated');
- rec.score += scoreDelta;
- for (const tokenHash of tokenHashes) {
- if (rec.distinctTokenHashes.size >= MAX_TOKEN_HASHES_PER_IP) break;
- rec.distinctTokenHashes.add(tokenHash);
- }
- if (shouldEnsureIpClassLookup(banKey, rec, now)) {
- ensureIpClassLookup(banKey, lookupIp);
- }
- maybeFireAutoBan(banKey, rec);
-}
-
-async function flushOutbound(publisher: IKVProvider): Promise<void> {
- if (outboundDeltas.size === 0) return;
- const ticks: Array<ReplicatedTick> = [];
- const batch: Array<OutboundDeltaBatchEntry> = [];
- for (const [key, entry] of outboundDeltas) {
- const tokenHashes: Array<string> = [];
- for (const tokenHash of entry.newTokenHashes) {
- tokenHashes.push(tokenHash);
- if (tokenHashes.length >= MAX_NEW_TOKENS_PER_TICK) break;
- }
- ticks.push([key, entry.scoreDelta, tokenHashes, entry.lookupIp]);
- batch.push({key, pending: entry, scoreDelta: entry.scoreDelta, tokenHashes: entry.newTokenHashes});
- entry.scoreDelta = 0;
- entry.newTokenHashes = new Set();
- if (ticks.length >= MAX_BATCH_TICKS) break;
- }
- const message: ReplicationMessage = {sender: POD_ID, ticks, ts: Date.now()};
- try {
- await publisher.publish(REPLICATION_CHANNEL, JSON.stringify(message));
- for (const {key, pending} of batch) {
- if (outboundDeltas.get(key) === pending && pending.scoreDelta === 0) {
- outboundDeltas.delete(key);
- }
- }
- } catch (err) {
- for (const {key, pending, scoreDelta, tokenHashes} of batch) {
- if (outboundDeltas.get(key) !== pending) continue;
- pending.scoreDelta += scoreDelta;
- for (const tokenHash of pending.newTokenHashes) {
- tokenHashes.add(tokenHash);
- }
- pending.newTokenHashes = tokenHashes;
- }
- Logger.warn({err, tickCount: ticks.length}, '[abuse-auto-ban] Failed to publish abuse replication batch');
- }
-}
-
-function queueOutboundIpClass(key: string, lookupIp: string, ipClass: IpClass): void {
- if (!abuseReplication?.isActive) return;
- if (!outboundIpClasses.has(key) && outboundIpClasses.size >= MAX_TRACKED_IPS) return;
- outboundIpClasses.set(key, {lookupIp, ipClass});
-}
-
-async function flushOutboundIpClasses(publisher: IKVProvider): Promise<void> {
- if (outboundIpClasses.size === 0) return;
- const entries: Array<IpClassEntry> = [];
- const batch: Array<[string, OutboundIpClass]> = [];
- for (const [key, entry] of outboundIpClasses) {
- entries.push([key, entry.lookupIp, entry.ipClass]);
- batch.push([key, entry]);
- if (entries.length >= MAX_BATCH_TICKS) break;
- }
- const message: IpClassMessage = {sender: POD_ID, entries, ts: Date.now()};
- try {
- await publisher.publish(IP_CLASS_CHANNEL, JSON.stringify(message));
- for (const [key, entry] of batch) {
- if (outboundIpClasses.get(key) === entry) {
- outboundIpClasses.delete(key);
- }
- }
- } catch (err) {
- Logger.warn({err, entryCount: entries.length}, '[abuse-auto-ban] Failed to publish abuse IP class batch');
- }
-}
-
-function handleIpClassMessage(message: string): void {
- const msg = parseJsonRecord(message);
- if (!msg || msg.sender === POD_ID || !Array.isArray(msg.entries)) return;
- for (const rawEntry of msg.entries) {
- if (!Array.isArray(rawEntry) || rawEntry.length < 3) continue;
- const [banKey, lookupIp, ipClass] = rawEntry;
- if (typeof banKey !== 'string' || typeof lookupIp !== 'string' || !isIpClass(ipClass)) continue;
- if (ipClass === 'unknown') continue;
- const signalIp = normalizeSignalIp(lookupIp);
- if (!signalIp || signalIp.banKey !== banKey) continue;
- const rec = records.get(banKey);
- if (!rec) continue;
- const now = Date.now();
- if (getOwnIpClass(banKey, now) !== null && !isOwnIpClassNegative(banKey, now)) continue;
- recordPeerClassHint(banKey, ipClass);
- maybeFireAutoBan(banKey, rec);
- }
-}
-
-function handleReplicationMessage(channel: string, message: string): void {
- if (channel === IP_CLASS_CHANNEL) {
- handleIpClassMessage(message);
- return;
- }
- if (channel !== REPLICATION_CHANNEL) return;
- const msg = parseJsonRecord(message);
- if (!msg || msg.sender === POD_ID || !Array.isArray(msg.ticks)) return;
- for (const rawTick of msg.ticks) {
- if (!Array.isArray(rawTick) || rawTick.length < 4) continue;
- const [banKey, scoreDelta, rawTokenHashes, lookupIp] = rawTick;
- if (
- typeof banKey !== 'string' ||
- typeof scoreDelta !== 'number' ||
- !Number.isFinite(scoreDelta) ||
- scoreDelta <= 0 ||
- typeof lookupIp !== 'string'
- ) {
- continue;
- }
- const tokenHashes = Array.isArray(rawTokenHashes)
- ? rawTokenHashes.filter((tokenHash): tokenHash is string => typeof tokenHash === 'string')
- : [];
- applyReplicatedTick([banKey, scoreDelta, tokenHashes, lookupIp]);
- }
-}
-
-class AbuseReplicationSubscriber {
- private readonly subscription: IKVSubscription;
- private readonly flushes = new Map<string, Promise<void>>();
- private phase: 'starting' | 'running' | 'stopping' | 'stopped' = 'starting';
- private startCompletion: Promise<void> | null = null;
- private stopCompletion: Promise<void> | null = null;
- private flushTimer: NodeJS.Timeout | null = null;
- private readonly messageHandler = (channel: string, message: string): void => {
- if (this.isActive) handleReplicationMessage(channel, message);
- };
- private readonly errorHandler = (error: Error): void => {
- if (this.isActive) Logger.warn({error}, '[abuse-auto-ban] Abuse replication subscription error');
- };
-
- constructor(private readonly publisher: IKVProvider) {
- this.subscription = publisher.duplicate();
- }
-
- get isActive(): boolean {
- return this.phase === 'starting' || this.phase === 'running';
- }
-
- start(): Promise<void> {
- this.assertActive();
- this.startCompletion ??= this.connect();
- return this.startCompletion;
- }
-
- private async connect(): Promise<void> {
- this.subscription.on('message', this.messageHandler);
- this.subscription.on('error', this.errorHandler);
- await this.subscription.connect();
- this.assertActive();
- await this.subscription.subscribe(REPLICATION_CHANNEL, IP_CLASS_CHANNEL);
- this.assertActive();
- this.phase = 'running';
- this.flushTimer = setInterval(() => {
- this.flush(REPLICATION_CHANNEL, flushOutbound);
- this.flush(IP_CLASS_CHANNEL, flushOutboundIpClasses);
- }, BATCH_FLUSH_MS);
- this.flushTimer.unref();
- }
-
- private assertActive(): void {
- if (!this.isActive) {
- throw new Error('Abuse replication subscriber is stopping or stopped');
- }
- }
-
- private flush(channel: string, publish: (publisher: IKVProvider) => Promise<void>): void {
- if (!this.isActive || this.flushes.has(channel)) return;
- const task = publish(this.publisher)
- .catch((err) => {
- Logger.error({err, channel}, '[abuse-auto-ban] Abuse replication flush failed');
- })
- .finally(() => {
- this.flushes.delete(channel);
- });
- this.flushes.set(channel, task);
- }
-
- stop(): Promise<void> {
- if (this.stopCompletion) return this.stopCompletion;
- this.phase = 'stopping';
- if (this.flushTimer) clearInterval(this.flushTimer);
- this.flushTimer = null;
- this.subscription.off('message', this.messageHandler);
- this.subscription.off('error', this.errorHandler);
- this.stopCompletion = this.close();
- return this.stopCompletion;
- }
-
- private async close(): Promise<void> {
- try {
- const [disconnected] = await Promise.allSettled([
- Promise.resolve().then(() => this.subscription.disconnect()),
- this.startCompletion,
- ...this.flushes.values(),
- ]);
- if (disconnected.status === 'rejected') throw disconnected.reason;
- } finally {
- this.phase = 'stopped';
- }
- }
-}
-
-export async function startAbuseReplicationSubscriber(kvClient: IKVProvider | null): Promise<void> {
- if (!kvClient) return;
- const subscriber = (abuseReplication ??= new AbuseReplicationSubscriber(kvClient));
- try {
- await subscriber.start();
- } catch (err) {
- Logger.error({err}, '[abuse-auto-ban] Failed to start abuse replication subscriber');
- try {
- await subscriber.stop();
- } catch (cleanupError) {
- Logger.error({err: cleanupError}, '[abuse-auto-ban] Failed to close abuse replication subscriber');
- } finally {
- if (abuseReplication === subscriber) abuseReplication = null;
- }
- throw err;
- }
-}
-
-export async function stopAbuseReplicationSubscriber(): Promise<void> {
- const subscriber = abuseReplication;
- if (!subscriber) return;
- try {
- await subscriber.stop();
- } finally {
- if (abuseReplication === subscriber) abuseReplication = null;
- }
-}
-
-export async function drainAbuseAutoBanTasksForTests(): Promise<void> {
- await Promise.all([...pendingAutoBanTasks]);
-}
-
-export async function drainAbuseIpClassLookupsForTests(): Promise<void> {
- await Promise.all([...pendingIpClassTasks]);
-}
-
-export function setAbuseIpClassTtlsForTests(opts: {negativeMs?: number; hintMs?: number; pendingMs?: number}): void {
- if (opts.negativeMs !== undefined) ipClassNegativeTtlMs = opts.negativeMs;
- if (opts.hintMs !== undefined) ipClassHintTtlMs = opts.hintMs;
- if (opts.pendingMs !== undefined) ipClassPendingTtlMs = opts.pendingMs;
-}
-
-export function resetAbuseTrackingForTests(): void {
- records.clear();
- outboundDeltas.clear();
- persistentScoreWindows.clear();
- ipClassCache.clear();
- ipClassPending.clear();
- ipClassNegativeUntil.clear();
- peerIpClassHints.clear();
- outboundIpClasses.clear();
- pendingIpClassTasks.clear();
- pendingAutoBanTasks.clear();
- ipClassPendingTtlMs = DEFAULT_IP_CLASS_PENDING_TTL_MS;
- ipClassNegativeTtlMs = DEFAULT_IP_CLASS_NEGATIVE_TTL_MS;
- ipClassHintTtlMs = DEFAULT_IP_CLASS_HINT_TTL_MS;
-}
diff --git a/fluxer_api/src/api/middleware/AuditLogMiddleware.ts b/fluxer_api/src/api/middleware/AuditLogMiddleware.ts
index 44c35f3bf..f2ba4aa8b 100644
--- a/fluxer_api/src/api/middleware/AuditLogMiddleware.ts
+++ b/fluxer_api/src/api/middleware/AuditLogMiddleware.ts
@@ -6,10 +6,33 @@ import {InputValidationError} from '@fluxer/errors/src/domains/core/InputValidat
import {AuditLogReasonType} from '@fluxer/schema/src/primitives/ChannelValidators';
import {createMiddleware} from 'hono/factory';
+const utf8Decoder = new TextDecoder('utf-8', {fatal: true});
+
+function hasOnlyLatin1WithHighBytes(value: string): boolean {
+ let high = false;
+ for (let index = 0; index < value.length; index++) {
+ const code = value.charCodeAt(index);
+ if (code > 0xff) return false;
+ if (code >= 0x80) high = true;
+ }
+ return high;
+}
+
+export function decodeHeaderUtf8(value: string): string {
+ if (!hasOnlyLatin1WithHighBytes(value)) {
+ return value;
+ }
+ try {
+ return utf8Decoder.decode(Buffer.from(value, 'latin1'));
+ } catch {
+ return value;
+ }
+}
+
export const AuditLogMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
const auditLogReasonHeader = ctx.req.header('X-Audit-Log-Reason');
if (auditLogReasonHeader) {
- const result = AuditLogReasonType.safeParse(auditLogReasonHeader);
+ const result = AuditLogReasonType.safeParse(decodeHeaderUtf8(auditLogReasonHeader));
if (!result.success) {
throw InputValidationError.fromCode('X-Audit-Log-Reason', ValidationErrorCodes.INVALID_AUDIT_LOG_REASON);
}
diff --git a/fluxer_api/src/api/middleware/CaptchaMiddleware.ts b/fluxer_api/src/api/middleware/CaptchaMiddleware.ts
index 684f9f388..e7e60beee 100644
--- a/fluxer_api/src/api/middleware/CaptchaMiddleware.ts
+++ b/fluxer_api/src/api/middleware/CaptchaMiddleware.ts
@@ -3,12 +3,13 @@
import {createHmac} from 'node:crypto';
import {Config} from '@app/api/Config';
import {ANONYMOUS_EXPERIMENT_TARGETING, resolveExperimentTargeting} from '@app/api/experiment/ExperimentTargeting';
+import {sharedListHas} from '@app/api/infrastructure/activity/SharedLists';
import type {InstanceCaptchaEffectiveConfig} from '@app/api/instance/InstanceConfigRepository';
import {Logger} from '@app/api/Logger';
import {getKVClient} from '@app/api/middleware/ServiceRegistry';
import type {User} from '@app/api/models/User';
-import {accountPolicyContactHasCapability} from '@app/api/risk/AccountPolicyService';
import type {HonoEnv} from '@app/api/types/HonoEnv';
+import {extractEmailDomain} from '@app/api/utils/EmailDomainUtils';
import {Headers} from '@fluxer/constants/src/Headers';
import {UserFlags} from '@fluxer/constants/src/UserConstants';
import {CaptchaRequiredError, InvalidCaptchaError} from '@fluxer/errors/src/CaptchaErrors';
@@ -91,7 +92,7 @@ export async function verifyCaptchaToken(ctx: Context<HonoEnv>): Promise<void> {
const captchaConfig = await ctx.get('instanceConfigRepository').getEffectiveCaptchaConfig();
if (!captchaConfig.enabled && !(Config.dev.testModeEnabled && Config.captcha.enabled)) return;
const user = ctx.get('user') as User | undefined;
- if (accountPolicyContactHasCapability(user?.email, 'captcha_exempt')) return;
+ if (sharedListHas('email_domain_exempt', extractEmailDomain(user?.email))) return;
if (userHasCaptchaExemptFlag(user)) return;
if (await requestUserHasCaptchaExemptFlag(ctx)) return;
const altcha = await resolveAltchaProvider(ctx, user);
diff --git a/fluxer_api/src/api/middleware/IpBanMiddleware.ts b/fluxer_api/src/api/middleware/IpBanMiddleware.ts
index c213d3ffa..d662d8db0 100644
--- a/fluxer_api/src/api/middleware/IpBanMiddleware.ts
+++ b/fluxer_api/src/api/middleware/IpBanMiddleware.ts
@@ -2,9 +2,10 @@
import {AdminRepository} from '@app/api/admin/AdminRepository';
import type {BannedIpEntry, BannedIpKind} from '@app/api/admin/IAdminRepository';
+import {isIpBanExempt} from '@app/api/ban/IpBanExemptions';
import {IP_BAN_REFRESH_CHANNEL} from '@app/api/constants/IpBan';
+import {sharedListHas} from '@app/api/infrastructure/activity/SharedLists';
import {Logger} from '@app/api/Logger';
-import {isIpBanExempt} from '@app/api/risk/IpBanExemptions';
import type {HonoEnv} from '@app/api/types/HonoEnv';
import {parseIpBanEntry, tryParseSingleIp} from '@app/api/utils/IpRangeUtils';
import {RefreshSubscription} from '@app/api/utils/RefreshSubscription';
@@ -328,5 +329,8 @@ export const IpBanMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
expiresAt: match.expiresAt,
});
}
+ if (clientIp && !isIpBanExempt(clientIp) && sharedListHas('ip_blocked', clientIp)) {
+ throw new IpBannedError({ipAddress: clientIp, kind: 'permanent'});
+ }
await next();
});
diff --git a/fluxer_api/src/api/middleware/RequestErrorTelemetry.ts b/fluxer_api/src/api/middleware/RequestErrorTelemetry.ts
new file mode 100644
index 000000000..b7cf50d56
--- /dev/null
+++ b/fluxer_api/src/api/middleware/RequestErrorTelemetry.ts
@@ -0,0 +1,129 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createHash} from 'node:crypto';
+import {isIpBanExempt} from '@app/api/ban/IpBanExemptions';
+import {Config} from '@app/api/Config';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import {workerMeta} from '@app/api/infrastructure/activity/ActivityMeta';
+import type {HonoEnv} from '@app/api/types/HonoEnv';
+import {extractClientIp} from '@fluxer/ip_utils/src/ClientIp';
+import {getSameIpDecisionKey, isPublicIpAddress, parseIpAddress} from '@fluxer/ip_utils/src/IpAddress';
+import {createMiddleware} from 'hono/factory';
+
+const FLUSH_INTERVAL_MS = 5000;
+const MAX_IPS_PER_FLUSH = 500;
+const MAX_TOKEN_HASHES = 20;
+
+interface IpErrorCounts {
+ ip: string;
+ s401: number;
+ s403: number;
+ s404: number;
+ s429: number;
+ other4xx: number;
+ authFailures: number;
+ tokenHashes: Set<string>;
+}
+
+let pending = new Map<string, IpErrorCounts>();
+let windowStartedAt = Date.now();
+let flushTimer: ReturnType<typeof setInterval> | null = null;
+const recordedRequests = new WeakSet<Request>();
+
+export function hashRequestToken(token: string): string {
+ return createHash('sha256').update(token).digest('hex').slice(0, 32);
+}
+
+function countsFor(ip: string | null): IpErrorCounts | null {
+ if (!ip) return null;
+ const parsed = parseIpAddress(ip);
+ if (!parsed || !isPublicIpAddress(parsed.normalized) || isIpBanExempt(parsed.normalized)) return null;
+ const key = getSameIpDecisionKey(parsed.normalized) ?? parsed.normalized;
+ let counts = pending.get(key);
+ if (!counts) {
+ if (pending.size >= MAX_IPS_PER_FLUSH) return null;
+ counts = {
+ ip: parsed.normalized,
+ s401: 0,
+ s403: 0,
+ s404: 0,
+ s429: 0,
+ other4xx: 0,
+ authFailures: 0,
+ tokenHashes: new Set(),
+ };
+ pending.set(key, counts);
+ }
+ return counts;
+}
+
+export function recordRequestStatus(request: Request, status: number): void {
+ if (status < 400 || status >= 500 || recordedRequests.has(request)) return;
+ recordedRequests.add(request);
+ const counts = countsFor(
+ extractClientIp(request, {
+ trustClientIpHeader: Config.proxy.trust_client_ip_header,
+ clientIpHeaderName: Config.proxy.client_ip_header,
+ }),
+ );
+ if (!counts) return;
+ if (status === 401) counts.s401++;
+ else if (status === 403) counts.s403++;
+ else if (status === 404) counts.s404++;
+ else if (status === 429) counts.s429++;
+ else counts.other4xx++;
+}
+
+export function recordAuthFailure(ip: string | null, tokenHash: string | null): void {
+ const counts = countsFor(ip);
+ if (!counts) return;
+ counts.authFailures++;
+ if (tokenHash && counts.tokenHashes.size < MAX_TOKEN_HASHES) counts.tokenHashes.add(tokenHash);
+}
+
+export const RequestErrorTelemetry = createMiddleware<HonoEnv>(async (ctx, next) => {
+ await next();
+ if (ctx.get('user')) return;
+ recordRequestStatus(ctx.req.raw, ctx.res.status);
+});
+
+export function flushRequestErrorTelemetry(nowMs = Date.now()): number {
+ const flushed = pending;
+ const windowMs = Math.max(0, Math.min(nowMs - windowStartedAt, 0xffffffff));
+ pending = new Map();
+ windowStartedAt = nowMs;
+ for (const [key, counts] of flushed) {
+ void emitActivity(
+ 'http_errors',
+ `ip:${key}`,
+ {
+ ip: counts.ip,
+ window_ms: windowMs,
+ s401: counts.s401,
+ s403: counts.s403,
+ s404: counts.s404,
+ s429: counts.s429,
+ other_4xx: counts.other4xx,
+ auth_failures: counts.authFailures,
+ token_hashes: [...counts.tokenHashes],
+ },
+ {...workerMeta(), channel: 'other', ip: counts.ip},
+ );
+ }
+ return flushed.size;
+}
+
+export function startRequestErrorTelemetry(): void {
+ if (flushTimer) return;
+ windowStartedAt = Date.now();
+ flushTimer = setInterval(() => {
+ flushRequestErrorTelemetry();
+ }, FLUSH_INTERVAL_MS);
+ flushTimer.unref?.();
+}
+
+export function stopRequestErrorTelemetry(): void {
+ if (flushTimer) clearInterval(flushTimer);
+ flushTimer = null;
+ pending = new Map();
+}
diff --git a/fluxer_api/src/api/middleware/ServiceMiddleware.ts b/fluxer_api/src/api/middleware/ServiceMiddleware.ts
index c66cd62ec..6c0ebf88e 100644
--- a/fluxer_api/src/api/middleware/ServiceMiddleware.ts
+++ b/fluxer_api/src/api/middleware/ServiceMiddleware.ts
@@ -5,16 +5,8 @@ import type {ApiContext} from '@app/api/ApiContext';
import {AdminService} from '@app/api/admin/AdminService';
import {AuthRequestService} from '@app/api/auth/AuthRequestService';
import {DesktopHandoffService} from '@app/api/auth/services/DesktopHandoffService';
-import {
- CassandraInboundSmsChallengeRepository,
- InboundSmsChallengeService,
-} from '@app/api/auth/services/InboundSmsChallengeService';
-import type {IRegistrationRiskEvaluator} from '@app/api/auth/services/IRegistrationRiskEvaluator';
-import {
- noopRegistrationRiskEvaluator,
- RegistrationRiskEvaluator,
-} from '@app/api/auth/services/RegistrationRiskEvaluator';
import {SsoService} from '@app/api/auth/services/SsoService';
+import {buildIpInfoCache, buildIpInfoRequestAuditLogger} from '@app/api/ban/IpInfoCacheFactory';
import type {IBlueskyOAuthService} from '@app/api/bluesky/IBlueskyOAuthService';
import {Config} from '@app/api/Config';
import {createApiContext} from '@app/api/CreateApiContext';
@@ -43,7 +35,6 @@ import {VoiceRoomStore} from '@app/api/infrastructure/VoiceRoomStore';
import {SingleCommunityService} from '@app/api/instance/SingleCommunityService';
import {InviteRequestService} from '@app/api/invite/InviteRequestService';
import {JobLedgerRepository} from '@app/api/jobs/JobLedgerRepository';
-import {Logger} from '@app/api/Logger';
import {createGuildStackServices, type GuildStackServices} from '@app/api/middleware/GuildStackServiceFactory';
import {installLazyServices, type RequestScopedServices} from '@app/api/middleware/LazyServiceProvider';
import type {RequestCache} from '@app/api/middleware/RequestCacheMiddleware';
@@ -125,33 +116,12 @@ import {OAuth2RequestService} from '@app/api/oauth/OAuth2RequestService';
import {OAuth2Service} from '@app/api/oauth/OAuth2Service';
import {ReportRequestService} from '@app/api/report/ReportRequestService';
import {ReportService} from '@app/api/report/ReportService';
-import type {IAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyEvaluator';
-import {
- getAccountPolicyEvaluator,
- setInjectedAccountPolicyEvaluator as setInjectedAccountPolicyEvaluatorInService,
-} from '@app/api/risk/AccountPolicyService';
-import {createIpInfoChecker} from '@app/api/risk/adapters/IpInfoAdapter';
-import {createReverseDnsLookup} from '@app/api/risk/adapters/ReverseDnsAdapter';
-import {DeterministicRiskEngine} from '@app/api/risk/DeterministicRiskEngine';
-import {CassandraHistoricalOutcomeRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import {createKvIpInfoLookupBudget} from '@app/api/risk/IpInfoBudget';
-import {buildIpInfoCache, buildIpInfoRequestAuditLogger} from '@app/api/risk/IpInfoCacheFactory';
-import {CassandraRegistrationEventsRepository} from '@app/api/risk/RegistrationEventsRepository';
-import {
- type IpInfoPrescreenVerdict,
- ipInfoPrescreenOptionsFromEnv,
- prescreenIpInfoLookup,
-} from '@app/api/risk/RegistrationIpPrescreen';
-import {CassandraRiskAssessmentRepository} from '@app/api/risk/RiskAssessmentRepository';
-import {createRiskToolbox} from '@app/api/risk/RiskToolboxFactory';
-import {CassandraSuspiciousIpRepository} from '@app/api/risk/SuspiciousIpRepository';
import {RpcService} from '@app/api/rpc/RpcService';
import {getReportSearchService} from '@app/api/SearchFactory';
import {SearchService} from '@app/api/search/SearchService';
import {StripeService} from '@app/api/stripe/StripeService';
import {AgeVerificationService} from '@app/api/stripe/services/AgeVerificationService';
import type {HonoEnv} from '@app/api/types/HonoEnv';
-import type {UserRepository} from '@app/api/user/repositories/UserRepository';
import {EmailChangeService} from '@app/api/user/services/EmailChangeService';
import {MfaBackupCodesChallengeService} from '@app/api/user/services/MfaBackupCodesChallengeService';
import {PasswordChangeService} from '@app/api/user/services/PasswordChangeService';
@@ -165,7 +135,6 @@ import {getRequestClientIp} from '@app/api/utils/RequestClientIp';
import {VoiceService} from '@app/api/voice/VoiceService';
import {WebhookRequestService} from '@app/api/webhook/WebhookRequestService';
import {WebhookService} from '@app/api/webhook/WebhookService';
-import {lookupAsnByIp, lookupGeoipByIp} from '@pkgs/geoip/src/GeoipLookup';
import {createIpInfoService, createUnavailableIpInfoService, type IpInfoService} from '@pkgs/geoip/src/IpInfoService';
import {createMiddleware} from 'hono/factory';
@@ -200,60 +169,6 @@ export function shutdownReportService(): void {
}
}
-let _inboundSmsChallengeService: InboundSmsChallengeService | null = null;
-
-function getInboundSmsChallengeService(): InboundSmsChallengeService {
- if (!_inboundSmsChallengeService) {
- _inboundSmsChallengeService = new InboundSmsChallengeService(
- new CassandraInboundSmsChallengeRepository(),
- getKVClient(),
- );
- }
- return _inboundSmsChallengeService;
-}
-
-export function getInboundSmsChallengeServiceInstance(): InboundSmsChallengeService {
- return getInboundSmsChallengeService();
-}
-
-export function getUserRepositoryInstance(): UserRepository {
- return getUserRepository();
-}
-
-let _registrationEventsRepository: CassandraRegistrationEventsRepository | null = null;
-
-function getRegistrationEventsRepository(): CassandraRegistrationEventsRepository {
- if (!_registrationEventsRepository) {
- _registrationEventsRepository = new CassandraRegistrationEventsRepository();
- }
- return _registrationEventsRepository;
-}
-
-let _riskAssessmentRepository: CassandraRiskAssessmentRepository | null = null;
-
-function getRiskAssessmentRepository(): CassandraRiskAssessmentRepository {
- if (!_riskAssessmentRepository) {
- _riskAssessmentRepository = new CassandraRiskAssessmentRepository();
- }
- return _riskAssessmentRepository;
-}
-
-let _historicalOutcomeRepository: CassandraHistoricalOutcomeRepository | null = null;
-
-export function getHistoricalOutcomeRepository(): CassandraHistoricalOutcomeRepository {
- if (_historicalOutcomeRepository) return _historicalOutcomeRepository;
- _historicalOutcomeRepository = new CassandraHistoricalOutcomeRepository();
- return _historicalOutcomeRepository;
-}
-
-let _suspiciousIpRepository: CassandraSuspiciousIpRepository | null = null;
-
-export function getSuspiciousIpRepository(): CassandraSuspiciousIpRepository {
- if (_suspiciousIpRepository) return _suspiciousIpRepository;
- _suspiciousIpRepository = new CassandraSuspiciousIpRepository();
- return _suspiciousIpRepository;
-}
-
let _ipInfoService: IpInfoService | null = null;
let _injectedIpInfoService: IpInfoService | undefined;
@@ -266,7 +181,7 @@ export function getIpInfoService(): IpInfoService {
return _injectedIpInfoService;
}
if (_ipInfoService) return _ipInfoService;
- if (!Config.risk.ipinfoApiKey) {
+ if (!Config.ipinfo.apiKey) {
_ipInfoService = createUnavailableIpInfoService('IPInfo API key not configured');
return _ipInfoService;
}
@@ -274,65 +189,13 @@ export function getIpInfoService(): IpInfoService {
hot: getCacheService(),
});
_ipInfoService = createIpInfoService({
- apiKey: Config.risk.ipinfoApiKey,
+ apiKey: Config.ipinfo.apiKey,
cache,
auditLogger: buildIpInfoRequestAuditLogger(),
- budget: createKvIpInfoLookupBudget({getKvClient: getKVClient}),
});
return _ipInfoService;
}
-let _registrationRiskEvaluator: IRegistrationRiskEvaluator | null = null;
-
-export function setInjectedRegistrationRiskEvaluator(evaluator: IRegistrationRiskEvaluator | undefined): void {
- _registrationRiskEvaluator = evaluator ?? null;
-}
-
-export function setInjectedAccountPolicyEvaluator(evaluator: IAccountPolicyEvaluator | undefined): void {
- setInjectedAccountPolicyEvaluatorInService(evaluator);
-}
-
-function getRegistrationRiskEvaluator(): IRegistrationRiskEvaluator {
- if (_registrationRiskEvaluator) return _registrationRiskEvaluator;
- if (!Config.risk.enabled) {
- Logger.info(
- {},
- '[ServiceMiddleware] integrations.risk_integration.enabled is false — account risk scoring is disabled',
- );
- _registrationRiskEvaluator = noopRegistrationRiskEvaluator;
- return _registrationRiskEvaluator;
- }
- const ipInfoService = getIpInfoService();
- const lookupLocalCity = (ip: string) => lookupGeoipByIp(ip, Config.geoip.maxmindDbPath);
- const lookupLocalAsn = (ip: string) => lookupAsnByIp(ip, Config.geoip.maxmindAsnDbPath);
- const prescreenOptions = ipInfoPrescreenOptionsFromEnv();
- const prescreen = async (ip: string): Promise<IpInfoPrescreenVerdict> => {
- const [city, asn] = await Promise.all([lookupLocalCity(ip), lookupLocalAsn(ip)]);
- return prescreenIpInfoLookup({countryIso: city.countryCode, asn: asn.asn, asnOrg: asn.asnOrg}, prescreenOptions);
- };
- const ipInfoChecker = Config.risk.ipinfoApiKey ? createIpInfoChecker({ipInfoService, prescreen}) : undefined;
- const cacheService = getCacheService();
- const reverseDnsLookup = createReverseDnsLookup({cacheService});
- const toolbox = createRiskToolbox({
- adminRepository: getAdminRepository(),
- ipInfoChecker,
- reverseDnsLookup,
- ipInfoService,
- registrationEventsRepository: getRegistrationEventsRepository(),
- historicalOutcomeRepository: getHistoricalOutcomeRepository(),
- suspiciousIpRepository: getSuspiciousIpRepository(),
- cacheService,
- lookupLocalCity,
- lookupLocalAsn,
- });
- const engine = new DeterministicRiskEngine(toolbox, {
- logger: Logger,
- });
- const evaluator = new RegistrationRiskEvaluator(engine);
- _registrationRiskEvaluator = evaluator;
- return _registrationRiskEvaluator;
-}
-
let _liveKitWebhookService: LiveKitWebhookService | null = null;
function getLiveKitWebhookService(): LiveKitWebhookService | null {
@@ -676,10 +539,8 @@ class RequestServices implements RequestScopedServices {
getKVBulkMessageDeletionQueue(),
getApplicationRepository(),
this.stripeService.getStripe(),
- getHistoricalOutcomeRepository(),
new JobLedgerRepository(),
getIpInfoService(),
- getSuspiciousIpRepository(),
);
return this.cachedAdminService;
}
@@ -713,8 +574,6 @@ class RequestServices implements RequestScopedServices {
get authRequestService(): AuthRequestService {
if (!this.cachedAuthRequestService) {
- const adminRepository = getAdminRepository();
- const registrationRiskEvaluator = getRegistrationRiskEvaluator();
this.cachedAuthRequestService = new AuthRequestService(
this.context,
this.ssoService,
@@ -725,13 +584,6 @@ class RequestServices implements RequestScopedServices {
singleCommunityService: this.singleCommunityService,
discriminatorService: getDiscriminatorService(),
kvActivityTracker: getKVActivityTracker(),
- registrationRiskEvaluator: registrationRiskEvaluator ?? noopRegistrationRiskEvaluator,
- accountPolicyEvaluator: getAccountPolicyEvaluator(),
- isEmailDomainSuspicious: adminRepository.isEmailDomainSuspicious.bind(adminRepository),
- isEmailDomainDisposable: adminRepository.isEmailDomainDisposable.bind(adminRepository),
- registrationEventsRepository: getRegistrationEventsRepository(),
- riskAssessmentRepository: getRiskAssessmentRepository(),
- riskHistoryRepository: getHistoricalOutcomeRepository(),
},
{
inviteService: this.inviteService,
@@ -969,20 +821,12 @@ class RequestServices implements RequestScopedServices {
get userAccountRequestService(): UserAccountRequestService {
if (!this.cachedUserAccountRequestService) {
- const adminRepository = getAdminRepository();
this.cachedUserAccountRequestService = new UserAccountRequestService(
this.emailChangeService,
this.userService.accountService,
this.userService.channelService,
getUserRepository(),
getUserCacheService(),
- adminRepository.isEmailDomainSuspicious.bind(adminRepository),
- adminRepository.isEmailDomainDisposable.bind(adminRepository),
- getRegistrationRiskEvaluator(),
- getAccountPolicyEvaluator(),
- getRegistrationEventsRepository(),
- getRiskAssessmentRepository(),
- getHistoricalOutcomeRepository(),
);
}
return this.cachedUserAccountRequestService;
@@ -1068,12 +912,6 @@ export const ServiceMiddleware = createMiddleware<HonoEnv>(async (ctx, next) =>
export function resetServiceMiddlewareForTesting(): void {
shutdownReportService();
- _inboundSmsChallengeService = null;
- _registrationEventsRepository = null;
- _riskAssessmentRepository = null;
- _historicalOutcomeRepository = null;
- _suspiciousIpRepository = null;
_ipInfoService = null;
- _registrationRiskEvaluator = null;
_liveKitWebhookService = null;
}
diff --git a/fluxer_api/src/api/middleware/ServiceSingletons.ts b/fluxer_api/src/api/middleware/ServiceSingletons.ts
index cfad4290a..9e73bb959 100644
--- a/fluxer_api/src/api/middleware/ServiceSingletons.ts
+++ b/fluxer_api/src/api/middleware/ServiceSingletons.ts
@@ -6,9 +6,6 @@ import {AdminArchiveRepository} from '@app/api/admin/repositories/AdminArchiveRe
import {AdminApiKeyService} from '@app/api/admin/services/AdminApiKeyService';
import {AdminArchiveService} from '@app/api/admin/services/AdminArchiveService';
import {AdminAuditService} from '@app/api/admin/services/AdminAuditService';
-import {PhoneAttemptRiskService} from '@app/api/auth/services/PhoneAttemptRiskService';
-import {PhoneFraudGraphService} from '@app/api/auth/services/PhoneFraudGraphService';
-import type {UserID} from '@app/api/BrandedTypes';
import {Config} from '@app/api/Config';
import {ChannelRepository} from '@app/api/channel/ChannelRepository';
import {AttachmentUploadTraceRepository} from '@app/api/channel/repositories/message/AttachmentUploadTraceRepository';
@@ -91,7 +88,6 @@ import {UserPermissionUtils} from '@app/api/utils/UserPermissionUtils';
import {VoiceRepository} from '@app/api/voice/VoiceRepository';
import {SweegoWebhookService} from '@app/api/webhook/SweegoWebhookService';
import {WebhookRepository} from '@app/api/webhook/WebhookRepository';
-import {createMockLogger} from '@fluxer/logger/src/mock';
import type {ICacheService} from '@pkgs/cache/src/ICacheService';
import {KVCacheProvider} from '@pkgs/cache/src/providers/KVCacheProvider';
import {EmailI18nService} from '@pkgs/email/src/EmailI18nService';
@@ -102,9 +98,6 @@ import {TestEmailService} from '@pkgs/email/src/TestEmailService';
import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
import {NatsConnectionManager} from '@pkgs/nats/src/NatsConnectionManager';
import {RateLimitService} from '@pkgs/rate_limit/src/RateLimitService';
-import type {ISmsProvider} from '@pkgs/sms/src/providers/ISmsProvider';
-import {createSmsProvider} from '@pkgs/sms/src/providers/SmsProviderFactory';
-import {SmsService} from '@pkgs/sms/src/SmsService';
import type {IVirusScanService} from '@pkgs/virus_scan/src/IVirusScanService';
export const getUserRepository = singleton(() => new UserRepository(getKVClient()));
@@ -171,17 +164,6 @@ export const getPushRelayConfigPublisher = singleton(
export const getVisionarySlotRepository = singleton(() => new VisionarySlotRepository());
export const getCacheService: () => ICacheService = singleton(() => new KVCacheProvider({client: getKVClient()}));
export const getRateLimitService = singleton(() => new RateLimitService(getKVClient()));
-export const getPhoneFraudGraphService = singleton(
- () => new PhoneFraudGraphService(getKVClient(), getUserRepository()),
-);
-export const getPhoneAttemptRiskService = singleton(() => {
- const service = new PhoneAttemptRiskService(getCacheService(), getKVClient());
- const graph = getPhoneFraudGraphService();
- service.onHardBlock(({userId, clientIp}) => {
- void graph.propagateHardBlock(userId ? (BigInt(userId) as UserID) : null, clientIp);
- });
- return service;
-});
export const getEmailDnsValidationService = singleton(() => new EmailDnsValidationService());
function createEmailServiceForConfig(
@@ -362,23 +344,6 @@ export async function ensureVirusScanInitialized(): Promise<void> {
await _virusScanInitPromise;
}
-const getSmsProvider: () => ISmsProvider = singleton(() => {
- if (Config.dev.testModeEnabled) {
- return createSmsProvider({mode: 'test', logger: createMockLogger()});
- }
- if (Config.sms.enabled && Config.sms.accountSid && Config.sms.authToken && Config.sms.verifyServiceSid) {
- return createSmsProvider({
- mode: 'twilio',
- config: {
- accountSid: Config.sms.accountSid,
- authToken: Config.sms.authToken,
- verifyServiceSid: Config.sms.verifyServiceSid,
- },
- });
- }
- return createSmsProvider({mode: 'unavailable'});
-});
-export const getSmsService = singleton(() => new SmsService(getSmsProvider()));
export const getEmailService: () => IEmailService = singleton(() => {
if (Config.dev.testModeEnabled) return new TestEmailService();
const userRepository = getUserRepository();
@@ -424,7 +389,7 @@ export const getReadStateService = singleton(() => new ReadStateService(getReadS
export const getDiscriminatorService = singleton(
() => new DiscriminatorService(getUserRepository(), getCacheService(), getLimitConfigService()),
);
-export const getBotAuthService = singleton(() => new BotAuthService(getApplicationRepository()));
+export const getBotAuthService = singleton(() => new BotAuthService(getApplicationRepository(), getUserRepository()));
export const getBotMfaMirrorService = singleton(
() => new BotMfaMirrorService(getApplicationRepository(), getUserRepository(), getGatewayService()),
);
diff --git a/fluxer_api/src/api/middleware/TorExitListCache.ts b/fluxer_api/src/api/middleware/TorExitListCache.ts
deleted file mode 100644
index 81e4f2dae..000000000
--- a/fluxer_api/src/api/middleware/TorExitListCache.ts
+++ /dev/null
@@ -1,395 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {randomInt, randomUUID} from 'node:crypto';
-import {setTimeout as delay} from 'node:timers/promises';
-import {Logger} from '@app/api/Logger';
-import {streamToStringWithLimit} from '@app/api/utils/FetchUtils';
-import {parseIpAddress} from '@fluxer/ip_utils/src/IpAddress';
-import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
-import {z} from 'zod';
-
-const ONIONOO_URL =
- 'https://onionoo.torproject.org/details?type=relay&running=true&flag=Exit&fields=exit_addresses,or_addresses';
-const FETCH_TIMEOUT_MS = 30000;
-const MAX_RESPONSE_BYTES = 8 * 1024 * 1024;
-const REFRESH_INTERVAL_MS = 30 * 60 * 1000;
-const REFRESH_JITTER_MS = 2 * 60 * 1000;
-const OPPORTUNISTIC_REFRESH_MIN_MS = 60000;
-const OPPORTUNISTIC_REFRESH_MAX_MS = 3 * 60000;
-const KV_PAYLOAD_KEY = 'fluxer:tor_exit_list:payload';
-const KV_LOCK_KEY = 'fluxer:tor_exit_list:lock';
-const LOCK_TTL_SECONDS = 5 * 60;
-const PAYLOAD_TTL_SECONDS = 60 * 60;
-const HYDRATE_WAIT_MS = 60000;
-const HYDRATE_POLL_MIN_MS = 500;
-const HYDRATE_POLL_MAX_MS = 5000;
-
-const OnionooDetailsSchema = z.object({
- relays: z.array(
- z.object({
- or_addresses: z.array(z.string()).optional(),
- exit_addresses: z.array(z.string()).optional(),
- }),
- ),
-});
-
-interface TorExitSnapshot {
- readonly payload: string;
- readonly lastModified: string | null;
-}
-
-class TorExitListCache {
- private ipv4Exits: ReadonlySet<string> = new Set();
- private ipv6Exits: ReadonlySet<string> = new Set();
- private kvClient: IKVProvider | null = null;
- private refreshTimer: NodeJS.Timeout | null = null;
- private initPromise: Promise<void> | null = null;
- private refreshPromise: Promise<void> | null = null;
- private shutdownPromise: Promise<void> | null = null;
- private lifecycle = new AbortController();
- private fetchedSnapshot: TorExitSnapshot | null = null;
-
- setKvClient(kv: IKVProvider | null): void {
- this.kvClient = kv;
- }
-
- initialize(): Promise<void> {
- if (this.shutdownPromise) return Promise.reject(new Error('Tor exit list cache is shutting down'));
- if (this.lifecycle.signal.aborted) this.lifecycle = new AbortController();
- if (!this.initPromise) {
- this.initPromise = Promise.resolve(this.refreshPromise)
- .then(() => this.doInitialize())
- .catch((err) => {
- this.initPromise = null;
- throw err;
- });
- }
- return this.initPromise;
- }
-
- shutdown(): Promise<void> {
- if (this.shutdownPromise) return this.shutdownPromise;
- this.lifecycle.abort(new Error('Tor exit list cache is shut down'));
- if (this.refreshTimer) {
- clearTimeout(this.refreshTimer);
- this.refreshTimer = null;
- }
- this.shutdownPromise = Promise.allSettled([this.initPromise, this.refreshPromise]).then(() => {
- this.initPromise = null;
- this.shutdownPromise = null;
- });
- return this.shutdownPromise;
- }
-
- isTorExit(ip: string): boolean {
- const parsed = parseIpAddress(ip);
- if (!parsed) return false;
- return parsed.family === 'ipv4' ? this.ipv4Exits.has(parsed.normalized) : this.ipv6Exits.has(parsed.normalized);
- }
-
- async forceRefresh(): Promise<void> {
- await this.refresh();
- }
-
- seedForTesting(ips: Iterable<string>): void {
- this.applyPayload(Array.from(ips).join('\n'));
- }
-
- clearForTesting(): void {
- this.ipv4Exits = new Set();
- this.ipv6Exits = new Set();
- this.fetchedSnapshot = null;
- }
-
- private async doInitialize(): Promise<void> {
- this.lifecycle.signal.throwIfAborted();
- const cached = await this.readPayloadFromKv();
- if (cached !== null) {
- this.applyPayload(cached);
- Logger.info({ipv4Count: this.ipv4Exits.size, ipv6Count: this.ipv6Exits.size}, 'Tor exit list hydrated from KV');
- this.scheduleNextRefresh(this.opportunisticRefreshDelayMs());
- return;
- }
- await this.hydrateFromTorOrWait();
- this.scheduleNextRefresh(REFRESH_INTERVAL_MS);
- }
-
- private scheduleNextRefresh(baseDelayMs: number): void {
- const signal = this.lifecycle.signal;
- if (signal.aborted) return;
- if (this.refreshTimer) {
- clearTimeout(this.refreshTimer);
- this.refreshTimer = null;
- }
- const jitter = randomInt(REFRESH_JITTER_MS * 2) - REFRESH_JITTER_MS;
- const delay = Math.max(1000, baseDelayMs + jitter);
- this.refreshTimer = setTimeout(() => {
- this.refreshTimer = null;
- this.refresh()
- .catch((err) => {
- if (!signal.aborted) {
- Logger.warn({error: err instanceof Error ? err.message : String(err)}, 'Tor exit list refresh failed');
- }
- })
- .finally(() => {
- if (!signal.aborted) this.scheduleNextRefresh(REFRESH_INTERVAL_MS);
- });
- }, delay);
- this.refreshTimer.unref?.();
- }
-
- private opportunisticRefreshDelayMs(): number {
- const range = OPPORTUNISTIC_REFRESH_MAX_MS - OPPORTUNISTIC_REFRESH_MIN_MS;
- return OPPORTUNISTIC_REFRESH_MIN_MS + randomInt(range);
- }
-
- private async refresh(): Promise<void> {
- this.lifecycle.signal.throwIfAborted();
- this.refreshPromise ??= Promise.resolve(this.initPromise)
- .then(() => this.tryRefresh())
- .finally(() => {
- this.refreshPromise = null;
- });
- await this.refreshPromise;
- }
-
- private async tryRefresh(): Promise<void> {
- this.lifecycle.signal.throwIfAborted();
- const kv = this.kvClient;
- if (!kv) {
- const payload = await this.fetchFromTor();
- if (payload !== null) this.applyPayload(payload);
- return;
- }
- await this.withKvLock(kv, async (acquired) => {
- if (!acquired) {
- const cached = await this.readPayloadFromKv();
- if (cached !== null) this.applyPayload(cached);
- return;
- }
- const payload = await this.fetchFromTor();
- this.lifecycle.signal.throwIfAborted();
- if (payload === null) return;
- await this.writePayloadToKv(kv, payload);
- this.applyPayload(payload);
- Logger.info({ipv4Count: this.ipv4Exits.size, ipv6Count: this.ipv6Exits.size}, 'Tor exit list refreshed');
- });
- }
-
- private async hydrateFromTorOrWait(): Promise<void> {
- const kv = this.kvClient;
- if (!kv) {
- const payload = await this.fetchFromTor();
- if (payload !== null) {
- this.applyPayload(payload);
- return;
- }
- Logger.warn('Tor exit list bootstrap could not fetch; continuing with empty list');
- return;
- }
- const fetchedAsWinner = await this.withKvLock(kv, async (acquired) => {
- if (!acquired) return false;
- const payload = await this.fetchFromTor();
- this.lifecycle.signal.throwIfAborted();
- if (payload === null) {
- Logger.warn('Tor exit list bootstrap could not fetch; continuing with empty list');
- return true;
- }
- await this.writePayloadToKv(kv, payload);
- this.applyPayload(payload);
- Logger.info(
- {ipv4Count: this.ipv4Exits.size, ipv6Count: this.ipv6Exits.size},
- 'Tor exit list fetched and hydrated on startup',
- );
- return true;
- });
- if (fetchedAsWinner) return;
- const cached = await this.pollForPeerPayload();
- if (cached !== null) {
- this.applyPayload(cached);
- Logger.info(
- {ipv4Count: this.ipv4Exits.size, ipv6Count: this.ipv6Exits.size},
- 'Tor exit list hydrated from KV after peer fetch',
- );
- return;
- }
- Logger.warn('Tor exit list not available via KV after wait; fetching directly');
- const payload = await this.fetchFromTor();
- if (payload === null) {
- Logger.warn('Tor exit list bootstrap could not fetch; continuing with empty list');
- return;
- }
- this.applyPayload(payload);
- }
-
- private async pollForPeerPayload(): Promise<string | null> {
- const deadline = Date.now() + HYDRATE_WAIT_MS;
- let backoff = HYDRATE_POLL_MIN_MS;
- while (Date.now() < deadline) {
- await delay(backoff, undefined, {signal: this.lifecycle.signal});
- const cached = await this.readPayloadFromKv();
- if (cached !== null) return cached;
- backoff = Math.min(backoff * 2, HYDRATE_POLL_MAX_MS);
- }
- return null;
- }
-
- private async withKvLock<T>(kv: IKVProvider, fn: (acquired: boolean) => Promise<T>): Promise<T> {
- this.lifecycle.signal.throwIfAborted();
- const lockToken = randomUUID();
- const acquired = await kv.acquireLock(KV_LOCK_KEY, lockToken, LOCK_TTL_SECONDS).catch(() => false);
- try {
- this.lifecycle.signal.throwIfAborted();
- return await fn(acquired);
- } finally {
- if (acquired) {
- await kv.releaseLock(KV_LOCK_KEY, lockToken).catch((err) => {
- Logger.warn(
- {error: err instanceof Error ? err.message : String(err)},
- 'Failed to release Tor exit list KV lock (will expire on TTL)',
- );
- });
- }
- }
- }
-
- private async readPayloadFromKv(): Promise<string | null> {
- this.lifecycle.signal.throwIfAborted();
- const kv = this.kvClient;
- if (!kv) return null;
- try {
- const payload = await kv.get(KV_PAYLOAD_KEY);
- this.lifecycle.signal.throwIfAborted();
- return payload;
- } catch (err) {
- this.lifecycle.signal.throwIfAborted();
- Logger.warn({error: err instanceof Error ? err.message : String(err)}, 'Failed reading Tor exit list from KV');
- return null;
- }
- }
-
- private async writePayloadToKv(kv: IKVProvider, payload: string): Promise<void> {
- this.lifecycle.signal.throwIfAborted();
- try {
- await kv.setex(KV_PAYLOAD_KEY, PAYLOAD_TTL_SECONDS, payload);
- } catch (err) {
- Logger.warn(
- {error: err instanceof Error ? err.message : String(err)},
- 'Failed to write Tor exit list payload to KV',
- );
- }
- }
-
- private async fetchFromTor(): Promise<string | null> {
- const signal = this.lifecycle.signal;
- signal.throwIfAborted();
- const requestSignal = AbortSignal.any([AbortSignal.timeout(FETCH_TIMEOUT_MS), signal]);
- const snapshot = this.fetchedSnapshot;
- try {
- const headers: Record<string, string> = {
- Accept: 'application/json',
- 'Accept-Encoding': 'gzip',
- };
- if (snapshot?.lastModified) {
- headers['If-Modified-Since'] = snapshot.lastModified;
- }
- const res = await fetch(ONIONOO_URL, {
- signal: requestSignal,
- headers,
- });
- if (res.status === 304) {
- if (!snapshot?.lastModified) throw new Error('Onionoo returned 304 without a cached response');
- return snapshot.payload;
- }
- if (res.status !== 200) {
- await res.body?.cancel();
- Logger.warn({status: res.status}, 'Onionoo fetch returned non-OK status');
- return null;
- }
- const text = await streamToStringWithLimit(res.body, {
- maxBytes: MAX_RESPONSE_BYTES,
- headers: res.headers,
- description: 'Onionoo response',
- signal: requestSignal,
- });
- const parsed = OnionooDetailsSchema.safeParse(JSON.parse(text));
- if (!parsed.success) throw new Error('Onionoo returned invalid relay data');
- signal.throwIfAborted();
- const ips = new Set<string>();
- let invalidCount = 0;
- for (const relay of parsed.data.relays) {
- for (const address of [...(relay.or_addresses ?? []), ...(relay.exit_addresses ?? [])]) {
- const ip = parseIpAddress(stripHostPort(address) ?? '');
- if (!ip) {
- invalidCount++;
- continue;
- }
- ips.add(ip.normalized);
- }
- }
- if (invalidCount > 0) {
- Logger.warn({invalidCount}, 'Onionoo returned relay addresses that could not be parsed');
- }
- if (ips.size === 0 && parsed.data.relays.length > 0) {
- Logger.error(
- {relays: parsed.data.relays.length},
- 'Onionoo returned no usable relay addresses, keeping the current Tor exit list',
- );
- return null;
- }
- const payload = Array.from(ips).join('\n');
- this.fetchedSnapshot = {payload, lastModified: res.headers.get('last-modified')};
- return payload;
- } catch (err) {
- signal.throwIfAborted();
- if (requestSignal.aborted) {
- Logger.warn('Onionoo fetch timed out');
- } else {
- Logger.warn({error: err instanceof Error ? err.message : String(err)}, 'Onionoo fetch failed');
- }
- return null;
- }
- }
-
- private applyPayload(payload: string): void {
- const ipv4 = new Set<string>();
- const ipv6 = new Set<string>();
- let invalidCount = 0;
- for (const rawLine of payload.split('\n')) {
- const value = rawLine.trim();
- if (!value) continue;
- const parsed = parseIpAddress(value);
- if (!parsed) {
- invalidCount++;
- continue;
- }
- if (parsed.family === 'ipv4') {
- ipv4.add(parsed.normalized);
- } else {
- ipv6.add(parsed.normalized);
- }
- }
- if (invalidCount > 0) {
- Logger.warn({invalidCount}, 'Tor exit list payload contained lines that could not be parsed');
- }
- this.ipv4Exits = ipv4;
- this.ipv6Exits = ipv6;
- }
-}
-
-function stripHostPort(value: string): string | null {
- const trimmed = value.trim();
- if (!trimmed) return null;
- if (trimmed.startsWith('[')) {
- const end = trimmed.indexOf(']');
- if (end <= 1) return null;
- return trimmed.slice(1, end);
- }
- const firstColon = trimmed.indexOf(':');
- if (firstColon > 0 && firstColon === trimmed.lastIndexOf(':')) {
- return trimmed.slice(0, firstColon);
- }
- return trimmed || null;
-}
-
-export const torExitListCache = new TorExitListCache();
diff --git a/fluxer_api/src/api/middleware/TorExitMiddleware.ts b/fluxer_api/src/api/middleware/TorExitMiddleware.ts
deleted file mode 100644
index 4ec6c287d..000000000
--- a/fluxer_api/src/api/middleware/TorExitMiddleware.ts
+++ /dev/null
@@ -1,18 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {torExitListCache} from '@app/api/middleware/TorExitListCache';
-import type {HonoEnv} from '@app/api/types/HonoEnv';
-import {getRequestClientIp} from '@app/api/utils/RequestClientIp';
-import {IpBannedError} from '@fluxer/errors/src/domains/moderation/IpBannedError';
-import {createMiddleware} from 'hono/factory';
-
-export const TorExitMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
- const clientIp = getRequestClientIp(ctx);
- if (clientIp && torExitListCache.isTorExit(clientIp)) {
- throw new IpBannedError({
- ipAddress: clientIp,
- kind: 'permanent',
- });
- }
- await next();
-});
diff --git a/fluxer_api/src/api/middleware/UrlBlocklistCache.ts b/fluxer_api/src/api/middleware/UrlBlocklistCache.ts
index b88728ed8..236afe25d 100644
--- a/fluxer_api/src/api/middleware/UrlBlocklistCache.ts
+++ b/fluxer_api/src/api/middleware/UrlBlocklistCache.ts
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {AdminRepository} from '@app/api/admin/AdminRepository';
+import {BLOCKLIST_S3_KEYS, readLinesFromS3} from '@app/api/blocklist/BlocklistS3';
import {Config} from '@app/api/Config';
import {BANNED_URL_DOMAINS_REFRESH_CHANNEL, BANNED_URLS_REFRESH_CHANNEL} from '@app/api/constants/ContentModeration';
import type {IStorageService} from '@app/api/infrastructure/IStorageService';
import {Logger} from '@app/api/Logger';
-import {RISK_S3_KEYS, readLinesFromS3} from '@app/api/risk/RiskBlocklistS3';
import {RefreshSubscription} from '@app/api/utils/RefreshSubscription';
import {canonicalizeUrl} from '@app/api/utils/UrlNormalizer';
import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
@@ -70,7 +70,7 @@ class UrlBlocklistCache {
private async loadFeedUrls(): Promise<Set<string>> {
if (!this.storageService || !Config.blocklistFeeds.enabled) return new Set();
- const lines = await readLinesFromS3(this.storageService, RISK_S3_KEYS.feedUrls);
+ const lines = await readLinesFromS3(this.storageService, BLOCKLIST_S3_KEYS.feedUrls);
return new Set(lines);
}
diff --git a/fluxer_api/src/api/middleware/UserMiddleware.ts b/fluxer_api/src/api/middleware/UserMiddleware.ts
index 30d5e0e77..908128fbe 100644
--- a/fluxer_api/src/api/middleware/UserMiddleware.ts
+++ b/fluxer_api/src/api/middleware/UserMiddleware.ts
@@ -2,9 +2,10 @@
import * as AuthSession from '@app/api/auth/AuthSession';
import {Logger} from '@app/api/Logger';
-import {hashAuthToken, recordAbuseSignal} from '@app/api/middleware/AbusiveIpAutoBanner';
+import {hashRequestToken, recordAuthFailure} from '@app/api/middleware/RequestErrorTelemetry';
import type {User} from '@app/api/models/User';
import type {HonoEnv} from '@app/api/types/HonoEnv';
+import {isSignInRefused} from '@app/api/user/UserHelpers';
import {getRequestClientIp} from '@app/api/utils/RequestClientIp';
import {stripApiPrefix} from '@app/api/utils/RequestPathUtils';
import type {Context} from 'hono';
@@ -86,28 +87,33 @@ export const UserMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
ctx.set('authToken', undefined);
if (!parsed) {
if (rawAuthHeader) {
- recordAbuseSignal(resolvedClientIp, 'auth_failure:malformed', {tokenHash: hashAuthToken(rawAuthHeader)});
+ recordAuthFailure(resolvedClientIp, hashRequestToken(rawAuthHeader));
}
return next();
}
const {token, type} = parsed;
- const tokenHash = hashAuthToken(token);
+ const tokenHash = hashRequestToken(token);
ctx.set('authToken', token);
if (type === 'session') {
const apiContext = ctx.get('apiContext');
const authSession = await AuthSession.getAuthSessionByToken(apiContext, token);
if (authSession) {
- void AuthSession.updateAuthSessionLastUsed(apiContext, authSession.sessionIdHash);
const user = await apiContext.services.users.findUnique(authSession.userId);
- if (user) {
+ if (user && !isSignInRefused(user)) {
+ void AuthSession.updateAuthSessionLastUsed(apiContext, authSession.sessionIdHash);
ctx.set('authSession', authSession);
ctx.set('authTokenType', 'session');
setUserInContext(ctx, user, true);
} else {
- recordAbuseSignal(resolvedClientIp, 'auth_failure:session', {tokenHash});
+ recordAuthFailure(resolvedClientIp, tokenHash);
+ if (user) {
+ void AuthSession.revokeToken(apiContext, token).catch((error: unknown) => {
+ Logger.warn({error, userId: user.id}, 'Failed to revoke a refused session');
+ });
+ }
}
} else {
- recordAbuseSignal(resolvedClientIp, 'auth_failure:session', {tokenHash});
+ recordAuthFailure(resolvedClientIp, tokenHash);
}
await next();
return;
@@ -115,23 +121,22 @@ export const UserMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
if (type === 'bearer') {
const oauth2TokenRepository = ctx.get('oauth2TokenRepository');
const accessToken = await oauth2TokenRepository.getAccessToken(token);
- if (accessToken) {
+ const tokenUser = accessToken?.userId
+ ? await ctx.get('apiContext').services.users.findUnique(accessToken.userId)
+ : null;
+ if (accessToken && !(tokenUser && isSignInRefused(tokenUser))) {
ctx.set('oauthBearerToken', token);
ctx.set('oauthBearerApplicationId', accessToken.applicationId);
ctx.set('oauthBearerScopes', accessToken.scope);
ctx.set('oauthBearerUserId', accessToken.userId ?? undefined);
ctx.set('authTokenType', 'bearer');
- const userId = accessToken.userId ?? null;
- if (userId) {
- const user = await ctx.get('apiContext').services.users.findUnique(userId);
- if (user) {
- setUserInContext(ctx, user, false);
- }
+ if (tokenUser) {
+ setUserInContext(ctx, tokenUser, false);
}
await next();
return;
}
- recordAbuseSignal(resolvedClientIp, 'auth_failure:bearer', {tokenHash});
+ recordAuthFailure(resolvedClientIp, tokenHash);
await next();
return;
}
@@ -145,7 +150,7 @@ export const UserMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
setUserInContext(ctx, botUser, false);
}
} else {
- recordAbuseSignal(resolvedClientIp, 'auth_failure:bot', {tokenHash});
+ recordAuthFailure(resolvedClientIp, tokenHash);
}
await next();
return;
@@ -167,7 +172,7 @@ export const UserMiddleware = createMiddleware<HonoEnv>(async (ctx, next) => {
setUserInContext(ctx, user, false);
}
} else {
- recordAbuseSignal(resolvedClientIp, 'auth_failure:admin_api_key', {tokenHash});
+ recordAuthFailure(resolvedClientIp, tokenHash);
}
await next();
return;
diff --git a/fluxer_api/src/api/middleware/tests/AbusiveIpAutoBanner.test.ts b/fluxer_api/src/api/middleware/tests/AbusiveIpAutoBanner.test.ts
deleted file mode 100644
index eabe7d4cb..000000000
--- a/fluxer_api/src/api/middleware/tests/AbusiveIpAutoBanner.test.ts
+++ /dev/null
@@ -1,307 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {AdminRepository} from '@app/api/admin/AdminRepository';
-import {
- drainAbuseAutoBanTasksForTests,
- drainAbuseIpClassLookupsForTests,
- hashAuthToken,
- recordAbuseSignal,
- resetAbuseTrackingForTests,
- setAbuseIpClassTtlsForTests,
- startAbuseReplicationSubscriber,
- stopAbuseReplicationSubscriber,
-} from '@app/api/middleware/AbusiveIpAutoBanner';
-import {ipBanCache} from '@app/api/middleware/IpBanMiddleware';
-import {setInjectedIpInfoService} from '@app/api/middleware/ServiceMiddleware';
-import {resetAutoBanAsnExemptionsForTesting, setInjectedAutoBanAsnLookup} from '@app/api/risk/AutoBanAsnExemptions';
-import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
-import {createApiTestHarness} from '@app/api/test/ApiTestHarness';
-import type {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
-import {getSameIpDecisionKey} from '@fluxer/ip_utils/src/IpAddress';
-import type {GeoipAsnResult} from '@pkgs/geoip/src/GeoipLookup';
-import type {IpInfoLookupResult} from '@pkgs/geoip/src/IpInfoService';
-import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
-
-function asnResult(asn: number | null): GeoipAsnResult {
- return {normalizedIp: null, asn, asnOrg: null, available: asn !== null};
-}
-
-function ipInfoResult(ip: string, overrides: Partial<IpInfoLookupResult> = {}): IpInfoLookupResult {
- return {
- ip,
- available: true,
- riskNote: 'test',
- geo: {
- countryCode: 'US',
- countryName: 'United States',
- continent: 'North America',
- continentCode: 'NA',
- region: null,
- regionCode: null,
- city: null,
- postalCode: null,
- timezone: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- },
- asn: {
- asn: 'AS64500',
- number: 64500,
- name: 'Test ISP',
- domain: null,
- type: null,
- },
- mobile: {
- name: null,
- mcc: null,
- mnc: null,
- },
- anonymous: {
- isAnonymous: false,
- providerName: null,
- isVpn: false,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- percentDaysSeen: null,
- },
- flags: {
- isAnycast: false,
- isHosting: false,
- isMobile: false,
- isSatellite: false,
- },
- ...overrides,
- };
-}
-
-function claimCallCount(harness: ApiTestHarness, banKey: string): number {
- const kvProvider = harness.kvProvider as MockKVProvider;
- return kvProvider.setnxSpy.mock.calls.filter(([key]) => key === `abuse:ipclass:claim:${banKey}`).length;
-}
-
-async function waitForAssertion(assertion: () => void): Promise<void> {
- const deadline = Date.now() + 1000;
- let lastError: unknown;
- while (Date.now() < deadline) {
- try {
- assertion();
- return;
- } catch (err) {
- lastError = err;
- await new Promise((resolve) => setTimeout(resolve, 10));
- }
- }
- if (lastError) throw lastError;
- assertion();
-}
-
-describe('AbusiveIpAutoBanner', () => {
- let harness: ApiTestHarness;
- let adminRepository: AdminRepository;
- let lookupCount = 0;
- let asnLookupCount = 0;
- beforeAll(async () => {
- harness = await createApiTestHarness();
- adminRepository = new AdminRepository();
- });
- beforeEach(async () => {
- await harness.reset();
- resetAbuseTrackingForTests();
- ipBanCache.resetCaches();
- delete process.env.FLUXER_ABUSE_EXEMPT_ASNS;
- resetAutoBanAsnExemptionsForTesting();
- asnLookupCount = 0;
- lookupCount = 0;
- setInjectedIpInfoService({
- async lookup(ip: string) {
- lookupCount += 1;
- return ipInfoResult(ip);
- },
- });
- await stopAbuseReplicationSubscriber();
- await startAbuseReplicationSubscriber(harness.kvProvider);
- });
- afterAll(async () => {
- await stopAbuseReplicationSubscriber();
- setInjectedIpInfoService(undefined);
- delete process.env.FLUXER_ABUSE_EXEMPT_ASNS;
- resetAutoBanAsnExemptionsForTesting();
- await harness.shutdown();
- });
- it('temporarily bans an IP that tries many distinct invalid tokens', async () => {
- const ip = '8.8.8.8';
- for (let i = 0; i < 10; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`invalid-${i}`)});
- }
- await waitForAssertion(() => {
- expect(ipBanCache.isBanned(ip)).toBe(true);
- });
- await drainAbuseAutoBanTasksForTests();
- expect(ipBanCache.getMatch(ip)?.kind).toBe('temporary_24h');
- await expect(adminRepository.isIpBanned(ip)).resolves.toBe(true);
- });
- it('does not auto-ban after a single score-only spike', async () => {
- const ip = '8.8.4.4';
- recordAbuseSignal(ip, 'http_429', {weight: 150});
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(ipBanCache.isBanned(ip)).toBe(false);
- await expect(adminRepository.isIpBanned(ip)).resolves.toBe(false);
- });
- it('raises token-diversity tolerance for mobile carrier IPs', async () => {
- const ip = '1.1.1.1';
- setInjectedIpInfoService({
- async lookup(candidateIp: string) {
- return ipInfoResult(candidateIp, {
- mobile: {name: 'Test Mobile', mcc: '001', mnc: '01'},
- flags: {isAnycast: false, isHosting: false, isMobile: true, isSatellite: false},
- });
- },
- });
- for (let i = 0; i < 10; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`mobile-invalid-${i}`)});
- }
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(ipBanCache.isBanned(ip)).toBe(false);
- await expect(adminRepository.isIpBanned(ip)).resolves.toBe(false);
- });
- it('does not auto-ban mobile carrier IPs even at mobile token-diversity threshold', async () => {
- const ip = '1.0.0.1';
- setInjectedIpInfoService({
- async lookup(candidateIp: string) {
- return ipInfoResult(candidateIp, {
- mobile: {name: 'Test Mobile', mcc: '001', mnc: '01'},
- flags: {isAnycast: false, isHosting: false, isMobile: true, isSatellite: false},
- });
- },
- });
- for (let i = 0; i < 100; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`mobile-threshold-${i}`)});
- }
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(ipBanCache.isBanned(ip)).toBe(false);
- await expect(adminRepository.isIpBanned(ip)).resolves.toBe(false);
- });
- it('does not auto-ban an IP whose ASN is exempt', async () => {
- const ip = '9.9.9.9';
- process.env.FLUXER_ABUSE_EXEMPT_ASNS = '64501, not-an-asn, 64502';
- resetAutoBanAsnExemptionsForTesting();
- setInjectedAutoBanAsnLookup(async () => asnResult(64502));
- for (let i = 0; i < 100; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`exempt-${i}`)});
- }
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(ipBanCache.isBanned(ip)).toBe(false);
- await expect(adminRepository.isIpBanned(ip)).resolves.toBe(false);
- expect(lookupCount).toBe(0);
- });
- it('still auto-bans an IP whose ASN is not on the exempt list', async () => {
- const ip = '9.9.9.10';
- process.env.FLUXER_ABUSE_EXEMPT_ASNS = '64501';
- resetAutoBanAsnExemptionsForTesting();
- setInjectedAutoBanAsnLookup(async () => asnResult(64502));
- for (let i = 0; i < 10; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`not-exempt-${i}`)});
- }
- await waitForAssertion(() => {
- expect(ipBanCache.isBanned(ip)).toBe(true);
- });
- await drainAbuseAutoBanTasksForTests();
- await expect(adminRepository.isIpBanned(ip)).resolves.toBe(true);
- });
- it('does not resolve an ASN when no exemptions are configured', async () => {
- const ip = '9.9.9.11';
- setInjectedAutoBanAsnLookup(async () => {
- asnLookupCount += 1;
- return asnResult(64502);
- });
- for (let i = 0; i < 10; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`no-exempt-list-${i}`)});
- }
- await waitForAssertion(() => {
- expect(ipBanCache.isBanned(ip)).toBe(true);
- });
- await drainAbuseAutoBanTasksForTests();
- expect(asnLookupCount).toBe(0);
- });
- it('does not auto-ban loopback or private IP addresses', async () => {
- for (const ip of ['127.0.0.1', '10.0.0.10', '::ffff:127.0.0.1']) {
- for (let i = 0; i < 20; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`${ip}-invalid-${i}`)});
- }
- await drainAbuseAutoBanTasksForTests();
- expect(ipBanCache.isBanned(ip)).toBe(false);
- await expect(adminRepository.isIpBanned(ip)).resolves.toBe(false);
- }
- });
- it('claims the class lookup exactly once for a burst on the same IP', async () => {
- const ip = '8.8.8.8';
- for (let i = 0; i < 10; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`claim-${i}`)});
- }
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(claimCallCount(harness, ip)).toBe(1);
- expect(lookupCount).toBe(1);
- });
- it('does not pay for a lookup or ban when another pod owns the class claim', async () => {
- const ip = '8.8.8.8';
- await harness.kvProvider.setnx(`abuse:ipclass:claim:${ip}`, 'other-pod', 60);
- for (let i = 0; i < 10; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`claim-loser-${i}`)});
- }
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(lookupCount).toBe(0);
- expect(ipBanCache.isBanned(ip)).toBe(false);
- });
- it('does not classify an IPv4 address that is already banned', async () => {
- const ip = '8.8.8.8';
- ipBanCache.banTemp(ip, 3600);
- for (let i = 0; i < 20; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`already-banned-${i}`)});
- }
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(lookupCount).toBe(0);
- expect(claimCallCount(harness, ip)).toBe(0);
- });
- it('does not classify an IPv6 address inside an already banned /64', async () => {
- const ip = '2606:4700:4700::1111';
- const banKey = getSameIpDecisionKey(ip) ?? ip;
- ipBanCache.banTemp(banKey, 3600);
- for (let i = 0; i < 20; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`already-banned-v6-${i}`)});
- }
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(lookupCount).toBe(0);
- expect(claimCallCount(harness, banKey)).toBe(0);
- });
- it('retries a failed classification once the negative TTL elapses', async () => {
- const ip = '9.9.9.9';
- setAbuseIpClassTtlsForTests({negativeMs: 50});
- setInjectedIpInfoService({
- async lookup(candidateIp: string) {
- lookupCount += 1;
- return ipInfoResult(candidateIp, {available: false});
- },
- });
- recordAbuseSignal(ip, 'http_429', {weight: 25});
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(lookupCount).toBe(1);
- await new Promise((resolve) => setTimeout(resolve, 60));
- await harness.kvProvider.del(`abuse:ipclass:claim:${ip}`);
- recordAbuseSignal(ip, 'http_429', {weight: 25});
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
- expect(lookupCount).toBe(2);
- });
-});
diff --git a/fluxer_api/src/api/middleware/tests/AbusiveIpClassReplication.test.ts b/fluxer_api/src/api/middleware/tests/AbusiveIpClassReplication.test.ts
deleted file mode 100644
index 2a7ed433f..000000000
--- a/fluxer_api/src/api/middleware/tests/AbusiveIpClassReplication.test.ts
+++ /dev/null
@@ -1,203 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- drainAbuseAutoBanTasksForTests,
- drainAbuseIpClassLookupsForTests,
- hashAuthToken,
- recordAbuseSignal,
- resetAbuseTrackingForTests,
- setAbuseIpClassTtlsForTests,
- startAbuseReplicationSubscriber,
- stopAbuseReplicationSubscriber,
-} from '@app/api/middleware/AbusiveIpAutoBanner';
-import {ipBanCache} from '@app/api/middleware/IpBanMiddleware';
-import {setInjectedIpInfoService} from '@app/api/middleware/ServiceMiddleware';
-import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
-import {createApiTestHarness} from '@app/api/test/ApiTestHarness';
-import type {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
-import type {IpInfoLookupResult} from '@pkgs/geoip/src/IpInfoService';
-import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
-
-function ipInfoResult(ip: string, overrides: Partial<IpInfoLookupResult> = {}): IpInfoLookupResult {
- return {
- ip,
- available: true,
- riskNote: 'test',
- geo: {
- countryCode: 'US',
- countryName: 'United States',
- continent: 'North America',
- continentCode: 'NA',
- region: null,
- regionCode: null,
- city: null,
- postalCode: null,
- timezone: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- },
- asn: {
- asn: 'AS64500',
- number: 64500,
- name: 'Test ISP',
- domain: null,
- type: null,
- },
- mobile: {
- name: null,
- mcc: null,
- mnc: null,
- },
- anonymous: {
- isAnonymous: false,
- providerName: null,
- isVpn: false,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- percentDaysSeen: null,
- },
- flags: {
- isAnycast: false,
- isHosting: false,
- isMobile: false,
- isSatellite: false,
- },
- ...overrides,
- };
-}
-
-function publishPeerIpClasses(harness: ApiTestHarness, entries: Array<[string, string, unknown]>): void {
- const kvProvider = harness.kvProvider as MockKVProvider;
- kvProvider
- .getSubscription()
- .simulateMessage('abuse_tracker:ipclass', JSON.stringify({sender: 'other-pod', entries, ts: Date.now()}));
-}
-
-function claimCallCount(harness: ApiTestHarness, banKey: string): number {
- const kvProvider = harness.kvProvider as MockKVProvider;
- return kvProvider.setnxSpy.mock.calls.filter(([key]) => key === `abuse:ipclass:claim:${banKey}`).length;
-}
-
-function recordTokenSignals(ip: string, prefix: string, from: number, to: number): void {
- for (let i = from; i < to; i += 1) {
- recordAbuseSignal(ip, 'auth_failure:session', {tokenHash: hashAuthToken(`${prefix}-${i}`)});
- }
-}
-
-async function drainAbuseWork(): Promise<void> {
- await drainAbuseIpClassLookupsForTests();
- await drainAbuseAutoBanTasksForTests();
-}
-
-describe('AbusiveIpAutoBanner IP class replication', () => {
- let harness: ApiTestHarness;
- let lookupCount = 0;
- beforeAll(async () => {
- harness = await createApiTestHarness();
- });
- beforeEach(async () => {
- await harness.reset();
- resetAbuseTrackingForTests();
- ipBanCache.resetCaches();
- lookupCount = 0;
- setInjectedIpInfoService({
- async lookup(ip: string) {
- lookupCount += 1;
- return ipInfoResult(ip);
- },
- });
- await stopAbuseReplicationSubscriber();
- await startAbuseReplicationSubscriber(harness.kvProvider);
- });
- afterAll(async () => {
- await stopAbuseReplicationSubscriber();
- setInjectedIpInfoService(undefined);
- await harness.shutdown();
- });
- it('adopts a datacenter class from a peer without paying for its own lookup', async () => {
- const ip = '8.8.8.8';
- recordTokenSignals(ip, 'peer-datacenter', 0, 3);
- publishPeerIpClasses(harness, [[ip, ip, 'datacenter']]);
- recordTokenSignals(ip, 'peer-datacenter', 3, 10);
- await drainAbuseWork();
- expect(lookupCount).toBe(0);
- expect(claimCallCount(harness, ip)).toBe(0);
- expect(ipBanCache.isBanned(ip)).toBe(true);
- });
- it('never adopts a mobile class from a peer and leaves the IP bannable', async () => {
- const ip = '8.8.4.4';
- recordTokenSignals(ip, 'peer-mobile', 0, 3);
- publishPeerIpClasses(harness, [[ip, ip, 'mobile']]);
- recordTokenSignals(ip, 'peer-mobile', 3, 10);
- await drainAbuseWork();
- expect(lookupCount).toBe(0);
- expect(ipBanCache.isBanned(ip)).toBe(false);
- publishPeerIpClasses(harness, [[ip, ip, 'datacenter']]);
- await drainAbuseWork();
- expect(ipBanCache.isBanned(ip)).toBe(true);
- });
- it('ignores an unrecognised class from a peer and classifies the IP itself', async () => {
- const ip = '4.4.4.4';
- recordTokenSignals(ip, 'peer-invalid', 0, 3);
- publishPeerIpClasses(harness, [
- [ip, ip, 'datacentre'],
- [ip, ip, 42],
- ]);
- recordTokenSignals(ip, 'peer-invalid', 3, 10);
- await drainAbuseWork();
- expect(lookupCount).toBe(1);
- expect(ipBanCache.isBanned(ip)).toBe(true);
- });
- it('ignores an unknown class from a peer and classifies the IP itself', async () => {
- const ip = '9.9.9.9';
- recordTokenSignals(ip, 'peer-unknown', 0, 3);
- publishPeerIpClasses(harness, [[ip, ip, 'unknown']]);
- recordTokenSignals(ip, 'peer-unknown', 3, 10);
- await drainAbuseWork();
- expect(lookupCount).toBe(1);
- expect(ipBanCache.isBanned(ip)).toBe(true);
- });
- it('ignores a peer class for an IP it is not tracking', async () => {
- const ip = '208.67.222.222';
- publishPeerIpClasses(harness, [[ip, ip, 'datacenter']]);
- recordTokenSignals(ip, 'peer-untracked', 0, 10);
- await drainAbuseWork();
- expect(lookupCount).toBe(1);
- expect(claimCallCount(harness, ip)).toBe(1);
- });
- it('accepts a peer mobile class after its own lookup failed and keeps the IP unbanned', async () => {
- const ip = '199.85.126.10';
- setInjectedIpInfoService({
- async lookup(lookupIp: string) {
- lookupCount += 1;
- return ipInfoResult(lookupIp, {available: false});
- },
- });
- recordAbuseSignal(ip, 'http_429', {weight: 25});
- await drainAbuseWork();
- expect(lookupCount).toBe(1);
- publishPeerIpClasses(harness, [[ip, ip, 'mobile']]);
- recordTokenSignals(ip, 'negative-then-mobile', 0, 10);
- await drainAbuseWork();
- expect(lookupCount).toBe(1);
- expect(ipBanCache.isBanned(ip)).toBe(false);
- });
- it('resumes classifying once a peer class hint expires', async () => {
- const ip = '77.88.8.8';
- setAbuseIpClassTtlsForTests({hintMs: 50});
- recordAbuseSignal(ip, 'http_429', {weight: 3});
- publishPeerIpClasses(harness, [[ip, ip, 'datacenter']]);
- recordAbuseSignal(ip, 'http_429', {weight: 25});
- await drainAbuseWork();
- expect(lookupCount).toBe(0);
- await new Promise((resolve) => setTimeout(resolve, 80));
- recordAbuseSignal(ip, 'http_429', {weight: 25});
- await drainAbuseWork();
- expect(lookupCount).toBe(1);
- expect(claimCallCount(harness, ip)).toBe(1);
- expect(ipBanCache.isBanned(ip)).toBe(false);
- });
-});
diff --git a/fluxer_api/src/api/middleware/tests/ClientIpResolution.test.ts b/fluxer_api/src/api/middleware/tests/ClientIpResolution.test.ts
index 0ac7b2ef7..cc985dca2 100644
--- a/fluxer_api/src/api/middleware/tests/ClientIpResolution.test.ts
+++ b/fluxer_api/src/api/middleware/tests/ClientIpResolution.test.ts
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {ActivityContextMiddleware} from '@app/api/infrastructure/activity/ActivityMeta';
+import {applySharedListUpdate, resetSharedListsForTests} from '@app/api/infrastructure/activity/SharedLists';
import {IpBanMiddleware, ipBanCache} from '@app/api/middleware/IpBanMiddleware';
-import {torExitListCache} from '@app/api/middleware/TorExitListCache';
-import {TorExitMiddleware} from '@app/api/middleware/TorExitMiddleware';
import {TrustedClientIpHeaderMiddleware} from '@app/api/middleware/TrustedClientIpHeaderMiddleware';
import {NoopLogger} from '@app/api/test/mocks/NoopLogger';
import type {HonoEnv} from '@app/api/types/HonoEnv';
@@ -35,7 +35,7 @@ function createPipeline(clientIpHeaderName = 'x-forwarded-for'): Pipeline {
clientIpHeaderName,
}),
);
- app.use(TorExitMiddleware);
+ app.use(ActivityContextMiddleware);
app.get('/v1/messages', (ctx) => {
resolutions.push(ctx.get('clientIpResolution'));
return ctx.text('ok');
@@ -53,7 +53,7 @@ function createPipeline(clientIpHeaderName = 'x-forwarded-for'): Pipeline {
beforeEach(() => {
ipBanCache.resetCaches();
- torExitListCache.clearForTesting();
+ resetSharedListsForTests();
});
describe('client ip resolution across the request pipeline', () => {
@@ -72,8 +72,8 @@ describe('client ip resolution across the request pipeline', () => {
expect(response.status).toBe(403);
expect(pipeline.errors[0]).toBeInstanceOf(IpBannedError);
});
- it('still blocks a tor exit client ip', async () => {
- torExitListCache.seedForTesting(['203.0.113.30']);
+ it('blocks a client ip on the shared blocked list', async () => {
+ applySharedListUpdate('ip_blocked', '203.0.113.30\n');
const pipeline = createPipeline();
const response = await pipeline.request({'x-forwarded-for': '203.0.113.30'});
expect(response.status).toBe(403);
diff --git a/fluxer_api/src/api/models/User.ts b/fluxer_api/src/api/models/User.ts
index 972214a08..2f131070b 100644
--- a/fluxer_api/src/api/models/User.ts
+++ b/fluxer_api/src/api/models/User.ts
@@ -68,6 +68,8 @@ export class User {
readonly deletionReasonCode: number | null;
readonly deletionPublicReason: string | null;
readonly deletionAuditLogReason: string | null;
+ readonly deletionScheduledBy: UserID | null;
+ readonly deletionScheduledAt: Date | null;
readonly acls: Set<string>;
private readonly _traits: Set<string>;
readonly firstRefundAt: Date | null;
@@ -132,6 +134,8 @@ export class User {
this.deletionReasonCode = row.deletion_reason_code ?? null;
this.deletionPublicReason = row.deletion_public_reason ?? null;
this.deletionAuditLogReason = row.deletion_audit_log_reason ?? null;
+ this.deletionScheduledBy = row.deletion_scheduled_by ?? null;
+ this.deletionScheduledAt = row.deletion_scheduled_at ?? null;
this.acls = row.acls ?? new Set();
this._traits = row.traits ?? new Set();
this.firstRefundAt = row.first_refund_at ?? null;
@@ -223,6 +227,8 @@ export class User {
deletion_reason_code: this.deletionReasonCode,
deletion_public_reason: this.deletionPublicReason,
deletion_audit_log_reason: this.deletionAuditLogReason,
+ deletion_scheduled_by: this.deletionScheduledBy,
+ deletion_scheduled_at: this.deletionScheduledAt,
acls: this.acls.size > 0 ? this.acls : null,
traits: this._traits.size > 0 ? this._traits : null,
first_refund_at: this.firstRefundAt,
diff --git a/fluxer_api/src/api/oauth/BotAuthService.ts b/fluxer_api/src/api/oauth/BotAuthService.ts
index 1706d806d..631c40f7f 100644
--- a/fluxer_api/src/api/oauth/BotAuthService.ts
+++ b/fluxer_api/src/api/oauth/BotAuthService.ts
@@ -3,10 +3,15 @@
import type {ApplicationID, UserID} from '@app/api/BrandedTypes';
import {generateOAuthTokenSecret} from '@app/api/oauth/OAuthTokenSecret';
import type {IApplicationRepository} from '@app/api/oauth/repositories/IApplicationRepository';
+import type {IUserRepository} from '@app/api/user/IUserRepository';
+import {canOwnerRunBots} from '@app/api/user/UserHelpers';
import {hashPassword, verifyPassword} from '@app/api/utils/PasswordUtils';
export class BotAuthService {
- constructor(private readonly applicationRepository: IApplicationRepository) {}
+ constructor(
+ private readonly applicationRepository: IApplicationRepository,
+ private readonly users: Pick<IUserRepository, 'findUnique'>,
+ ) {}
private parseBotToken(token: string): {
applicationId: ApplicationID;
@@ -38,12 +43,12 @@ export class BotAuthService {
if (!application?.hasBotUser() || !application.botTokenHash) {
return null;
}
- try {
- const isValid = await verifyPassword({password: secret, passwordHash: application.botTokenHash});
- return isValid ? application.getBotUserId() : null;
- } catch {
- return null;
- }
+ const [isValid, owner] = await Promise.all([
+ verifyPassword({password: secret, passwordHash: application.botTokenHash}).catch(() => false),
+ this.users.findUnique(application.ownerUserId),
+ ]);
+ if (!isValid || (owner && !canOwnerRunBots(owner))) return null;
+ return application.getBotUserId();
}
async generateBotToken(applicationId: ApplicationID): Promise<{
diff --git a/fluxer_api/src/api/oauth/OAuth2RequestService.ts b/fluxer_api/src/api/oauth/OAuth2RequestService.ts
index e2b4f4c2e..175174f6f 100644
--- a/fluxer_api/src/api/oauth/OAuth2RequestService.ts
+++ b/fluxer_api/src/api/oauth/OAuth2RequestService.ts
@@ -22,6 +22,7 @@ import {ACCESS_TOKEN_TTL_SECONDS, type OAuth2Service} from '@app/api/oauth/OAuth
import type {IApplicationRepository} from '@app/api/oauth/repositories/IApplicationRepository';
import type {IOAuth2TokenRepository} from '@app/api/oauth/repositories/IOAuth2TokenRepository';
import {parseClientCredentials} from '@app/api/oauth/utils/ParseClientCredentials';
+import {isSignInRefused} from '@app/api/user/UserHelpers';
import {mapUserToOAuthResponse, mapUserToPartialResponse} from '@app/api/user/UserMappers';
import {verifyPassword} from '@app/api/utils/PasswordUtils';
import {canAuthorizeBotInvite, normalizeBotInvitePermissions} from '@fluxer/constants/src/BotPermissionUtils';
@@ -277,7 +278,6 @@ export class OAuth2RequestService {
}
}
await this.guildService.members.addUserToGuild({
- skipRiskGate: true,
userId: botUserId,
guildId,
skipGuildLimitCheck: true,
@@ -356,9 +356,12 @@ export class OAuth2RequestService {
scopes,
expires: expiresAt.toISOString(),
};
- if (tokenData.userId && tokenData.scope.has('identify')) {
+ if (tokenData.userId) {
const user = await this.apiContext.services.users.findUnique(tokenData.userId);
- if (user) {
+ if (user && isSignInRefused(user)) {
+ throw new InvalidTokenError();
+ }
+ if (user && tokenData.scope.has('identify')) {
response.user = mapUserToOAuthResponse(user, {includeEmail: tokenData.scope.has('email')});
}
}
diff --git a/fluxer_api/src/api/oauth/OAuth2Service.ts b/fluxer_api/src/api/oauth/OAuth2Service.ts
index 6fb5d31f6..3fc563ee6 100644
--- a/fluxer_api/src/api/oauth/OAuth2Service.ts
+++ b/fluxer_api/src/api/oauth/OAuth2Service.ts
@@ -18,6 +18,7 @@ import {ApplicationRepository} from '@app/api/oauth/repositories/ApplicationRepo
import type {IApplicationRepository} from '@app/api/oauth/repositories/IApplicationRepository';
import type {IOAuth2TokenRepository} from '@app/api/oauth/repositories/IOAuth2TokenRepository';
import {OAuth2TokenRepository} from '@app/api/oauth/repositories/OAuth2TokenRepository';
+import {isSignInRefused} from '@app/api/user/UserHelpers';
import {mapUserToOAuthResponse} from '@app/api/user/UserMappers';
import {verifyPassword} from '@app/api/utils/PasswordUtils';
import {InvalidRequestError} from '@fluxer/errors/src/domains/core/InvalidRequestError';
@@ -50,6 +51,11 @@ export class OAuth2Service {
this.tokens = deps.oauth2TokenRepository ?? new OAuth2TokenRepository();
}
+ private async findActiveUser(userId: UserID) {
+ const user = await this.apiContext.services.users.findUnique(userId);
+ return user && !isSignInRefused(user) ? user : null;
+ }
+
private parseScope(scope: string): Array<string> {
return scope.split(/[\s+]+/).filter(Boolean);
}
@@ -295,6 +301,9 @@ export class OAuth2Service {
throw new InvalidGrantError();
}
}
+ if (authCode.userId && !(await this.findActiveUser(authCode.userId))) {
+ throw new InvalidGrantError();
+ }
await this.tokens.deleteAuthorizationCode(code);
const res = await this.issueTokens({
application,
@@ -316,6 +325,9 @@ export class OAuth2Service {
if (refresh.applicationId !== application.applicationId) {
throw new InvalidGrantError();
}
+ if (!(await this.findActiveUser(refresh.userId))) {
+ throw new InvalidGrantError();
+ }
await this.tokens.deleteRefreshToken(params.refreshToken!, refresh.applicationId, refresh.userId);
const res = await this.issueTokens({
application,
@@ -340,7 +352,7 @@ export class OAuth2Service {
if (!application) {
throw new InvalidTokenError();
}
- const user = await this.apiContext.services.users.findUnique(token.userId);
+ const user = await this.findActiveUser(token.userId);
if (!user) {
throw new InvalidTokenError();
}
@@ -378,6 +390,9 @@ export class OAuth2Service {
}
const accessToken = await this.tokens.getAccessToken(tokenStr);
if (accessToken && accessToken.applicationId === application.applicationId) {
+ if (accessToken.userId && !(await this.findActiveUser(accessToken.userId))) {
+ return {active: false};
+ }
return {
active: true,
client_id: accessToken.applicationId.toString(),
@@ -390,6 +405,9 @@ export class OAuth2Service {
}
const refreshToken = await this.tokens.getRefreshToken(tokenStr);
if (refreshToken && refreshToken.applicationId === application.applicationId) {
+ if (!(await this.findActiveUser(refreshToken.userId))) {
+ return {active: false};
+ }
return {
active: true,
client_id: refreshToken.applicationId.toString(),
diff --git a/fluxer_api/src/api/oauth/repositories/OAuth2TokenRepository.ts b/fluxer_api/src/api/oauth/repositories/OAuth2TokenRepository.ts
index 6143bd466..45829c7d0 100644
--- a/fluxer_api/src/api/oauth/repositories/OAuth2TokenRepository.ts
+++ b/fluxer_api/src/api/oauth/repositories/OAuth2TokenRepository.ts
@@ -30,6 +30,8 @@ function isAuthorizationCodeExpired(createdAt: Date): boolean {
return Date.now() - createdAt.getTime() > AUTHORIZATION_CODE_TTL_SECONDS * 1000;
}
+const TOKEN_DELETE_BATCH_STATEMENTS = 60;
+
const SELECT_AUTHORIZATION_CODE = OAuth2AuthorizationCodes.selectCql({
where: OAuth2AuthorizationCodes.where.eq('code'),
});
@@ -119,7 +121,7 @@ export class OAuth2TokenRepository implements IOAuth2TokenRepository {
batch.addPrepared(OAuth2AccessTokens.deleteByPk({token_: tokenRow.token_}));
batch.addPrepared(OAuth2AccessTokensByUser.deleteByPk({user_id: userId, token_: tokenRow.token_}));
}
- await batch.execute();
+ await batch.executeChunked(TOKEN_DELETE_BATCH_STATEMENTS, true);
}
async createRefreshToken(data: OAuth2RefreshTokenRow): Promise<OAuth2RefreshToken> {
@@ -159,7 +161,7 @@ export class OAuth2TokenRepository implements IOAuth2TokenRepository {
batch.addPrepared(OAuth2RefreshTokens.deleteByPk({token_: tokenRow.token_}));
batch.addPrepared(OAuth2RefreshTokensByUser.deleteByPk({user_id: userId, token_: tokenRow.token_}));
}
- await batch.execute();
+ await batch.executeChunked(TOKEN_DELETE_BATCH_STATEMENTS, true);
}
async listRefreshTokensForUser(userId: UserID): Promise<Array<OAuth2RefreshToken>> {
diff --git a/fluxer_api/src/api/oauth/tests/OAuth2AccountStanding.test.ts b/fluxer_api/src/api/oauth/tests/OAuth2AccountStanding.test.ts
new file mode 100644
index 000000000..6ced164ea
--- /dev/null
+++ b/fluxer_api/src/api/oauth/tests/OAuth2AccountStanding.test.ts
@@ -0,0 +1,134 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createUserID} from '@app/api/BrandedTypes';
+import {getUserRepository} from '@app/api/middleware/ServiceSingletons';
+import {
+ authorizeOAuth2,
+ createOAuth2TestSetup,
+ exchangeOAuth2AuthorizationCode,
+ introspectOAuth2Token,
+ refreshOAuth2Token,
+} from '@app/api/oauth/tests/OAuthTestUtils';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {HTTP_STATUS} from '@app/api/test/TestConstants';
+import {createBuilder} from '@app/api/test/TestRequestBuilder';
+import {UserFlags} from '@fluxer/constants/src/UserConstants';
+import {afterEach, beforeEach, describe, expect, test} from 'vitest';
+
+const HOUR_MS = 3_600_000;
+
+async function setStanding(userId: string, change: {addFlags?: bigint; tempBannedUntil?: Date | null}): Promise<void> {
+ const users = getUserRepository();
+ const user = (await users.findUnique(createUserID(BigInt(userId))))!;
+ await users.patchUpsert(
+ user.id,
+ {
+ flags: user.flags | (change.addFlags ?? 0n),
+ ...(change.tempBannedUntil !== undefined ? {temp_banned_until: change.tempBannedUntil} : {}),
+ },
+ user.toRow(),
+ );
+}
+
+describe('OAuth2 grants follow the account standing', () => {
+ let harness: ApiTestHarness;
+ beforeEach(async () => {
+ harness = await createApiTestHarness();
+ });
+ afterEach(async () => {
+ await harness?.shutdown();
+ });
+
+ async function grant() {
+ const setup = await createOAuth2TestSetup(harness);
+ const code = await authorizeOAuth2(harness, setup.endUser.token, {
+ client_id: setup.application.id,
+ redirect_uri: setup.redirectURI,
+ scope: 'identify email',
+ });
+ const tokens = await exchangeOAuth2AuthorizationCode(harness, {
+ client_id: setup.application.id,
+ client_secret: setup.application.client_secret,
+ code: code.code,
+ redirect_uri: setup.redirectURI,
+ });
+ return {...setup, tokens};
+ }
+
+ async function refreshStatus(
+ application: {id: string; client_secret: string},
+ refreshToken: string,
+ ): Promise<number> {
+ const response = await harness.app.request('/oauth2/token', {
+ method: 'POST',
+ headers: {
+ 'Content-Type': 'application/x-www-form-urlencoded',
+ Authorization: `Basic ${Buffer.from(`${application.id}:${application.client_secret}`).toString('base64')}`,
+ 'x-forwarded-for': '127.0.0.1',
+ },
+ body: new URLSearchParams({grant_type: 'refresh_token', refresh_token: refreshToken}).toString(),
+ });
+ return response.status;
+ }
+
+ async function bearerStatus(path: string, accessToken: string): Promise<number> {
+ const {response} = await createBuilder(harness, `Bearer ${accessToken}`).get(path).executeRaw();
+ return response.status;
+ }
+
+ test('a closed account gets no refreshed tokens, no userinfo and inactive introspection', async () => {
+ const {endUser, application, tokens} = await grant();
+ expect(await bearerStatus('/oauth2/userinfo', tokens.access_token)).toBe(HTTP_STATUS.OK);
+ await setStanding(endUser.userId, {addFlags: UserFlags.DELETED});
+ expect(await bearerStatus('/oauth2/userinfo', tokens.access_token)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ expect(await bearerStatus('/oauth2/@me', tokens.access_token)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ expect(await refreshStatus(application, tokens.refresh_token)).toBe(HTTP_STATUS.BAD_REQUEST);
+ const introspected = await introspectOAuth2Token(harness, {
+ client_id: application.id,
+ client_secret: application.client_secret,
+ token: tokens.access_token,
+ });
+ expect(introspected.active).toBe(false);
+ const introspectedRefresh = await introspectOAuth2Token(harness, {
+ client_id: application.id,
+ client_secret: application.client_secret,
+ token: tokens.refresh_token,
+ });
+ expect(introspectedRefresh.active).toBe(false);
+ });
+
+ test('an authorization code issued before the account closed cannot be exchanged', async () => {
+ const setup = await createOAuth2TestSetup(harness);
+ const code = await authorizeOAuth2(harness, setup.endUser.token, {
+ client_id: setup.application.id,
+ redirect_uri: setup.redirectURI,
+ scope: 'identify',
+ });
+ await setStanding(setup.endUser.userId, {addFlags: UserFlags.DELETED});
+ await expect(
+ exchangeOAuth2AuthorizationCode(harness, {
+ client_id: setup.application.id,
+ client_secret: setup.application.client_secret,
+ code: code.code,
+ redirect_uri: setup.redirectURI,
+ }),
+ ).rejects.toThrow(/Expected 200, got 400/);
+ });
+
+ test('a temporary ban pauses the grant and the refresh token works again after it ends', async () => {
+ const {endUser, application, tokens} = await grant();
+ await setStanding(endUser.userId, {
+ addFlags: UserFlags.DISABLED,
+ tempBannedUntil: new Date(Date.now() + HOUR_MS),
+ });
+ expect(await bearerStatus('/oauth2/userinfo', tokens.access_token)).toBe(HTTP_STATUS.UNAUTHORIZED);
+ expect(await refreshStatus(application, tokens.refresh_token)).toBe(HTTP_STATUS.BAD_REQUEST);
+ await setStanding(endUser.userId, {tempBannedUntil: new Date(Date.now() - HOUR_MS)});
+ const refreshed = await refreshOAuth2Token(harness, {
+ client_id: application.id,
+ client_secret: application.client_secret,
+ refresh_token: tokens.refresh_token,
+ });
+ expect(await bearerStatus('/oauth2/userinfo', refreshed.access_token)).toBe(HTTP_STATUS.OK);
+ });
+});
diff --git a/fluxer_api/src/api/openapi/openapi.json b/fluxer_api/src/api/openapi/openapi.json
index fc8ea8735..d2453daa7 100644
--- a/fluxer_api/src/api/openapi/openapi.json
+++ b/fluxer_api/src/api/openapi/openapi.json
@@ -18339,7 +18339,7 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "description": "For very-high-risk registrations the platform requires the user to text a one-time code to the platform's number, instead of receiving a code from the platform. This endpoint generates the code and the destination number to display.",
+ "description": "When an account must verify its phone number inbound, the user texts a one-time code to the platform's number instead of receiving one. This endpoint generates the code and the destination number to display.",
"security": [{"sessionToken": []}]
}
},
@@ -19262,7 +19262,7 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "description": "Reports whether this account can set a deferred phone verification requirement aside, and which communities would be left if it did. Returns available false with empty lists for any account outside that state.",
+ "description": "Reports whether this account can set a due phone verification requirement aside. The community lists are always empty.",
"security": [{"sessionToken": []}]
},
"post": {
@@ -19313,7 +19313,7 @@
"content": {"application/json": {"schema": {"$ref": "#/components/schemas/Error"}}}
}
},
- "description": "Leaves the communities that trigger the deferred phone verification check and restores the deferral, so the account works normally again. Communities the user owns are kept, and a run that hits the per-call community limit leaves what it can and can be repeated. Returns the updated private user object.",
+ "description": "Defers a due phone verification requirement again, so the account works normally without leaving any community. Returns the updated private user object.",
"security": [{"sessionToken": []}],
"requestBody": {
"required": false,
@@ -22482,7 +22482,7 @@
"description": "Whether premium perks are temporarily disabled for this account"
},
"force_inbound_phone_verification": {
- "description": "Whether this account is forced through the inbound (expensive-destination) phone verification flow regardless of prefix, for debugging",
+ "description": "Whether this account is forced through the inbound phone verification flow, for debugging",
"type": "boolean"
},
"password_last_changed_at": {
@@ -23001,7 +23001,7 @@
"properties": {
"available": {
"type": "boolean",
- "description": "Whether this account can set the deferred phone verification check aside right now"
+ "description": "Whether this account can set a due phone verification requirement aside right now"
},
"guilds": {
"type": "array",
@@ -23017,7 +23017,7 @@
"required": ["id", "name"],
"additionalProperties": false
},
- "description": "Communities that trigger the phone check and will be left when the escape runs"
+ "description": "Always empty, the escape leaves no community"
},
"owned_guilds": {
"type": "array",
@@ -23033,7 +23033,7 @@
"required": ["id", "name"],
"additionalProperties": false
},
- "description": "Communities that trigger the phone check but are owned by this user, so they are kept"
+ "description": "Always empty, the escape leaves no community"
}
},
"required": ["available", "guilds", "owned_guilds"],
@@ -23298,15 +23298,8 @@
},
"reason": {
"type": "string",
- "enum": [
- "voip",
- "canadian",
- "unknown_line_type",
- "expensive_destination",
- "account_forced",
- "behavioural_risk"
- ],
- "description": "Why inbound verification is required"
+ "enum": ["verification_required"],
+ "description": "Always verification_required"
}
},
"required": ["channel", "challenge_code", "our_number", "expires_at", "reason"],
diff --git a/fluxer_api/src/api/rate_limit_configs/WebhookRateLimitConfig.ts b/fluxer_api/src/api/rate_limit_configs/WebhookRateLimitConfig.ts
index c5842f828..d79c5eae6 100644
--- a/fluxer_api/src/api/rate_limit_configs/WebhookRateLimitConfig.ts
+++ b/fluxer_api/src/api/rate_limit_configs/WebhookRateLimitConfig.ts
@@ -48,6 +48,10 @@ export const WebhookRateLimitConfigs = {
bucket: 'webhook:github::webhook_id',
config: {limit: 200, windowMs: ms('1 minute'), exemptFromGlobal: true},
} as RouteRateLimitConfig,
+ WEBHOOK_TWILIO_SMS: {
+ bucket: 'webhook:twilio_sms',
+ config: {limit: 60, windowMs: ms('1 minute'), exemptFromGlobal: true},
+ } as RouteRateLimitConfig,
WEBHOOK_INSTATUS: {
bucket: 'webhook:instatus::webhook_id',
config: {limit: 200, windowMs: ms('1 minute'), exemptFromGlobal: true},
diff --git a/fluxer_api/src/api/report/ReportService.ts b/fluxer_api/src/api/report/ReportService.ts
index a478b9353..eb28c003c 100644
--- a/fluxer_api/src/api/report/ReportService.ts
+++ b/fluxer_api/src/api/report/ReportService.ts
@@ -25,6 +25,8 @@ import {
import type {MessageAttachment} from '@app/api/database/types/MessageTypes';
import type {DSAReportTicketRow} from '@app/api/database/types/ReportTypes';
import type {IGuildRepositoryAggregate} from '@app/api/guild/repositories/IGuildRepositoryAggregate';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import type {ReportTarget} from '@app/api/infrastructure/activity/Contract.generated';
import type {IEmailDnsValidationService} from '@app/api/infrastructure/IEmailDnsValidationService';
import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
import type {ISnowflakeService} from '@app/api/infrastructure/ISnowflakeService';
@@ -93,6 +95,27 @@ const DSA_CODE_SEGMENT_LENGTH = 4;
const DSA_CODE_SEPARATOR = '-';
const DSA_TICKET_BYTES = 32;
+async function emitReportFiled(row: IARSubmissionRow, target: ReportTarget): Promise<void> {
+ const key = row.reported_user_id ?? row.reporter_id;
+ if (key === null) return;
+ await emitActivity(
+ 'report_filed',
+ key.toString(),
+ {
+ report_id: row.report_id.toString(),
+ reporter_id: (row.reporter_id ?? 0n).toString(),
+ category: row.category,
+ target_type: target,
+ reported_user_id: row.reported_user_id?.toString() ?? null,
+ guild_id: row.reported_guild_id?.toString() ?? null,
+ message_id: row.reported_message_id?.toString() ?? null,
+ channel_id: row.reported_channel_id?.toString() ?? null,
+ },
+ null,
+ row.report_id.toString(),
+ );
+}
+
export class ReportService {
private readonly messageChannelAuthService: MessageChannelAuthService;
@@ -193,6 +216,7 @@ export class ReportService {
try {
await this.consumeMessageReportRateLimits({reporter, channel, message});
const report = await this.reportRepository.createReport(reportData);
+ await emitReportFiled(reportData, 'message');
if (this.reportSearchService && 'indexReport' in this.reportSearchService) {
await this.reportSearchService.indexReport(report).catch((error) => {
Logger.error({error, reportId: report.reportId}, 'Failed to index message report in search');
@@ -262,6 +286,7 @@ export class ReportService {
};
await this.ensureReportRateLimit(this.createReportRateLimitIdentifier(reporterKey), REPORT_RATE_LIMIT_MAX, true);
const report = await this.reportRepository.createReport(reportData);
+ await emitReportFiled(reportData, 'user');
if (this.reportSearchService && 'indexReport' in this.reportSearchService) {
await this.reportSearchService.indexReport(report).catch((error) => {
Logger.error({error, reportId: report.reportId}, 'Failed to index user report in search');
@@ -319,6 +344,7 @@ export class ReportService {
};
await this.ensureReportRateLimit(this.createReportRateLimitIdentifier(reporterKey), REPORT_RATE_LIMIT_MAX, true);
const report = await this.reportRepository.createReport(reportData);
+ await emitReportFiled(reportData, 'guild');
if (this.reportSearchService && 'indexReport' in this.reportSearchService) {
await this.reportSearchService.indexReport(report).catch((error) => {
Logger.error({error, reportId: report.reportId}, 'Failed to index guild report in search');
@@ -397,6 +423,7 @@ export class ReportService {
await this.ensureReportRateLimit(this.createReportRateLimitIdentifier(reporterKey), REPORT_RATE_LIMIT_MAX, true);
await this.reportRepository.deleteDsaTicket(report.ticket);
const createdReport = await this.reportRepository.createReport(reportRow);
+ await emitReportFiled(reportRow, 'dsa');
if (this.reportSearchService && 'indexReport' in this.reportSearchService) {
await this.reportSearchService.indexReport(createdReport).catch((error) => {
Logger.error({error, reportId: createdReport.reportId}, 'Failed to index DSA report in search');
diff --git a/fluxer_api/src/api/risk/AbusePolicy.ts b/fluxer_api/src/api/risk/AbusePolicy.ts
deleted file mode 100644
index 751998ec2..000000000
--- a/fluxer_api/src/api/risk/AbusePolicy.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {Config} from '@app/api/Config';
-import {PHONE_REQUIREMENT_FLAGS, SuspiciousActivityFlags} from '@fluxer/constants/src/UserConstants';
-
-const EMAIL_ONLY_EQUIVALENTS: ReadonlyArray<readonly [number, number]> = [
- [SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL_OR_VERIFIED_PHONE, SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL],
- [SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL_OR_REVERIFIED_PHONE, SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL],
- [
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL_OR_VERIFIED_PHONE,
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL,
- ],
- [
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL_OR_REVERIFIED_PHONE,
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL,
- ],
-];
-
-const PHONE_OFFERING_FLAGS = EMAIL_ONLY_EQUIVALENTS.reduce((mask, [either]) => mask | either, PHONE_REQUIREMENT_FLAGS);
-
-function withoutPhoneOfferingFlags(flagBits: number): number {
- return EMAIL_ONLY_EQUIVALENTS.reduce(
- (next, [either, emailOnly]) => ((flagBits & either) !== 0 ? next | emailOnly : next),
- flagBits & ~PHONE_OFFERING_FLAGS,
- );
-}
-
-function normalizeCountryCode(countryCode: string | null | undefined): string | null {
- const trimmed = countryCode?.trim();
- return trimmed ? trimmed.toUpperCase() : null;
-}
-
-function configuredCountrySet(countryCodes: Array<string>): ReadonlySet<string> {
- return new Set(countryCodes.map(normalizeCountryCode).filter((code): code is string => code !== null));
-}
-
-export function countryRequiresInboundPhoneVerification(countryCode: string | null | undefined): boolean {
- const normalized = normalizeCountryCode(countryCode);
- if (!normalized) return false;
- return configuredCountrySet(Config.abusePolicy.inboundPhoneCountryCodes).has(normalized);
-}
-
-export function phoneFlaggingAllowedForCountry(countryCode: string | null | undefined): boolean {
- const {enabled, exemptCountryCodes} = Config.abusePolicy.phoneFlagging;
- if (!enabled) return false;
- const normalized = normalizeCountryCode(countryCode);
- if (!normalized) return true;
- return !configuredCountrySet(exemptCountryCodes).has(normalized);
-}
-
-export async function stripDisallowedPhoneFlags(
- flagBits: number,
- resolveCountryCode: () => Promise<string | null>,
-): Promise<number> {
- if ((flagBits & PHONE_OFFERING_FLAGS) === 0) return flagBits;
- const {enabled, exemptCountryCodes} = Config.abusePolicy.phoneFlagging;
- if (enabled && exemptCountryCodes.length === 0) return flagBits;
- if (enabled && phoneFlaggingAllowedForCountry(await resolveCountryCode())) return flagBits;
- return withoutPhoneOfferingFlags(flagBits);
-}
-
-export function phoneRequiresInboundVerification(
- phone: string,
- prefixes: ReadonlyArray<string> = Config.abusePolicy.phoneVerification.inboundRequiredPrefixes,
-): boolean {
- return prefixes.some((prefix) => phone.startsWith(prefix));
-}
diff --git a/fluxer_api/src/api/risk/AbuseProneEmailTlds.ts b/fluxer_api/src/api/risk/AbuseProneEmailTlds.ts
deleted file mode 100644
index 770fba6c8..000000000
--- a/fluxer_api/src/api/risk/AbuseProneEmailTlds.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- classifyAccountPolicyEmailTld,
- isAccountPolicyBlockedRegistrationEmailDomain,
- isAccountPolicyLowRiskEmailTld,
-} from '@app/api/risk/AccountPolicyService';
-
-export enum AbuseProneEmailTldRisk {
- High = 'high',
-}
-
-export function classifyAbuseProneEmailTld(tld: string | null | undefined): AbuseProneEmailTldRisk | null {
- return classifyAccountPolicyEmailTld(tld) === 'high' ? AbuseProneEmailTldRisk.High : null;
-}
-
-export function isBlockedRegistrationEmailDomain(domain: string | null | undefined): boolean {
- return isAccountPolicyBlockedRegistrationEmailDomain(domain);
-}
-
-export function isLowRiskEmailTld(tld: string | null | undefined): boolean {
- return isAccountPolicyLowRiskEmailTld(tld);
-}
diff --git a/fluxer_api/src/api/risk/AccountPolicyEvaluator.ts b/fluxer_api/src/api/risk/AccountPolicyEvaluator.ts
deleted file mode 100644
index 51ef6c667..000000000
--- a/fluxer_api/src/api/risk/AccountPolicyEvaluator.ts
+++ /dev/null
@@ -1,1066 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- RecommendedAction,
- type RegistrationEvent,
- type ReverseDnsClassification,
- type RiskAssessment,
- RiskConfidence,
- RiskDecisionMethod,
- RiskLevel,
-} from '@app/api/risk/RiskTypes';
-
-type JsonScalar = string | number | boolean | null;
-type JsonRecord = Record<string, unknown>;
-type PolicyBitfield = number;
-type PolicyBitDefinitions = Readonly<Record<string, PolicyBitfield>>;
-type AccountPolicyAuditLevel = 'debug' | 'info' | 'warn' | 'error';
-type AccountPolicyRiskHistoryOutcome = 'challenged';
-export type AccountPolicyContactCapability =
- | 'captcha_exempt'
- | 'followup_risk_exempt'
- | 'reputation_checks_exempt'
- | 'required_actions_exempt';
-export type AccountPolicyEmailTldRisk = 'high';
-
-const FACT_PATHS = new Set([
- 'contact.value',
- 'contact.domain',
- 'contact.domain_admin_listed',
- 'contact.domain_disposable',
- 'contact.domain_blocked',
- 'contact.domain_step_up_required',
- 'region.code',
- 'region.step_up_required',
- 'assessment.action',
- 'assessment.level',
- 'assessment.score',
- 'decision.flag_bits',
-]);
-const CONTACT_CAPABILITY_FACT_PATHS = new Set([
- 'contact.value',
- 'contact.domain',
- 'contact.domain_admin_listed',
- 'contact.domain_disposable',
- 'contact.domain_blocked',
- 'contact.domain_step_up_required',
-]);
-const CONTACT_CAPABILITIES = new Set<AccountPolicyContactCapability>([
- 'captcha_exempt',
- 'followup_risk_exempt',
- 'reputation_checks_exempt',
- 'required_actions_exempt',
-]);
-const REVERSE_DNS_CLASSIFICATION_ORDER: ReadonlyArray<Exclude<ReverseDnsClassification, 'unknown'>> = [
- 'cellular',
- 'business',
- 'static',
- 'dynamic',
-];
-
-const COMPARISON_KEYS = ['equals', 'not_equals', 'gt', 'gte', 'lt', 'lte', 'in', 'in_set'] as const;
-
-interface AccountPolicyDefaults {
- readonly flagBits: PolicyBitfield;
- readonly inviteAutoJoinEnabled: boolean;
-}
-
-export interface AccountPolicyContactContext {
- readonly value: RegistrationEvent['email'] | null;
- readonly domain: string | null;
- readonly domainAdminListed: boolean;
- readonly domainDisposable: boolean;
- readonly domainBlocked: boolean;
- readonly domainStepUpRequired: boolean;
-}
-
-export interface AccountPolicyRegionContext {
- readonly code: string | null;
- readonly stepUpRequired: boolean;
-}
-
-export interface AccountPolicyContext {
- readonly contact: AccountPolicyContactContext;
- readonly region: AccountPolicyRegionContext;
- readonly assessment: {
- readonly raw: RiskAssessment;
- readonly level: RiskLevel;
- readonly action: RecommendedAction;
- };
-}
-
-interface AccountPolicyAuditEvent {
- readonly event: string;
- readonly level: AccountPolicyAuditLevel;
- readonly ruleId: string;
-}
-
-export interface AccountPolicyDecision {
- readonly flagBits: number;
- readonly inviteAutoJoinEnabled: boolean;
- readonly inviteAutoJoinSkipReason: string | null;
- readonly riskHistoryOutcomeCodes: ReadonlyArray<AccountPolicyRiskHistoryOutcome>;
- readonly auditEvents: ReadonlyArray<AccountPolicyAuditEvent>;
- readonly matchedRuleIds: ReadonlyArray<string>;
-}
-
-export interface IAccountPolicyEvaluator {
- evaluate(context: AccountPolicyContext): AccountPolicyDecision;
- evaluateContact(contact: AccountPolicyContactContext): AccountPolicyContactDecision;
- isLowRiskEmailTld(tld: string | null | undefined): boolean;
- classifyEmailTld(tld: string | null | undefined): AccountPolicyEmailTldRisk | null;
- isBlockedRegistrationEmailDomain(domain: string | null | undefined): boolean;
- isTrustedCommercialPrivacyProvider(providerName: string | null | undefined): boolean;
- isEducationOrganizationName(organizationName: string | null | undefined): boolean;
- classifyReverseDnsHostname(hostname: string | null | undefined): ReverseDnsClassification;
- getMinimumAgeForRegion(countryCode: string | null | undefined, defaultAge: number): number;
-}
-
-interface MutableAccountPolicyDecision {
- flagBits: PolicyBitfield;
- inviteAutoJoinEnabled: boolean;
- inviteAutoJoinSkipReason: string | null;
- riskHistoryOutcomeCodes: Array<AccountPolicyRiskHistoryOutcome>;
- auditEvents: Array<AccountPolicyAuditEvent>;
- matchedRuleIds: Array<string>;
-}
-
-interface FactCondition {
- readonly fact: string;
- readonly equals?: JsonScalar;
- readonly not_equals?: JsonScalar;
- readonly gt?: number;
- readonly gte?: number;
- readonly lt?: number;
- readonly lte?: number;
- readonly in?: ReadonlyArray<JsonScalar>;
- readonly in_set?: string;
-}
-
-type AccountPolicyCondition =
- | FactCondition
- | {
- readonly all: ReadonlyArray<AccountPolicyCondition>;
- }
- | {
- readonly any: ReadonlyArray<AccountPolicyCondition>;
- }
- | {
- readonly not: AccountPolicyCondition;
- };
-
-type AccountPolicyEffect =
- | {
- readonly type: 'or_bits';
- readonly bits: PolicyBitfield;
- }
- | {
- readonly type: 'or_bits_from_map';
- readonly fact: string;
- readonly map: Readonly<Record<string, PolicyBitfield>>;
- }
- | {
- readonly type: 'set_feature';
- readonly feature: 'invite_auto_join';
- readonly enabled: boolean;
- readonly reason?: string;
- }
- | {
- readonly type: 'append_markers';
- readonly markers: ReadonlyArray<AccountPolicyRiskHistoryOutcome>;
- }
- | {
- readonly type: 'emit';
- readonly event: string;
- readonly level: AccountPolicyAuditLevel;
- };
-
-interface AccountPolicyRule {
- readonly id: string;
- readonly when: AccountPolicyCondition | null;
- readonly effects: ReadonlyArray<AccountPolicyEffect>;
-}
-
-interface AccountPolicyContactCapabilityRule {
- readonly id: string;
- readonly when: AccountPolicyCondition | null;
- readonly capabilities: ReadonlyArray<AccountPolicyContactCapability>;
-}
-
-interface AccountPolicyClassifiers {
- readonly emailTlds: {
- readonly lowRisk: ReadonlySet<string>;
- readonly blocked: ReadonlySet<string>;
- };
- readonly network: {
- readonly trustedPrivacyProviderMarkers: ReadonlyArray<ReadonlyArray<string>>;
- readonly educationOrgMarkers: ReadonlyArray<string>;
- readonly reverseDnsMarkers: Readonly<Record<ReverseDnsClassification, ReadonlyArray<RegExp>>>;
- };
- readonly regionalMinimumAge: {
- readonly byCountry: Readonly<Record<string, number>>;
- };
-}
-
-interface AccountPolicyDocument {
- readonly version: 1;
- readonly id: string;
- readonly sets: Readonly<Record<string, ReadonlyArray<JsonScalar>>>;
- readonly defaults: AccountPolicyDefaults;
- readonly rules: ReadonlyArray<AccountPolicyRule>;
- readonly contactCapabilityRules: ReadonlyArray<AccountPolicyContactCapabilityRule>;
- readonly classifiers: AccountPolicyClassifiers;
-}
-
-function isRecord(value: unknown): value is JsonRecord {
- return typeof value === 'object' && value !== null && !Array.isArray(value);
-}
-
-function asRecord(value: unknown, path: string): JsonRecord {
- if (!isRecord(value)) {
- throw new Error(`${path} must be an object`);
- }
- return value;
-}
-
-function asString(value: unknown, path: string): string {
- if (typeof value !== 'string' || value.trim().length === 0) {
- throw new Error(`${path} must be a non-empty string`);
- }
- return value;
-}
-
-function asBoolean(value: unknown, path: string): boolean {
- if (typeof value !== 'boolean') {
- throw new Error(`${path} must be a boolean`);
- }
- return value;
-}
-
-function asNumber(value: unknown, path: string): number {
- if (typeof value !== 'number' || !Number.isFinite(value)) {
- throw new Error(`${path} must be a finite number`);
- }
- return value;
-}
-
-function asBitfield(value: unknown, path: string): PolicyBitfield {
- const bitfield = asNumber(value, path);
- if (!Number.isInteger(bitfield) || bitfield < 0) {
- throw new Error(`${path} must be a non-negative integer bitfield`);
- }
- return bitfield;
-}
-
-function parseBitfieldValue(value: unknown, path: string, bitDefinitions: PolicyBitDefinitions): PolicyBitfield {
- if (typeof value === 'number') {
- return asBitfield(value, path);
- }
- if (typeof value === 'string') {
- const bit = bitDefinitions[value];
- if (bit === undefined) {
- throw new Error(`${path} references unknown bit alias: ${value}`);
- }
- return bit;
- }
- if (Array.isArray(value)) {
- let bitfield = 0;
- value.forEach((item, index) => {
- bitfield |= parseBitfieldValue(item, `${path}[${index}]`, bitDefinitions);
- });
- return bitfield;
- }
- throw new Error(`${path} must be a bitfield number, bit alias, or bit alias array`);
-}
-
-function asJsonScalar(value: unknown, path: string): JsonScalar {
- if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean' || value === null) {
- return value;
- }
- throw new Error(`${path} must be a JSON scalar`);
-}
-
-function asArray(value: unknown, path: string): ReadonlyArray<unknown> {
- if (!Array.isArray(value)) {
- throw new Error(`${path} must be an array`);
- }
- return value;
-}
-
-function asStringArray(value: unknown, path: string): ReadonlyArray<string> {
- return asArray(value, path).map((item, index) => asString(item, `${path}[${index}]`));
-}
-
-function parseRiskHistoryOutcome(value: unknown, path: string): AccountPolicyRiskHistoryOutcome {
- const outcome = asString(value, path);
- if (outcome !== 'challenged') {
- throw new Error(`${path} references unknown marker: ${outcome}`);
- }
- return outcome;
-}
-
-function parseRiskHistoryOutcomes(value: unknown, path: string): ReadonlyArray<AccountPolicyRiskHistoryOutcome> {
- return asArray(value, path).map((item, index) => parseRiskHistoryOutcome(item, `${path}[${index}]`));
-}
-
-function parseAuditLevel(value: unknown, path: string): AccountPolicyAuditLevel {
- const level = asString(value, path);
- if (level !== 'debug' && level !== 'info' && level !== 'warn' && level !== 'error') {
- throw new Error(`${path} references unknown event level: ${level}`);
- }
- return level;
-}
-
-function addUnique<T>(target: Array<T>, values: ReadonlyArray<T>): void {
- for (const value of values) {
- if (!target.includes(value)) {
- target.push(value);
- }
- }
-}
-
-function hasKey(record: JsonRecord, key: string): boolean {
- return Object.hasOwn(record, key);
-}
-
-function normalizePolicyToken(value: string): string {
- return value.trim().toLowerCase();
-}
-
-function normalizePolicyCountryCode(value: string): string {
- return value.trim().toUpperCase();
-}
-
-function normalizePolicyTld(value: string): string | null {
- const normalized = normalizePolicyToken(value);
- if (!normalized) return null;
- return normalized.startsWith('.') ? normalized.slice(1) : normalized;
-}
-
-function extractPolicyTldFromDomain(domain: string | null | undefined): string | null {
- const normalized = normalizePolicyContactDomain(domain);
- if (!normalized) return null;
- const dotIndex = normalized.lastIndexOf('.');
- if (dotIndex < 0 || dotIndex === normalized.length - 1) return null;
- return normalizePolicyTld(normalized.slice(dotIndex + 1));
-}
-
-function normalizeProviderTokens(providerName: string | null | undefined): Array<string> {
- if (!providerName) return [];
- return providerName
- .toLowerCase()
- .replace(/[^a-z0-9]+/g, ' ')
- .trim()
- .split(/\s+/)
- .filter((token) => token.length > 0);
-}
-
-function containsTokenRun(tokens: ReadonlyArray<string>, run: ReadonlyArray<string>): boolean {
- if (run.length === 0 || tokens.length < run.length) return false;
- outer: for (let i = 0; i <= tokens.length - run.length; i++) {
- for (let j = 0; j < run.length; j++) {
- if (tokens[i + j] !== run[j]) continue outer;
- }
- return true;
- }
- return false;
-}
-
-export function normalizePolicyContactDomain(domain: string | null | undefined): string | null {
- const normalized = domain?.trim().toLowerCase();
- return normalized ? normalized : null;
-}
-
-function extractPolicyContactDomain(value: string | null | undefined): string | null {
- const normalized = value?.trim().toLowerCase();
- if (!normalized) return null;
- const atIndex = normalized.lastIndexOf('@');
- if (atIndex <= 0 || atIndex === normalized.length - 1) return null;
- return normalizePolicyContactDomain(normalized.slice(atIndex + 1));
-}
-
-export function createAccountPolicyContactContext(
- value: string | null | undefined,
- overrides: Partial<Omit<AccountPolicyContactContext, 'value'>> = {},
-): AccountPolicyContactContext {
- return {
- value: value ?? null,
- domain: normalizePolicyContactDomain(overrides.domain ?? extractPolicyContactDomain(value)),
- domainAdminListed: overrides.domainAdminListed ?? false,
- domainDisposable: overrides.domainDisposable ?? false,
- domainBlocked: overrides.domainBlocked ?? false,
- domainStepUpRequired: overrides.domainStepUpRequired ?? false,
- };
-}
-
-export function createAccountPolicyContactDomainContext(
- domain: string | null | undefined,
- overrides: Partial<Omit<AccountPolicyContactContext, 'value' | 'domain'>> = {},
-): AccountPolicyContactContext {
- return createAccountPolicyContactContext(null, {
- ...overrides,
- domain,
- });
-}
-
-export class AccountPolicyContactDecision {
- private readonly capabilitySet: ReadonlySet<AccountPolicyContactCapability>;
-
- constructor(capabilities: ReadonlyArray<AccountPolicyContactCapability>) {
- this.capabilitySet = new Set(capabilities);
- }
-
- hasCapability(capability: AccountPolicyContactCapability): boolean {
- return this.capabilitySet.has(capability);
- }
-
- get capabilities(): ReadonlyArray<AccountPolicyContactCapability> {
- return [...this.capabilitySet];
- }
-}
-
-class AccountPolicyDocumentParser {
- parse(rawDocument: unknown): AccountPolicyDocument {
- const document = asRecord(rawDocument, 'policy DSL');
- const version = document['version'];
- if (version !== 1) {
- throw new Error('policy DSL version must be 1');
- }
- const bitDefinitions = this.parseBitDefinitions(document['definitions']);
- const sets = this.parseSets(document['sets']);
- const defaults = this.parseDefaults(document['defaults'], bitDefinitions);
- const seenRuleIds = new Set<string>();
- const rules = asArray(document['rules'], 'rules').map((item, index) => {
- const rule = this.parseRule(item, `rules[${index}]`, sets, bitDefinitions);
- if (seenRuleIds.has(rule.id)) {
- throw new Error(`rules[${index}].id duplicates rule id: ${rule.id}`);
- }
- seenRuleIds.add(rule.id);
- return rule;
- });
- const contactCapabilityRules = this.parseContactCapabilityRules(
- document['contact_capability_rules'],
- sets,
- seenRuleIds,
- );
- const classifiers = this.parseClassifiers(document['classifiers']);
- return {
- version,
- id: typeof document['id'] === 'string' && document['id'].trim() ? document['id'] : 'policy',
- sets,
- defaults,
- rules,
- contactCapabilityRules,
- classifiers,
- };
- }
-
- private parseBitDefinitions(rawDefinitions: unknown): PolicyBitDefinitions {
- const definitions = rawDefinitions === undefined ? {} : asRecord(rawDefinitions, 'definitions');
- const rawBits = definitions['bits'] === undefined ? {} : asRecord(definitions['bits'], 'definitions.bits');
- const bits: Record<string, PolicyBitfield> = {};
- for (const [name, value] of Object.entries(rawBits)) {
- if (!name.trim()) throw new Error('definitions.bits contains an empty bit alias');
- bits[name] = asBitfield(value, `definitions.bits.${name.replace(/[^a-z0-9_]/gi, '_')}`);
- }
- return bits;
- }
-
- private parseSets(rawSets: unknown): Readonly<Record<string, ReadonlyArray<JsonScalar>>> {
- const sets = rawSets === undefined ? {} : asRecord(rawSets, 'sets');
- const parsed: Record<string, ReadonlyArray<JsonScalar>> = {};
- for (const [name, value] of Object.entries(sets)) {
- if (!name.trim()) throw new Error('sets contains an empty set name');
- parsed[name] = asArray(value, `sets.${name}`).map((item, index) => asJsonScalar(item, `sets.${name}[${index}]`));
- }
- return parsed;
- }
-
- private parseDefaults(rawDefaults: unknown, bitDefinitions: PolicyBitDefinitions): AccountPolicyDefaults {
- const defaults = rawDefaults === undefined ? {} : asRecord(rawDefaults, 'defaults');
- const features = defaults['features'] === undefined ? {} : asRecord(defaults['features'], 'defaults.features');
- return {
- flagBits:
- defaults['flag_bits'] === undefined
- ? 0
- : parseBitfieldValue(defaults['flag_bits'], 'defaults.flag_bits', bitDefinitions),
- inviteAutoJoinEnabled:
- features['invite_auto_join'] === undefined
- ? true
- : asBoolean(features['invite_auto_join'], 'defaults.features.invite_auto_join'),
- };
- }
-
- private parseRule(
- rawRule: unknown,
- path: string,
- sets: Readonly<Record<string, ReadonlyArray<JsonScalar>>>,
- bitDefinitions: PolicyBitDefinitions,
- ): AccountPolicyRule {
- const rule = asRecord(rawRule, path);
- const id = asString(rule['id'], `${path}.id`);
- const when =
- rule['when'] === undefined ? null : this.parseCondition(rule['when'], `${path}.when`, sets, FACT_PATHS);
- const effects = asArray(rule['effects'], `${path}.effects`).map((effect, index) =>
- this.parseEffect(effect, `${path}.effects[${index}]`, bitDefinitions),
- );
- if (effects.length === 0) {
- throw new Error(`${path}.effects must not be empty`);
- }
- return {id, when, effects};
- }
-
- private parseContactCapabilityRules(
- rawRules: unknown,
- sets: Readonly<Record<string, ReadonlyArray<JsonScalar>>>,
- seenRuleIds: Set<string>,
- ): ReadonlyArray<AccountPolicyContactCapabilityRule> {
- if (rawRules === undefined) return [];
- return asArray(rawRules, 'contact_capability_rules').map((item, index) => {
- const path = `contact_capability_rules[${index}]`;
- const rule = asRecord(item, path);
- const id = asString(rule['id'], `${path}.id`);
- if (seenRuleIds.has(id)) {
- throw new Error(`${path}.id duplicates rule id: ${id}`);
- }
- seenRuleIds.add(id);
- const when =
- rule['when'] === undefined
- ? null
- : this.parseCondition(rule['when'], `${path}.when`, sets, CONTACT_CAPABILITY_FACT_PATHS);
- const capabilities = asArray(rule['capabilities'], `${path}.capabilities`).map((capability, capabilityIndex) =>
- this.parseContactCapability(capability, `${path}.capabilities[${capabilityIndex}]`),
- );
- if (capabilities.length === 0) {
- throw new Error(`${path}.capabilities must not be empty`);
- }
- return {id, when, capabilities};
- });
- }
-
- private parseCondition(
- rawCondition: unknown,
- path: string,
- sets: Readonly<Record<string, ReadonlyArray<JsonScalar>>>,
- factPaths: ReadonlySet<string>,
- ): AccountPolicyCondition {
- const condition = asRecord(rawCondition, path);
- if (hasKey(condition, 'all')) {
- const children = asArray(condition['all'], `${path}.all`).map((item, index) =>
- this.parseCondition(item, `${path}.all[${index}]`, sets, factPaths),
- );
- if (children.length === 0) throw new Error(`${path}.all must not be empty`);
- return {all: children};
- }
- if (hasKey(condition, 'any')) {
- const children = asArray(condition['any'], `${path}.any`).map((item, index) =>
- this.parseCondition(item, `${path}.any[${index}]`, sets, factPaths),
- );
- if (children.length === 0) throw new Error(`${path}.any must not be empty`);
- return {any: children};
- }
- if (hasKey(condition, 'not')) {
- return {not: this.parseCondition(condition['not'], `${path}.not`, sets, factPaths)};
- }
- const fact = asString(condition['fact'], `${path}.fact`);
- this.assertFactPath(fact, `${path}.fact`, factPaths);
- const comparisonCount = COMPARISON_KEYS.filter((key) => hasKey(condition, key)).length;
- if (comparisonCount !== 1) {
- throw new Error(`${path} must contain exactly one comparison`);
- }
- const parsed: FactCondition = {fact};
- if (hasKey(condition, 'equals')) {
- return {...parsed, equals: asJsonScalar(condition['equals'], `${path}.equals`)};
- }
- if (hasKey(condition, 'not_equals')) {
- return {...parsed, not_equals: asJsonScalar(condition['not_equals'], `${path}.not_equals`)};
- }
- if (hasKey(condition, 'gt')) return {...parsed, gt: asNumber(condition['gt'], `${path}.gt`)};
- if (hasKey(condition, 'gte')) return {...parsed, gte: asNumber(condition['gte'], `${path}.gte`)};
- if (hasKey(condition, 'lt')) return {...parsed, lt: asNumber(condition['lt'], `${path}.lt`)};
- if (hasKey(condition, 'lte')) return {...parsed, lte: asNumber(condition['lte'], `${path}.lte`)};
- if (hasKey(condition, 'in_set')) {
- const setName = asString(condition['in_set'], `${path}.in_set`);
- if (!(setName in sets)) {
- throw new Error(`${path}.in_set references unknown set: ${setName}`);
- }
- return {...parsed, in_set: setName};
- }
- return {
- ...parsed,
- in: asArray(condition['in'], `${path}.in`).map((item, index) => asJsonScalar(item, `${path}.in[${index}]`)),
- };
- }
-
- private parseEffect(rawEffect: unknown, path: string, bitDefinitions: PolicyBitDefinitions): AccountPolicyEffect {
- const effect = asRecord(rawEffect, path);
- const type = asString(effect['type'], `${path}.type`);
- switch (type) {
- case 'or_bits':
- return {
- type,
- bits: parseBitfieldValue(effect['bits'], `${path}.bits`, bitDefinitions),
- };
- case 'or_bits_from_map': {
- const fact = asString(effect['fact'], `${path}.fact`);
- this.assertFactPath(fact, `${path}.fact`, FACT_PATHS);
- return {
- type,
- fact,
- map: this.parseBitfieldMap(effect['map'], `${path}.map`, bitDefinitions),
- };
- }
- case 'set_feature': {
- const feature = asString(effect['feature'], `${path}.feature`);
- if (feature !== 'invite_auto_join') {
- throw new Error(`${path}.feature references unknown feature: ${feature}`);
- }
- return {
- type,
- feature,
- enabled: asBoolean(effect['enabled'], `${path}.enabled`),
- reason: effect['reason'] === undefined ? undefined : asString(effect['reason'], `${path}.reason`),
- };
- }
- case 'append_markers':
- return {
- type,
- markers: parseRiskHistoryOutcomes(effect['markers'], `${path}.markers`),
- };
- case 'emit':
- return {
- type,
- event: asString(effect['event'], `${path}.event`),
- level: parseAuditLevel(effect['level'], `${path}.level`),
- };
- default:
- throw new Error(`${path}.type references unknown effect type: ${type}`);
- }
- }
-
- private parseBitfieldMap(
- rawMap: unknown,
- path: string,
- bitDefinitions: PolicyBitDefinitions,
- ): Readonly<Record<string, PolicyBitfield>> {
- const map = asRecord(rawMap, path);
- const parsed: Record<string, PolicyBitfield> = {};
- for (const [key, value] of Object.entries(map)) {
- if (!key.trim()) throw new Error(`${path} contains an empty map key`);
- parsed[key] = parseBitfieldValue(value, `${path}.${key.replace(/[^a-z0-9_]/gi, '_')}`, bitDefinitions);
- }
- return parsed;
- }
-
- private parseContactCapability(value: unknown, path: string): AccountPolicyContactCapability {
- const capability = asString(value, path);
- if (!CONTACT_CAPABILITIES.has(capability as AccountPolicyContactCapability)) {
- throw new Error(`${path} references unknown contact capability: ${capability}`);
- }
- return capability as AccountPolicyContactCapability;
- }
-
- private parseClassifiers(rawClassifiers: unknown): AccountPolicyClassifiers {
- const classifiers = rawClassifiers === undefined ? {} : asRecord(rawClassifiers, 'classifiers');
- const emailTlds =
- classifiers['email_tlds'] === undefined ? {} : asRecord(classifiers['email_tlds'], 'classifiers.email_tlds');
- const network = classifiers['network'] === undefined ? {} : asRecord(classifiers['network'], 'classifiers.network');
- return {
- emailTlds: {
- lowRisk: this.parseNormalizedSet(emailTlds['low_risk'], 'classifiers.email_tlds.low_risk', normalizePolicyTld),
- blocked: this.parseNormalizedSet(emailTlds['blocked'], 'classifiers.email_tlds.blocked', normalizePolicyTld),
- },
- network: {
- trustedPrivacyProviderMarkers: this.parseTokenRuns(
- network['trusted_privacy_provider_markers'],
- 'classifiers.network.trusted_privacy_provider_markers',
- ),
- educationOrgMarkers: this.parseNormalizedStringList(
- network['education_org_markers'],
- 'classifiers.network.education_org_markers',
- ),
- reverseDnsMarkers: this.parseReverseDnsMarkers(
- network['reverse_dns_markers'],
- 'classifiers.network.reverse_dns_markers',
- ),
- },
- regionalMinimumAge: {
- byCountry: this.parseRegionalMinimumAge(
- classifiers['regional_minimum_age'],
- 'classifiers.regional_minimum_age',
- ),
- },
- };
- }
-
- private parseNormalizedSet(
- rawValues: unknown,
- path: string,
- normalize: (value: string) => string | null,
- ): ReadonlySet<string> {
- if (rawValues === undefined) return new Set();
- const values = asStringArray(rawValues, path);
- const parsed = new Set<string>();
- values.forEach((value, index) => {
- const normalized = normalize(value);
- if (!normalized) {
- throw new Error(`${path}[${index}] must not be empty`);
- }
- parsed.add(normalized);
- });
- return parsed;
- }
-
- private parseNormalizedStringList(rawValues: unknown, path: string): ReadonlyArray<string> {
- if (rawValues === undefined) return [];
- return asStringArray(rawValues, path).map((value, index) => {
- const normalized = normalizePolicyToken(value);
- if (!normalized) {
- throw new Error(`${path}[${index}] must not be empty`);
- }
- return normalized;
- });
- }
-
- private parseTokenRuns(rawValues: unknown, path: string): ReadonlyArray<ReadonlyArray<string>> {
- return this.parseNormalizedStringList(rawValues, path).map((value, index) => {
- const tokens = normalizeProviderTokens(value);
- if (tokens.length === 0) {
- throw new Error(`${path}[${index}] must contain at least one token`);
- }
- return tokens;
- });
- }
-
- private parseReverseDnsMarkers(
- rawMarkers: unknown,
- path: string,
- ): Readonly<Record<ReverseDnsClassification, ReadonlyArray<RegExp>>> {
- const markers = rawMarkers === undefined ? {} : asRecord(rawMarkers, path);
- return {
- unknown: [],
- cellular: this.parseRegexList(markers['cellular'], `${path}.cellular`),
- business: this.parseRegexList(markers['business'], `${path}.business`),
- static: this.parseRegexList(markers['static'], `${path}.static`),
- dynamic: this.parseRegexList(markers['dynamic'], `${path}.dynamic`),
- };
- }
-
- private parseRegexList(rawPatterns: unknown, path: string): ReadonlyArray<RegExp> {
- if (rawPatterns === undefined) return [];
- return asStringArray(rawPatterns, path).map((pattern, index) => {
- try {
- return new RegExp(pattern);
- } catch (error) {
- throw new Error(
- `${path}[${index}] must be a valid regular expression: ${
- error instanceof Error ? error.message : String(error)
- }`,
- );
- }
- });
- }
-
- private parseRegionalMinimumAge(rawMinimumAge: unknown, path: string): Readonly<Record<string, number>> {
- if (rawMinimumAge === undefined) return {};
- const minimumAge = asRecord(rawMinimumAge, path);
- const byCountry =
- minimumAge['by_country'] === undefined ? {} : asRecord(minimumAge['by_country'], `${path}.by_country`);
- const parsed: Record<string, number> = {};
- for (const [countryCode, rawAge] of Object.entries(byCountry)) {
- const normalized = normalizePolicyCountryCode(countryCode);
- if (!/^[A-Z]{2}$/.test(normalized)) {
- throw new Error(`${path}.by_country contains invalid country code: ${countryCode}`);
- }
- const age = asNumber(rawAge, `${path}.by_country.${normalized}`);
- if (!Number.isInteger(age) || age < 0) {
- throw new Error(`${path}.by_country.${normalized} must be a non-negative integer`);
- }
- parsed[normalized] = age;
- }
- return parsed;
- }
-
- private assertFactPath(fact: string, path: string, factPaths: ReadonlySet<string>): void {
- if (!factPaths.has(fact)) {
- throw new Error(`${path} references unknown fact path: ${fact}`);
- }
- }
-}
-
-class AccountPolicyFactReader {
- read(path: string, context: AccountPolicyContext, decision: MutableAccountPolicyDecision): JsonScalar {
- switch (path) {
- case 'contact.value':
- return context.contact.value;
- case 'contact.domain':
- return context.contact.domain;
- case 'contact.domain_admin_listed':
- return context.contact.domainAdminListed;
- case 'contact.domain_disposable':
- return context.contact.domainDisposable;
- case 'contact.domain_blocked':
- return context.contact.domainBlocked;
- case 'contact.domain_step_up_required':
- return context.contact.domainStepUpRequired;
- case 'region.code':
- return context.region.code;
- case 'region.step_up_required':
- return context.region.stepUpRequired;
- case 'assessment.action':
- return context.assessment.action;
- case 'assessment.level':
- return context.assessment.level;
- case 'assessment.score':
- return context.assessment.raw.riskScore;
- case 'decision.flag_bits':
- return decision.flagBits;
- default:
- throw new Error(`unknown policy fact path: ${path}`);
- }
- }
-}
-
-class AccountPolicyConditionEvaluator {
- constructor(
- private readonly sets: Readonly<Record<string, ReadonlyArray<JsonScalar>>>,
- private readonly facts = new AccountPolicyFactReader(),
- ) {}
-
- matches(
- condition: AccountPolicyCondition | null,
- context: AccountPolicyContext,
- decision: MutableAccountPolicyDecision,
- ): boolean {
- if (condition === null) return true;
- if ('all' in condition) return condition.all.every((child) => this.matches(child, context, decision));
- if ('any' in condition) return condition.any.some((child) => this.matches(child, context, decision));
- if ('not' in condition) return !this.matches(condition.not, context, decision);
- const actual = this.facts.read(condition.fact, context, decision);
- return this.compare(actual, condition);
- }
-
- private compare(actual: JsonScalar, condition: FactCondition): boolean {
- if (condition.equals !== undefined) return actual === condition.equals;
- if (condition.not_equals !== undefined) return actual !== condition.not_equals;
- if (condition.in !== undefined) return condition.in.includes(actual);
- if (condition.in_set !== undefined) return (this.sets[condition.in_set] ?? []).includes(actual);
- if (typeof actual !== 'number') return false;
- if (condition.gt !== undefined) return actual > condition.gt;
- if (condition.gte !== undefined) return actual >= condition.gte;
- if (condition.lt !== undefined) return actual < condition.lt;
- if (condition.lte !== undefined) return actual <= condition.lte;
- return false;
- }
-}
-
-class AccountPolicyRuleEvaluator {
- constructor(
- private readonly facts: AccountPolicyFactReader,
- private readonly conditionEvaluator: AccountPolicyConditionEvaluator,
- ) {}
-
- apply(rule: AccountPolicyRule, context: AccountPolicyContext, decision: MutableAccountPolicyDecision): void {
- if (!this.conditionEvaluator.matches(rule.when, context, decision)) return;
- decision.matchedRuleIds.push(rule.id);
- for (const effect of rule.effects) {
- this.applyEffect(rule.id, effect, context, decision);
- }
- }
-
- private applyEffect(
- ruleId: string,
- effect: AccountPolicyEffect,
- context: AccountPolicyContext,
- decision: MutableAccountPolicyDecision,
- ): void {
- switch (effect.type) {
- case 'or_bits':
- decision.flagBits |= effect.bits;
- return;
- case 'or_bits_from_map': {
- const value = this.facts.read(effect.fact, context, decision);
- if (typeof value !== 'string') return;
- decision.flagBits |= effect.map[value] ?? 0;
- return;
- }
- case 'set_feature':
- decision.inviteAutoJoinEnabled = effect.enabled;
- decision.inviteAutoJoinSkipReason = effect.enabled ? null : (effect.reason ?? ruleId);
- return;
- case 'append_markers':
- addUnique(decision.riskHistoryOutcomeCodes, effect.markers);
- return;
- case 'emit':
- decision.auditEvents.push({event: effect.event, level: effect.level, ruleId});
- return;
- }
- }
-}
-
-class AccountPolicyContactCapabilityEvaluator {
- constructor(private readonly conditionEvaluator: AccountPolicyConditionEvaluator) {}
-
- evaluate(
- rules: ReadonlyArray<AccountPolicyContactCapabilityRule>,
- contact: AccountPolicyContactContext,
- ): AccountPolicyContactDecision {
- const context: AccountPolicyContext = {
- contact,
- region: {code: null, stepUpRequired: false},
- assessment: {
- raw: {
- suspicious: false,
- level: RiskLevel.Low,
- confidence: RiskConfidence.Low,
- riskScore: 0,
- reasoning: 'contact policy capability evaluation',
- recommendedAction: RecommendedAction.Allow,
- method: RiskDecisionMethod.Noop,
- modelUsed: 'account-policy',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- },
- level: RiskLevel.Low,
- action: RecommendedAction.Allow,
- },
- };
- const decision: MutableAccountPolicyDecision = {
- flagBits: 0,
- inviteAutoJoinEnabled: true,
- inviteAutoJoinSkipReason: null,
- riskHistoryOutcomeCodes: [],
- auditEvents: [],
- matchedRuleIds: [],
- };
- const capabilities: Array<AccountPolicyContactCapability> = [];
- for (const rule of rules) {
- if (!this.conditionEvaluator.matches(rule.when, context, decision)) continue;
- addUnique(capabilities, rule.capabilities);
- }
- return new AccountPolicyContactDecision(capabilities);
- }
-}
-
-class AccountPolicyEvaluator implements IAccountPolicyEvaluator {
- private readonly ruleEvaluator: AccountPolicyRuleEvaluator;
- private readonly contactCapabilityEvaluator: AccountPolicyContactCapabilityEvaluator;
-
- constructor(private readonly document: AccountPolicyDocument) {
- const facts = new AccountPolicyFactReader();
- const conditionEvaluator = new AccountPolicyConditionEvaluator(document.sets, facts);
- this.ruleEvaluator = new AccountPolicyRuleEvaluator(facts, conditionEvaluator);
- this.contactCapabilityEvaluator = new AccountPolicyContactCapabilityEvaluator(conditionEvaluator);
- }
-
- evaluate(context: AccountPolicyContext): AccountPolicyDecision {
- const decision: MutableAccountPolicyDecision = {
- flagBits: this.document.defaults.flagBits,
- inviteAutoJoinEnabled: this.document.defaults.inviteAutoJoinEnabled,
- inviteAutoJoinSkipReason: this.document.defaults.inviteAutoJoinEnabled ? null : 'default_disabled',
- riskHistoryOutcomeCodes: [],
- auditEvents: [],
- matchedRuleIds: [],
- };
- for (const rule of this.document.rules) {
- this.ruleEvaluator.apply(rule, context, decision);
- }
- return {
- flagBits: decision.flagBits,
- inviteAutoJoinEnabled: decision.inviteAutoJoinEnabled,
- inviteAutoJoinSkipReason: decision.inviteAutoJoinSkipReason,
- riskHistoryOutcomeCodes: [...decision.riskHistoryOutcomeCodes],
- auditEvents: [...decision.auditEvents],
- matchedRuleIds: [...decision.matchedRuleIds],
- };
- }
-
- evaluateContact(contact: AccountPolicyContactContext): AccountPolicyContactDecision {
- return this.contactCapabilityEvaluator.evaluate(this.document.contactCapabilityRules, contact);
- }
-
- isLowRiskEmailTld(tld: string | null | undefined): boolean {
- const normalized = tld ? normalizePolicyTld(tld) : null;
- return normalized ? this.document.classifiers.emailTlds.lowRisk.has(normalized) : false;
- }
-
- classifyEmailTld(tld: string | null | undefined): AccountPolicyEmailTldRisk | null {
- const normalized = tld ? normalizePolicyTld(tld) : null;
- if (!normalized) return null;
- if (this.document.classifiers.emailTlds.lowRisk.size === 0) return null;
- return this.document.classifiers.emailTlds.lowRisk.has(normalized) ? null : 'high';
- }
-
- isBlockedRegistrationEmailDomain(domain: string | null | undefined): boolean {
- const tld = extractPolicyTldFromDomain(domain);
- return tld ? this.document.classifiers.emailTlds.blocked.has(tld) : false;
- }
-
- isTrustedCommercialPrivacyProvider(providerName: string | null | undefined): boolean {
- const tokens = normalizeProviderTokens(providerName);
- return this.document.classifiers.network.trustedPrivacyProviderMarkers.some((marker) =>
- containsTokenRun(tokens, marker),
- );
- }
-
- isEducationOrganizationName(organizationName: string | null | undefined): boolean {
- const normalized = organizationName ? normalizePolicyToken(organizationName) : '';
- return normalized
- ? this.document.classifiers.network.educationOrgMarkers.some((marker) => normalized.includes(marker))
- : false;
- }
-
- classifyReverseDnsHostname(hostname: string | null | undefined): ReverseDnsClassification {
- const normalized = hostname ? normalizePolicyToken(hostname) : '';
- if (!normalized) return 'unknown';
- for (const classification of REVERSE_DNS_CLASSIFICATION_ORDER) {
- const markers = this.document.classifiers.network.reverseDnsMarkers[classification];
- if (markers.some((marker) => marker.test(normalized))) {
- return classification;
- }
- }
- return 'unknown';
- }
-
- getMinimumAgeForRegion(countryCode: string | null | undefined, defaultAge: number): number {
- const normalized = countryCode ? normalizePolicyCountryCode(countryCode) : '';
- return normalized ? (this.document.classifiers.regionalMinimumAge.byCountry[normalized] ?? defaultAge) : defaultAge;
- }
-}
-
-function parseAccountPolicyDsl(rawDocument: unknown): AccountPolicyDocument {
- return new AccountPolicyDocumentParser().parse(rawDocument);
-}
-
-export function createAccountPolicyEvaluator(rawDocument: unknown): AccountPolicyEvaluator {
- return new AccountPolicyEvaluator(parseAccountPolicyDsl(rawDocument));
-}
-
-function createDisabledAccountPolicyEvaluator(): AccountPolicyEvaluator {
- return createAccountPolicyEvaluator({version: 1, id: 'disabled', rules: []});
-}
-
-export function isAccountPolicyConfigMissing(rawDocument: unknown): boolean {
- return rawDocument === undefined || rawDocument === null || rawDocument === '';
-}
-
-export function createAccountPolicyEvaluatorFromConfig(rawDocument: unknown): AccountPolicyEvaluator {
- if (isAccountPolicyConfigMissing(rawDocument)) {
- return createDisabledAccountPolicyEvaluator();
- }
- if (typeof rawDocument === 'string') {
- try {
- return createAccountPolicyEvaluator(JSON.parse(rawDocument));
- } catch (error) {
- throw new Error(
- `FLUXER_ACCOUNT_POLICY_DSL must contain valid JSON: ${error instanceof Error ? error.message : String(error)}`,
- );
- }
- }
- return createAccountPolicyEvaluator(rawDocument);
-}
-
-export function isAssessmentThresholdAuditEvent(event: AccountPolicyAuditEvent): boolean {
- return event.event === 'assessment_threshold_notice' && event.level === 'warn';
-}
diff --git a/fluxer_api/src/api/risk/AccountPolicyService.ts b/fluxer_api/src/api/risk/AccountPolicyService.ts
deleted file mode 100644
index 16f9b3d90..000000000
--- a/fluxer_api/src/api/risk/AccountPolicyService.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {Config} from '@app/api/Config';
-import {
- type AccountPolicyContactCapability,
- createAccountPolicyContactContext,
- createAccountPolicyContactDomainContext,
- createAccountPolicyEvaluatorFromConfig,
- type IAccountPolicyEvaluator,
- isAccountPolicyConfigMissing,
-} from '@app/api/risk/AccountPolicyEvaluator';
-import type {ReverseDnsClassification} from '@app/api/risk/RiskTypes';
-
-let injectedAccountPolicyEvaluator: IAccountPolicyEvaluator | null = null;
-let configuredAccountPolicyEvaluator: IAccountPolicyEvaluator | null = null;
-
-export function setInjectedAccountPolicyEvaluator(evaluator: IAccountPolicyEvaluator | undefined): void {
- injectedAccountPolicyEvaluator = evaluator ?? null;
- configuredAccountPolicyEvaluator = null;
-}
-
-function canRunWithoutAccountPolicyConfig(): boolean {
- return Config.nodeEnv === 'development' || Config.dev.testModeEnabled || Config.instance.selfHosted;
-}
-
-export function getAccountPolicyEvaluator(): IAccountPolicyEvaluator {
- if (injectedAccountPolicyEvaluator) return injectedAccountPolicyEvaluator;
- if (!configuredAccountPolicyEvaluator) {
- const rawPolicy = Config.risk.accountPolicyDsl;
- if (isAccountPolicyConfigMissing(rawPolicy) && !canRunWithoutAccountPolicyConfig()) {
- throw new Error('FLUXER_ACCOUNT_POLICY_DSL is required in hosted production');
- }
- configuredAccountPolicyEvaluator = createAccountPolicyEvaluatorFromConfig(rawPolicy);
- }
- return configuredAccountPolicyEvaluator;
-}
-
-export function accountPolicyContactHasCapability(
- email: string | null | undefined,
- capability: AccountPolicyContactCapability,
-): boolean {
- return getAccountPolicyEvaluator()
- .evaluateContact(createAccountPolicyContactContext(email))
- .hasCapability(capability);
-}
-
-export function accountPolicyContactDomainHasCapability(
- domain: string | null | undefined,
- capability: AccountPolicyContactCapability,
-): boolean {
- return getAccountPolicyEvaluator()
- .evaluateContact(createAccountPolicyContactDomainContext(domain))
- .hasCapability(capability);
-}
-
-export function isAccountPolicyContactDomainReputationExempt(domain: string | null | undefined): boolean {
- return accountPolicyContactDomainHasCapability(domain, 'reputation_checks_exempt');
-}
-
-export function classifyAccountPolicyEmailTld(tld: string | null | undefined): 'high' | null {
- return getAccountPolicyEvaluator().classifyEmailTld(tld);
-}
-
-export function isAccountPolicyLowRiskEmailTld(tld: string | null | undefined): boolean {
- return getAccountPolicyEvaluator().isLowRiskEmailTld(tld);
-}
-
-export function isAccountPolicyBlockedRegistrationEmailDomain(domain: string | null | undefined): boolean {
- return getAccountPolicyEvaluator().isBlockedRegistrationEmailDomain(domain);
-}
-
-export function isAccountPolicyTrustedCommercialPrivacyProvider(providerName: string | null | undefined): boolean {
- return getAccountPolicyEvaluator().isTrustedCommercialPrivacyProvider(providerName);
-}
-
-export function isAccountPolicyEducationOrganizationName(organizationName: string | null | undefined): boolean {
- return getAccountPolicyEvaluator().isEducationOrganizationName(organizationName);
-}
-
-export function classifyAccountPolicyReverseDnsHostname(hostname: string | null | undefined): ReverseDnsClassification {
- return getAccountPolicyEvaluator().classifyReverseDnsHostname(hostname);
-}
-
-export function getAccountPolicyMinimumAgeForRegion(
- countryCode: string | null | undefined,
- defaultAge: number,
-): number {
- return getAccountPolicyEvaluator().getMinimumAgeForRegion(countryCode, defaultAge);
-}
diff --git a/fluxer_api/src/api/risk/AutoBanAsnExemptions.ts b/fluxer_api/src/api/risk/AutoBanAsnExemptions.ts
deleted file mode 100644
index 82d9fe499..000000000
--- a/fluxer_api/src/api/risk/AutoBanAsnExemptions.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {Config} from '@app/api/Config';
-import {type GeoipAsnResult, lookupAsnByIp} from '@pkgs/geoip/src/GeoipLookup';
-
-const ASN_ENTRY_REGEX = /^\d+$/u;
-
-type AsnLookup = (ip: string) => Promise<GeoipAsnResult>;
-
-let exemptAsns: ReadonlySet<number> | null = null;
-let injectedAsnLookup: AsnLookup | undefined;
-
-function getExemptAsns(): ReadonlySet<number> {
- if (exemptAsns) {
- return exemptAsns;
- }
- const asns = new Set<number>();
- const rawValue = process.env.FLUXER_ABUSE_EXEMPT_ASNS;
- if (rawValue) {
- for (const entry of rawValue.split(',')) {
- const trimmed = entry.trim();
- if (!ASN_ENTRY_REGEX.test(trimmed)) continue;
- const asn = Number.parseInt(trimmed, 10);
- if (Number.isSafeInteger(asn) && asn > 0) asns.add(asn);
- }
- }
- exemptAsns = asns;
- return asns;
-}
-
-function resolveAsn(ip: string): Promise<GeoipAsnResult> {
- if (injectedAsnLookup) {
- return injectedAsnLookup(ip);
- }
- return lookupAsnByIp(ip, Config.geoip.maxmindAsnDbPath);
-}
-
-export async function isAutoBanExemptAsn(ip: string): Promise<boolean> {
- const asns = getExemptAsns();
- if (asns.size === 0) return false;
- const result = await resolveAsn(ip);
- return result.asn !== null && asns.has(result.asn);
-}
-
-export function setInjectedAutoBanAsnLookup(lookup: AsnLookup | undefined): void {
- injectedAsnLookup = lookup;
-}
-
-export function resetAutoBanAsnExemptionsForTesting(): void {
- exemptAsns = null;
- injectedAsnLookup = undefined;
-}
diff --git a/fluxer_api/src/api/risk/DeferredPhoneGate.test.ts b/fluxer_api/src/api/risk/DeferredPhoneGate.test.ts
deleted file mode 100644
index 897bc9d77..000000000
--- a/fluxer_api/src/api/risk/DeferredPhoneGate.test.ts
+++ /dev/null
@@ -1,242 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {Guild} from '@app/api/models/Guild';
-import type {User} from '@app/api/models/User';
-import {
- canEscapePhoneGate,
- type DeferredPhoneGateConfig,
- evaluateDeferredPhoneGate,
- guildTriggersPhoneGate,
- restorePhoneGateDeferral,
-} from '@app/api/risk/DeferredPhoneGate';
-import {resolveDeferredPhoneGateEnabled} from '@app/api/risk/DeferredPhoneGateCache';
-import {GuildFeatures} from '@fluxer/constants/src/GuildConstants';
-import {
- DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- PHONE_GATE_PROMOTED_FROM_DEFERRAL,
- SuspiciousActivityFlags,
-} from '@fluxer/constants/src/UserConstants';
-import {snowflakeToDate} from '@fluxer/snowflake/src/Snowflake';
-import {ms} from 'itty-time';
-import {describe, expect, it} from 'vitest';
-
-const CONFIG: DeferredPhoneGateConfig = {
- enabled: true,
- windowMs: 6 * ms('1 hour'),
- memberThreshold: 50,
-};
-
-const USER_SNOWFLAKE = 1485046297690587136n;
-const REGISTERED_AT = snowflakeToDate(USER_SNOWFLAKE).getTime();
-
-function createUser(overrides: Partial<Pick<User, 'hasVerifiedPhone' | 'suspiciousActivityFlags'>> = {}): User {
- return {
- id: USER_SNOWFLAKE,
- hasVerifiedPhone: false,
- suspiciousActivityFlags: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- ...overrides,
- } as unknown as User;
-}
-
-function createGuild(overrides: {discoverable?: boolean; memberCount?: number} = {}): Guild {
- return {
- id: 1n,
- features: new Set(overrides.discoverable ? [GuildFeatures.DISCOVERABLE] : []),
- memberCount: overrides.memberCount ?? 10,
- } as unknown as Guild;
-}
-
-describe('evaluateDeferredPhoneGate', () => {
- it('applies to a discoverable guild inside the window, promoting the real phone flags', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser(),
- createGuild({discoverable: true, memberCount: 3}),
- CONFIG,
- REGISTERED_AT + ms('1 hour'),
- );
- expect(outcome.applies).toBe(true);
- if (!outcome.applies) return;
- expect(outcome.flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).toBe(0);
- expect(outcome.flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).not.toBe(0);
- expect(outcome.flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).not.toBe(0);
- });
-
- it('applies to a large non-discoverable guild inside the window', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser(),
- createGuild({memberCount: 51}),
- CONFIG,
- REGISTERED_AT + ms('1 hour'),
- );
- expect(outcome.applies).toBe(true);
- });
-
- it('does not apply to a small non-discoverable guild', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser(),
- createGuild({memberCount: 50}),
- CONFIG,
- REGISTERED_AT + ms('1 hour'),
- );
- expect(outcome).toEqual({applies: false, reason: 'guild_below_threshold'});
- });
-
- it('applies on the last millisecond inside the window', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser(),
- createGuild({discoverable: true}),
- CONFIG,
- REGISTERED_AT + CONFIG.windowMs - 1,
- );
- expect(outcome.applies).toBe(true);
- });
-
- it('does not gate once the window has elapsed, and mutates nothing', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser(),
- createGuild({discoverable: true}),
- CONFIG,
- REGISTERED_AT + CONFIG.windowMs,
- );
- expect(outcome).toEqual({applies: false, reason: 'outside_window'});
- });
- it('is inert while the gate is disabled, even on a qualifying guild', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser(),
- createGuild({discoverable: true}),
- {...CONFIG, enabled: false},
- REGISTERED_AT + ms('1 hour'),
- );
- expect(outcome).toEqual({applies: false, reason: 'gate_disabled'});
- });
-
- it('does not apply to a user who already has a verified phone', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser({hasVerifiedPhone: true}),
- createGuild({discoverable: true}),
- CONFIG,
- REGISTERED_AT + ms('1 hour'),
- );
- expect(outcome).toEqual({applies: false, reason: 'already_verified'});
- });
-
- it('preserves non-phone requirements when promoting', () => {
- const outcome = evaluateDeferredPhoneGate(
- createUser({
- suspiciousActivityFlags:
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL |
- SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION |
- DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- }),
- createGuild({discoverable: true}),
- CONFIG,
- REGISTERED_AT + ms('1 hour'),
- );
- expect(outcome.applies).toBe(true);
- if (!outcome.applies) return;
- expect(outcome.flags).toBe(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL |
- SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION |
- PHONE_GATE_PROMOTED_FROM_DEFERRAL,
- );
- });
-});
-
-describe('resolveDeferredPhoneGateEnabled', () => {
- it('is on only when the tunable is set and the instance is not single-community', () => {
- expect(resolveDeferredPhoneGateEnabled({deferred_phone_gate_enabled: true, single_community_enabled: false})).toBe(
- true,
- );
- expect(resolveDeferredPhoneGateEnabled({deferred_phone_gate_enabled: true, single_community_enabled: true})).toBe(
- false,
- );
- expect(resolveDeferredPhoneGateEnabled({deferred_phone_gate_enabled: false, single_community_enabled: false})).toBe(
- false,
- );
- });
-});
-
-describe('guildTriggersPhoneGate', () => {
- it('qualifies a discoverable guild regardless of size', () => {
- expect(guildTriggersPhoneGate(createGuild({discoverable: true, memberCount: 1}), 50)).toBe(true);
- });
- it('qualifies a guild strictly above the member threshold', () => {
- expect(guildTriggersPhoneGate(createGuild({memberCount: 51}), 50)).toBe(true);
- expect(guildTriggersPhoneGate(createGuild({memberCount: 50}), 50)).toBe(false);
- });
-});
-
-describe('restorePhoneGateDeferral', () => {
- it('sets the marker, clears the promotion bit and preserves the stored phone requirement', () => {
- const promoted = SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | PHONE_GATE_PROMOTED_FROM_DEFERRAL;
- expect(restorePhoneGateDeferral(promoted)).toBe(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- );
- });
-
- it('preserves every unrelated requirement bit', () => {
- const promoted =
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL |
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_PHONE |
- PHONE_GATE_PROMOTED_FROM_DEFERRAL;
- const restored = restorePhoneGateDeferral(promoted);
- expect(restored & SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL).not.toBe(0);
- expect(restored & SuspiciousActivityFlags.REQUIRE_REVERIFIED_PHONE).not.toBe(0);
- expect(restored & PHONE_GATE_PROMOTED_FROM_DEFERRAL).toBe(0);
- expect(restored & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
- });
-
- it('is idempotent when applied twice', () => {
- const promoted = SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | PHONE_GATE_PROMOTED_FROM_DEFERRAL;
- const once = restorePhoneGateDeferral(promoted);
- expect(restorePhoneGateDeferral(once)).toBe(once);
- });
-});
-
-describe('canEscapePhoneGate', () => {
- const PROMOTED = SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | PHONE_GATE_PROMOTED_FROM_DEFERRAL;
-
- it('accepts a promoted account while the gate is on', () => {
- expect(canEscapePhoneGate(createUser({suspiciousActivityFlags: PROMOTED}), 'ok')).toBe(true);
- });
-
- it('accepts a promoted account carrying a re-verification tier instead', () => {
- const promotedReverify = SuspiciousActivityFlags.REQUIRE_REVERIFIED_PHONE | PHONE_GATE_PROMOTED_FROM_DEFERRAL;
- expect(canEscapePhoneGate(createUser({suspiciousActivityFlags: promotedReverify}), 'ok')).toBe(true);
- });
-
- it('refuses an account with no promotion bit, whatever its flag shape looks like', () => {
- const imposed = SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE;
- expect(canEscapePhoneGate(createUser({suspiciousActivityFlags: imposed}), 'ok')).toBe(false);
- });
-
- it('refuses an account still carrying the deferral marker', () => {
- const stillDeferred =
- SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE |
- DEFERRED_PHONE_ON_COMMUNITY_JOIN |
- PHONE_GATE_PROMOTED_FROM_DEFERRAL;
- expect(canEscapePhoneGate(createUser({suspiciousActivityFlags: stillDeferred}), 'ok')).toBe(false);
- });
-
- it('refuses an account carrying the inbound-SMS tier, which is never suppressed at read time', () => {
- const inbound = PROMOTED | SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION;
- expect(canEscapePhoneGate(createUser({suspiciousActivityFlags: inbound}), 'ok')).toBe(false);
- });
-
- it('refuses an account that already has a verified phone', () => {
- expect(canEscapePhoneGate(createUser({hasVerifiedPhone: true, suspiciousActivityFlags: PROMOTED}), 'ok')).toBe(
- false,
- );
- });
-
- it('refuses an account with no deferrable phone requirement left to suppress', () => {
- const emailOnly = SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL | PHONE_GATE_PROMOTED_FROM_DEFERRAL;
- expect(canEscapePhoneGate(createUser({suspiciousActivityFlags: emailOnly}), 'ok')).toBe(false);
- });
-
- it('refuses whenever the gate is not readable as on, since the marker would suppress nothing', () => {
- const user = createUser({suspiciousActivityFlags: PROMOTED});
- expect(canEscapePhoneGate(user, 'disabled')).toBe(false);
- expect(canEscapePhoneGate(user, 'unreadable')).toBe(false);
- });
-});
diff --git a/fluxer_api/src/api/risk/DeferredPhoneGate.ts b/fluxer_api/src/api/risk/DeferredPhoneGate.ts
deleted file mode 100644
index f849326ea..000000000
--- a/fluxer_api/src/api/risk/DeferredPhoneGate.ts
+++ /dev/null
@@ -1,127 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {Logger} from '@app/api/Logger';
-import {getInstanceConfigRepository} from '@app/api/middleware/ServiceSingletons';
-import type {Guild} from '@app/api/models/Guild';
-import type {User} from '@app/api/models/User';
-import {resolveDeferredPhoneGateEnabled} from '@app/api/risk/DeferredPhoneGateCache';
-import {GuildFeatures} from '@fluxer/constants/src/GuildConstants';
-import {
- DEFERRABLE_PHONE_FLAGS,
- DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- NEVER_DEFERRABLE_PHONE_FLAGS,
- PHONE_GATE_PROMOTED_FROM_DEFERRAL,
-} from '@fluxer/constants/src/UserConstants';
-import {snowflakeToDate} from '@fluxer/snowflake/src/Snowflake';
-import {ms} from 'itty-time';
-
-export interface DeferredPhoneGateConfig {
- enabled: boolean;
- windowMs: number;
- memberThreshold: number;
-}
-
-export const DEFAULT_PHONE_GATE_MEMBER_THRESHOLD = 50;
-
-export const PHONE_GATE_ESCAPE_MAX_GUILDS = 25;
-
-const DISABLED_CONFIG: DeferredPhoneGateConfig = {
- enabled: false,
- windowMs: Number.POSITIVE_INFINITY,
- memberThreshold: Number.POSITIVE_INFINITY,
-};
-
-export type DeferredPhoneGateStatus = 'ok' | 'disabled' | 'unreadable';
-
-interface DeferredPhoneGateConfigResult {
- status: DeferredPhoneGateStatus;
- config: DeferredPhoneGateConfig;
-}
-
-export async function getDeferredPhoneGateConfig(): Promise<DeferredPhoneGateConfigResult> {
- try {
- const policy = await getInstanceConfigRepository().getInstancePolicyConfig();
- if (!resolveDeferredPhoneGateEnabled(policy)) {
- return {status: 'disabled', config: DISABLED_CONFIG};
- }
- return {
- status: 'ok',
- config: {
- enabled: true,
- windowMs: policy.deferred_phone_gate_window_hours * ms('1 hour'),
- memberThreshold: policy.deferred_phone_gate_member_threshold,
- },
- };
- } catch (error) {
- Logger.warn({error}, 'Failed to read deferred phone gate config');
- return {status: 'unreadable', config: DISABLED_CONFIG};
- }
-}
-
-export async function deferPhoneFlagsUntilCommunityJoin(flagBits: number): Promise<number> {
- if ((flagBits & DEFERRABLE_PHONE_FLAGS) === 0 || (flagBits & NEVER_DEFERRABLE_PHONE_FLAGS) !== 0) {
- return flagBits;
- }
- const {status} = await getDeferredPhoneGateConfig();
- if (status !== 'ok') {
- return flagBits;
- }
- return flagBits | DEFERRED_PHONE_ON_COMMUNITY_JOIN;
-}
-
-export function restorePhoneGateDeferral(flagBits: number): number {
- return (flagBits | DEFERRED_PHONE_ON_COMMUNITY_JOIN) & ~PHONE_GATE_PROMOTED_FROM_DEFERRAL;
-}
-
-export function canEscapePhoneGate(user: User, gateStatus: DeferredPhoneGateStatus): boolean {
- if (gateStatus !== 'ok') {
- return false;
- }
- if (user.hasVerifiedPhone) {
- return false;
- }
- const flagBits = user.suspiciousActivityFlags ?? 0;
- if ((flagBits & DEFERRABLE_PHONE_FLAGS) === 0) {
- return false;
- }
- if ((flagBits & NEVER_DEFERRABLE_PHONE_FLAGS) !== 0) {
- return false;
- }
- if ((flagBits & DEFERRED_PHONE_ON_COMMUNITY_JOIN) !== 0) {
- return false;
- }
- return (flagBits & PHONE_GATE_PROMOTED_FROM_DEFERRAL) !== 0;
-}
-
-export function guildTriggersPhoneGate(guild: Guild, memberThreshold: number): boolean {
- return guild.features.has(GuildFeatures.DISCOVERABLE) || guild.memberCount > memberThreshold;
-}
-
-type DeferredPhoneGateOutcome =
- | {applies: false; reason: 'gate_disabled' | 'already_verified' | 'guild_below_threshold' | 'outside_window'}
- | {applies: true; flags: number};
-
-export function evaluateDeferredPhoneGate(
- user: User,
- guild: Guild,
- config: DeferredPhoneGateConfig,
- now: number,
-): DeferredPhoneGateOutcome {
- if (!config.enabled) {
- return {applies: false, reason: 'gate_disabled'};
- }
- if (user.hasVerifiedPhone) {
- return {applies: false, reason: 'already_verified'};
- }
- if (!guildTriggersPhoneGate(guild, config.memberThreshold)) {
- return {applies: false, reason: 'guild_below_threshold'};
- }
- if (now - snowflakeToDate(BigInt(user.id)).getTime() >= config.windowMs) {
- return {applies: false, reason: 'outside_window'};
- }
- return {
- applies: true,
- flags:
- ((user.suspiciousActivityFlags ?? 0) & ~DEFERRED_PHONE_ON_COMMUNITY_JOIN) | PHONE_GATE_PROMOTED_FROM_DEFERRAL,
- };
-}
diff --git a/fluxer_api/src/api/risk/DeferredPhoneGateCache.ts b/fluxer_api/src/api/risk/DeferredPhoneGateCache.ts
deleted file mode 100644
index 7765caa14..000000000
--- a/fluxer_api/src/api/risk/DeferredPhoneGateCache.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-// Null until a policy has actually been read. A deferral is only ever granted
-// while the gate is on, so reading "not known yet" as "off" revokes it from every
-// account holding one and answers their next request with the phone requirement
-// the deferral exists to hold back.
-let cachedEnabled: boolean | null = null;
-
-export function resolveDeferredPhoneGateEnabled(policy: {
- deferred_phone_gate_enabled: boolean;
- single_community_enabled: boolean;
-}): boolean {
- return policy.deferred_phone_gate_enabled && !policy.single_community_enabled;
-}
-
-export function getCachedDeferredPhoneGateEnabled(): boolean | null {
- return cachedEnabled;
-}
-
-export function setCachedDeferredPhoneGateEnabled(enabled: boolean): void {
- cachedEnabled = enabled;
-}
diff --git a/fluxer_api/src/api/risk/DeterministicRiskEngine.ts b/fluxer_api/src/api/risk/DeterministicRiskEngine.ts
deleted file mode 100644
index 3df4c5c84..000000000
--- a/fluxer_api/src/api/risk/DeterministicRiskEngine.ts
+++ /dev/null
@@ -1,861 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {AbuseProneEmailTldRisk, classifyAbuseProneEmailTld} from '@app/api/risk/AbuseProneEmailTlds';
-import {isMajorEmailProvider} from '@app/api/risk/MajorEmailProviders';
-import {derivePlusAddressBase} from '@app/api/risk/PlusAddressUtils';
-import type {RiskToolbox} from '@app/api/risk/RiskToolbox';
-import {
- type HistoricalOutcomeResult,
- type IpInfoAnonymousResult,
- RecommendedAction,
- type RegistrationEvent,
- type RiskAssessment,
- RiskConfidence,
- RiskDecisionMethod,
- RiskLevel,
- type RiskSignals,
-} from '@app/api/risk/RiskTypes';
-import {isTrustedCommercialPrivacyProvider} from '@app/api/risk/TrustedPrivacyProviders';
-
-interface DeterministicRiskEngineLogger {
- info(payload: object, msg: string): void;
- warn(payload: object, msg: string): void;
- error(payload: object, msg: string): void;
-}
-
-interface DeterministicRiskEngineConfig {
- logger: DeterministicRiskEngineLogger;
-}
-
-const NULL_LOGGER: DeterministicRiskEngineLogger = {
- info: () => undefined,
- warn: () => undefined,
- error: () => undefined,
-};
-const DEFAULT_CONFIG: DeterministicRiskEngineConfig = {
- logger: NULL_LOGGER,
-};
-const ENGINE_NAME = 'deterministic';
-
-interface ScoreContribution {
- readonly rule: string;
- readonly points: number;
- readonly reason: string;
- readonly flags?: {
- readonly floorsToHigh?: boolean;
- };
-}
-
-interface VelocityTier {
- readonly minCount: number;
- readonly points: number;
- readonly severity: string;
-}
-
-const THRESHOLD_MEDIUM = 30;
-const THRESHOLD_HIGH = 60;
-const THRESHOLD_VERY_HIGH = 80;
-const RESI_PROXY_PERSISTENCE_HIGH = 70;
-const RESI_PROXY_PERSISTENCE_MEDIUM = 30;
-const POINTS_RESI_PROXY_HIGH_PERSISTENCE = 45;
-const POINTS_RESI_PROXY_MEDIUM_PERSISTENCE = 20;
-const POINTS_RESI_PROXY_LOW_PERSISTENCE = 10;
-const POINTS_UNTRUSTED_VPN = 25;
-const POINTS_RESI_PROXY_HOSTING_CROSSTAG = POINTS_UNTRUSTED_VPN;
-const MOBILE_PROXY_DAMPEN_MULTIPLIER = 0.6;
-const FREQUENT_ABUSER_WINDOW_HOURS = 180 * 24;
-const FREQUENT_ABUSER_MIN_ENFORCED = 5;
-const POINTS_FREQUENT_ABUSER_IP = 40;
-const POINTS_FREQUENT_ABUSER_SUBNET = 25;
-const POINTS_SUSPICIOUS_IP = 35;
-const SHARED_CONN_MIN_REGISTRATIONS = 3;
-const SHARED_CONN_CAP_POINTS = 8;
-const IP_VELOCITY_TIERS: ReadonlyArray<VelocityTier> = [
- {minCount: 5, points: 40, severity: 'high'},
- {minCount: 3, points: 20, severity: 'moderate'},
- {minCount: 1, points: 8, severity: 'low'},
-];
-const SUBNET_VELOCITY_TIERS: ReadonlyArray<VelocityTier> = [
- {minCount: 15, points: 25, severity: 'high'},
- {minCount: 8, points: 12, severity: 'moderate'},
-];
-const OUTCOME_WEIGHT_IP = 1.0;
-const OUTCOME_WEIGHT_SUBNET = 0.7;
-const OUTCOME_MIN_RATIO = 0.05;
-const OUTCOME_MIN_ABSOLUTE = 2;
-const OUTCOME_STRONG_RATIO = 0.3;
-const OUTCOME_STRONG_ABSOLUTE = 3;
-const OUTCOME_MODERATE_RATIO = 0.15;
-const OUTCOME_MODERATE_ABSOLUTE = 2;
-const OUTCOME_POINTS_STRONG = 35;
-const OUTCOME_POINTS_MODERATE = 20;
-const OUTCOME_POINTS_WEAK = 8;
-const ASN_OUTCOME_MIN_ENFORCED = 3;
-const ASN_OUTCOME_MIN_RATIO = 0.15;
-const ASN_OUTCOME_RATIO_MULTIPLIER = 30;
-const ASN_OUTCOME_POINTS_MAX = 20;
-const EMAIL_GIBBERISH_THRESHOLD = 70;
-const EMAIL_SUSPICIOUS_THRESHOLD = 50;
-const POINTS_EMAIL_GIBBERISH = 20;
-const POINTS_EMAIL_SUSPICIOUS = 10;
-const POINTS_DISPOSABLE_DOMAIN = 25;
-const PLUS_ADDRESS_TIERS: ReadonlyArray<VelocityTier> = [
- {minCount: 4, points: 65, severity: 'heavy'},
- {minCount: 3, points: 30, severity: 'elevated'},
-];
-const POINTS_FRESH_DOMAIN = 15;
-const POINTS_FRESH_DOMAIN_WITH_ABUSE_TLD = 20;
-const POINTS_ABUSE_PRONE_TLD = 10;
-const POINTS_NO_MX = 15;
-const DOMAIN_VELOCITY_TIERS: ReadonlyArray<VelocityTier> = [
- {minCount: 5, points: 20, severity: 'high'},
- {minCount: 3, points: 10, severity: 'moderate'},
-];
-const POINTS_UA_BOT = 40;
-const POINTS_UA_HEADLESS = 30;
-const POINTS_UA_SUSPICIOUS = 10;
-const POINTS_GEO_MISMATCH = 5;
-const POINTS_SUSPICIOUS_HOUR = 3;
-const CONFIDENCE_MIN_CONTRIBUTIONS_HIGH = 3;
-const CONFIDENCE_MIN_CONTRIBUTIONS_MEDIUM = 2;
-const CONFIDENCE_LOW_SCORE_MARGIN = 10;
-const RULE = {
- ipReputation: 'ip_reputation',
- ipVelocity: 'ip_velocity',
- subnetVelocity: 'subnet_velocity',
- historicalOutcomeIp: 'historical_outcome_ip',
- historicalOutcomeSubnet: 'historical_outcome_subnet',
- historicalOutcomeAsn: 'historical_outcome_asn',
- emailGibberish: 'email_gibberish',
- emailDisposable: 'email_disposable',
- plusAddressReuse: 'plus_address_reuse',
- domainAge: 'domain_age',
- domainTld: 'domain_tld',
- domainMx: 'domain_mx',
- domainVelocity: 'domain_velocity',
- userAgent: 'user_agent',
- geoMismatch: 'geo_locale_mismatch',
- suspiciousHour: 'suspicious_hour',
- policyResidentialProxyFloor: 'policy_residential_proxy_floor',
- frequentAbuserIp: 'frequent_abuser_ip',
- frequentAbuserSubnet: 'frequent_abuser_subnet',
- suspiciousIp: 'suspicious_ip',
- sharedConnectionDampener: 'shared_connection_dampener',
-} as const;
-
-function extractEmailDomain(email: string | null | undefined): string | null {
- if (!email) return null;
- const at = email.lastIndexOf('@');
- if (at < 0 || at === email.length - 1) return null;
- return email.slice(at + 1).toLowerCase();
-}
-
-function isNicheEmailDomain(domain: string | null): domain is string {
- return domain !== null && !isMajorEmailProvider(domain);
-}
-
-function clamp(value: number, min: number, max: number): number {
- if (Number.isNaN(value)) return min;
- return Math.min(Math.max(value, min), max);
-}
-
-async function settled<T>(
- promise: Promise<T | null> | null,
- logger: DeterministicRiskEngineLogger,
- source: string,
-): Promise<T | undefined> {
- if (promise === null) return undefined;
- try {
- const value = await promise;
- return value ?? undefined;
- } catch (err) {
- logger.warn(
- {source, error: err instanceof Error ? err.message : String(err)},
- 'DeterministicRiskEngine: signal lookup failed',
- );
- return undefined;
- }
-}
-
-function scoreByTiers(
- count: number,
- tiers: ReadonlyArray<VelocityTier>,
- rule: string,
- formatReason: (count: number, severity: string) => string,
-): ScoreContribution | null {
- for (const tier of tiers) {
- if (count >= tier.minCount) {
- return {
- rule,
- points: tier.points,
- reason: formatReason(count, tier.severity),
- };
- }
- }
- return null;
-}
-
-function scoreIpReputation(signals: RiskSignals): Array<ScoreContribution> {
- const ipInfo = signals.ipInfoAnonymous;
- if (!ipInfo?.available) return [];
- const providerName = ipInfo.providerName ?? null;
- const asnType = ipInfo.asnType?.toLowerCase() ?? null;
- const isHostingAsn = ipInfo.isHosting || asnType === 'hosting';
- const isTrustedVpn = isTrustedCommercialPrivacyProvider(providerName);
- const isMobileService = /_mobile$/i.test(providerName ?? '') || asnType === 'mobile';
- if (isTrustedVpn) {
- return [
- {
- rule: RULE.ipReputation,
- points: 0,
- reason: `trusted commercial VPN (provider: ${providerName})`,
- },
- ];
- }
- if (ipInfo.isResidentialProxy) {
- if (isHostingAsn) {
- return [
- {
- rule: RULE.ipReputation,
- points: POINTS_RESI_PROXY_HOSTING_CROSSTAG,
- reason: `residential-proxy cross-tag on hosting ASN — treating as untrusted commercial VPN (provider: ${providerName ?? 'unknown'})`,
- flags: {floorsToHigh: true},
- },
- ];
- }
- const persistence = ipInfo.percentDaysSeen;
- const provLabel = providerName ?? 'unknown';
- if (persistence == null) {
- let points = POINTS_RESI_PROXY_MEDIUM_PERSISTENCE;
- if (isMobileService) points = Math.round(points * MOBILE_PROXY_DAMPEN_MULTIPLIER);
- return [
- {
- rule: RULE.ipReputation,
- points,
- reason: `residential proxy (provider: ${provLabel}, persistence: unknown${isMobileService ? ', mobile gateway' : ''})`,
- flags: {floorsToHigh: true},
- },
- ];
- }
- if (persistence >= RESI_PROXY_PERSISTENCE_HIGH) {
- let points = POINTS_RESI_PROXY_HIGH_PERSISTENCE;
- if (isMobileService) points = Math.round(points * MOBILE_PROXY_DAMPEN_MULTIPLIER);
- return [
- {
- rule: RULE.ipReputation,
- points,
- reason: `persistent residential proxy (provider: ${provLabel}, persistence: ${persistence}%${isMobileService ? ', mobile gateway' : ''})`,
- flags: {floorsToHigh: true},
- },
- ];
- }
- if (persistence >= RESI_PROXY_PERSISTENCE_MEDIUM) {
- let points = POINTS_RESI_PROXY_MEDIUM_PERSISTENCE;
- if (isMobileService) points = Math.round(points * MOBILE_PROXY_DAMPEN_MULTIPLIER);
- return [
- {
- rule: RULE.ipReputation,
- points,
- reason: `intermittent residential proxy (provider: ${provLabel}, persistence: ${persistence}%${isMobileService ? ', mobile gateway' : ''})`,
- flags: {floorsToHigh: true},
- },
- ];
- }
- let points = POINTS_RESI_PROXY_LOW_PERSISTENCE;
- if (isMobileService) points = Math.round(points * MOBILE_PROXY_DAMPEN_MULTIPLIER);
- return [
- {
- rule: RULE.ipReputation,
- points,
- reason: `transient residential proxy sighting (provider: ${provLabel}, persistence: ${persistence}%${isMobileService ? ', mobile gateway' : ''})`,
- flags: {floorsToHigh: true},
- },
- ];
- }
- const isAnonymizingNetwork = ipInfo.isVpn || ipInfo.isProxy || isHostingAsn || ipInfo.isHosting;
- if (isAnonymizingNetwork) {
- const label = ipInfo.isVpn || ipInfo.isProxy ? 'untrusted VPN/proxy' : 'hosting/datacenter network';
- return [
- {
- rule: RULE.ipReputation,
- points: POINTS_UNTRUSTED_VPN,
- reason: `${label} detected by IPinfo (provider: ${providerName ?? 'unknown'}, connection_type: ${ipInfo.connectionType})`,
- },
- ];
- }
- return [];
-}
-
-function isTrustedCommercialPrivacySignal(ipInfo: IpInfoAnonymousResult | undefined): boolean {
- if (!ipInfo?.available) return false;
- if (!ipInfo.isAnonymous && !ipInfo.isVpn && !ipInfo.isProxy && !ipInfo.isRelay) return false;
- return isTrustedCommercialPrivacyProvider(ipInfo.providerName);
-}
-
-function isHighSharedAccessSignal(ipInfo: IpInfoAnonymousResult | undefined): boolean {
- if (!ipInfo?.available || ipInfo.isAnonymous || ipInfo.isHosting) return false;
- const asnType = ipInfo.asnType?.trim().toLowerCase() ?? null;
- return ipInfo.isMobile || ipInfo.connectionType === 'mobile' || asnType === 'mobile';
-}
-
-function scoreSuspiciousIp(signals: RiskSignals): Array<ScoreContribution> {
- const suspiciousIp = signals.suspiciousIp;
- if (!suspiciousIp) return [];
- const ipInfo = signals.ipInfoAnonymous;
- if (isHighSharedAccessSignal(ipInfo)) {
- return [
- {
- rule: RULE.suspiciousIp,
- points: 0,
- reason: `suspicious IP marker ignored for shared mobile/CGNAT network: ${suspiciousIp.ip}`,
- },
- ];
- }
- return [
- {
- rule: RULE.suspiciousIp,
- points: POINTS_SUSPICIOUS_IP,
- reason: `suspicious IP marker from ${suspiciousIp.source}: ${suspiciousIp.reason}`,
- },
- ];
-}
-
-function scoreIpVelocity(signals: RiskSignals): Array<ScoreContribution> {
- const contributions: Array<ScoreContribution> = [];
- const byIp = signals.registrationsByIp;
- if (byIp && byIp.totalRegistrations > 0) {
- const c = scoreByTiers(
- byIp.totalRegistrations,
- IP_VELOCITY_TIERS,
- RULE.ipVelocity,
- (n, sev) => `${sev} IP velocity: ${n} registrations in ${byIp.windowHours}h`,
- );
- if (c) contributions.push(c);
- }
- const bySub = signals.registrationsBySubnet;
- if (bySub) {
- const c = scoreByTiers(
- bySub.totalRegistrations,
- SUBNET_VELOCITY_TIERS,
- RULE.subnetVelocity,
- (n, sev) => `${sev} subnet velocity: ${n} registrations in ${bySub.windowHours}h`,
- );
- if (c) contributions.push(c);
- }
- return contributions;
-}
-
-function scoreHistoricalOutcomes(signals: RiskSignals): Array<ScoreContribution> {
- const contributions: Array<ScoreContribution> = [];
- const perSource: Array<ScoreContribution | null> = [
- scoreOutcomeRatio(signals.historicalOutcomesByIp, RULE.historicalOutcomeIp, 'IP', OUTCOME_WEIGHT_IP),
- scoreOutcomeRatio(
- signals.historicalOutcomesBySubnet,
- RULE.historicalOutcomeSubnet,
- 'subnet',
- OUTCOME_WEIGHT_SUBNET,
- ),
- ];
- for (const c of perSource) {
- if (c) contributions.push(c);
- }
- const asn = signals.historicalOutcomesByAsn;
- if (asn && asn.enforcedUsers >= ASN_OUTCOME_MIN_ENFORCED && asn.sampledUsers > 0) {
- const ratio = asn.enforcedUsers / asn.sampledUsers;
- if (ratio > ASN_OUTCOME_MIN_RATIO) {
- const points = Math.min(Math.round(ratio * ASN_OUTCOME_RATIO_MULTIPLIER), ASN_OUTCOME_POINTS_MAX);
- contributions.push({
- rule: RULE.historicalOutcomeAsn,
- points,
- reason: `ASN enforcement ratio: ${asn.enforcedUsers}/${asn.sampledUsers} enforced (${(ratio * 100).toFixed(0)}%)`,
- });
- }
- }
- return contributions;
-}
-
-function scoreOutcomeRatio(
- outcome: HistoricalOutcomeResult | undefined,
- rule: string,
- label: string,
- weight: number,
-): ScoreContribution | null {
- if (!outcome || outcome.sampledUsers === 0) return null;
- const enforced = outcome.enforcedUsers + outcome.disabledUsers + outcome.spammerUsers;
- if (enforced === 0) return null;
- const ratio = enforced / outcome.sampledUsers;
- if (ratio < OUTCOME_MIN_RATIO && enforced < OUTCOME_MIN_ABSOLUTE) return null;
- const pct = (ratio * 100).toFixed(0);
- let rawPoints: number;
- let reason: string;
- if (enforced >= OUTCOME_STRONG_ABSOLUTE && ratio > OUTCOME_STRONG_RATIO) {
- rawPoints = OUTCOME_POINTS_STRONG;
- reason = `high ${label} enforcement: ${enforced}/${outcome.sampledUsers} (${pct}%)`;
- } else if (enforced >= OUTCOME_MODERATE_ABSOLUTE || ratio > OUTCOME_MODERATE_RATIO) {
- rawPoints = OUTCOME_POINTS_MODERATE;
- reason = `moderate ${label} enforcement: ${enforced}/${outcome.sampledUsers} (${pct}%)`;
- } else {
- rawPoints = OUTCOME_POINTS_WEAK;
- reason = `some ${label} enforcement: ${enforced}/${outcome.sampledUsers}`;
- }
- return {rule, points: Math.round(rawPoints * weight), reason};
-}
-
-function scoreEmail(event: RegistrationEvent, signals: RiskSignals): Array<ScoreContribution> {
- if (!event.email) return [];
- const contributions: Array<ScoreContribution> = [];
- const syntax = signals.emailSyntax;
- if (syntax) {
- if (syntax.gibberishScore >= EMAIL_GIBBERISH_THRESHOLD) {
- contributions.push({
- rule: RULE.emailGibberish,
- points: POINTS_EMAIL_GIBBERISH,
- reason: `gibberish email local-part (score: ${syntax.gibberishScore})`,
- });
- } else if (syntax.gibberishScore >= EMAIL_SUSPICIOUS_THRESHOLD) {
- contributions.push({
- rule: RULE.emailGibberish,
- points: POINTS_EMAIL_SUSPICIOUS,
- reason: `suspicious email local-part (score: ${syntax.gibberishScore})`,
- });
- }
- }
- if (signals.domainDisposable?.isDisposable) {
- contributions.push({
- rule: RULE.emailDisposable,
- points: POINTS_DISPOSABLE_DOMAIN,
- reason: `disposable email domain: ${signals.domainDisposable.domain}`,
- });
- }
- const plus = signals.registrationsByPlusAddressBase;
- if (plus) {
- const c = scoreByTiers(
- plus.uniqueEmails,
- PLUS_ADDRESS_TIERS,
- RULE.plusAddressReuse,
- (n, sev) => `${sev} plus-address reuse: ${n} distinct aliases for ${plus.identifier} in ${plus.windowHours}h`,
- );
- if (c) contributions.push(c);
- }
- return contributions;
-}
-
-function scoreEmailDomain(signals: RiskSignals, domain: string): Array<ScoreContribution> {
- const contributions: Array<ScoreContribution> = [];
- const tld = domain.split('.').at(-1) ?? '';
- const tldRisk = classifyAbuseProneEmailTld(tld);
- if (signals.domainAge?.isNewlyRegistered) {
- contributions.push({
- rule: RULE.domainAge,
- points: POINTS_FRESH_DOMAIN,
- reason: `newly registered email domain (${signals.domainAge.ageDays} days old)`,
- });
- if (tldRisk === AbuseProneEmailTldRisk.High) {
- contributions.push({
- rule: RULE.domainTld,
- points: POINTS_FRESH_DOMAIN_WITH_ABUSE_TLD,
- reason: `abuse-prone TLD (.${tld}) with fresh domain`,
- });
- }
- } else if (tldRisk === AbuseProneEmailTldRisk.High) {
- contributions.push({
- rule: RULE.domainTld,
- points: POINTS_ABUSE_PRONE_TLD,
- reason: `non-allowlisted TLD (.${tld})`,
- });
- }
- if (signals.domainMx && !signals.domainMx.hasMx) {
- contributions.push({
- rule: RULE.domainMx,
- points: POINTS_NO_MX,
- reason: `no MX records for domain ${domain}`,
- });
- }
- const vel = signals.registrationsByEmailDomain;
- if (vel) {
- const c = scoreByTiers(
- vel.totalRegistrations,
- DOMAIN_VELOCITY_TIERS,
- RULE.domainVelocity,
- (n) => `email domain velocity: ${n} registrations in ${vel.windowHours}h`,
- );
- if (c) contributions.push(c);
- }
- return contributions;
-}
-
-function scoreUserAgent(signals: RiskSignals): Array<ScoreContribution> {
- const ua = signals.userAgent;
- if (!ua) return [];
- if (ua.isBot || ua.isAutomation) {
- return [
- {
- rule: RULE.userAgent,
- points: POINTS_UA_BOT,
- reason: `bot/automation UA detected: ${ua.riskNote}`,
- },
- ];
- }
- if (ua.isHeadless) {
- return [
- {
- rule: RULE.userAgent,
- points: POINTS_UA_HEADLESS,
- reason: `headless browser UA: ${ua.riskNote}`,
- },
- ];
- }
- if (ua.suspiciousPatterns.length > 0) {
- return [
- {
- rule: RULE.userAgent,
- points: POINTS_UA_SUSPICIOUS,
- reason: `suspicious UA patterns: ${ua.suspiciousPatterns.join(', ')}`,
- },
- ];
- }
- return [];
-}
-
-function scoreGeoLocale(signals: RiskSignals): Array<ScoreContribution> {
- const geo = signals.localeGeoMatch;
- if (!geo?.mismatchDetected) return [];
- return [
- {
- rule: RULE.geoMismatch,
- points: POINTS_GEO_MISMATCH,
- reason: `geo-locale mismatch: ${geo.notes.join(', ')}`,
- },
- ];
-}
-
-function scoreFrequentAbuser(signals: RiskSignals): Array<ScoreContribution> {
- const contributions: Array<ScoreContribution> = [];
- const byIp = signals.frequentAbuserByIp;
- if (byIp) {
- const enforced = byIp.enforcedUsers + byIp.disabledUsers + byIp.spammerUsers;
- if (enforced >= FREQUENT_ABUSER_MIN_ENFORCED) {
- contributions.push({
- rule: RULE.frequentAbuserIp,
- points: POINTS_FREQUENT_ABUSER_IP,
- reason: `frequent abuser IP: ${enforced} enforcements in the last ${byIp.windowHours / 24}d`,
- });
- }
- }
- const bySubnet = signals.frequentAbuserBySubnet;
- if (bySubnet) {
- const enforced = bySubnet.enforcedUsers + bySubnet.disabledUsers + bySubnet.spammerUsers;
- if (enforced >= FREQUENT_ABUSER_MIN_ENFORCED) {
- contributions.push({
- rule: RULE.frequentAbuserSubnet,
- points: POINTS_FREQUENT_ABUSER_SUBNET,
- reason: `frequent abuser subnet: ${enforced} enforcements in the last ${bySubnet.windowHours / 24}d`,
- });
- }
- }
- return contributions;
-}
-
-function applySharedConnectionDampener(
- contributions: Array<ScoreContribution>,
- signals: RiskSignals,
-): Array<ScoreContribution> {
- const byIp = signals.registrationsByIp;
- if (!byIp || byIp.totalRegistrations < SHARED_CONN_MIN_REGISTRATIONS) {
- return contributions;
- }
- const shortOutcome = signals.historicalOutcomesByIp;
- const longOutcome = signals.frequentAbuserByIp;
- const hasShortEnforcement =
- shortOutcome != null && shortOutcome.enforcedUsers + shortOutcome.disabledUsers + shortOutcome.spammerUsers > 0;
- const hasLongEnforcement =
- longOutcome != null && longOutcome.enforcedUsers + longOutcome.disabledUsers + longOutcome.spammerUsers > 0;
- if (hasShortEnforcement || hasLongEnforcement) return contributions;
- const ipInfo = signals.ipInfoAnonymous;
- const isCommercialAnonymizer = ipInfo?.isVpn || ipInfo?.isProxy || ipInfo?.isHosting;
- if (isCommercialAnonymizer) return contributions;
- const connectionType = ipInfo?.connectionType ?? null;
- const isSharedCandidate =
- connectionType === 'residential' ||
- connectionType === 'mobile' ||
- connectionType === 'education' ||
- (connectionType == null && signals.reverseDns?.classification === 'dynamic');
- if (!isSharedCandidate) return contributions;
- const rdnsClass = signals.reverseDns?.classification;
- if (rdnsClass === 'static' || rdnsClass === 'business') {
- return contributions;
- }
- const ipVelocityContrib = contributions.find((c) => c.rule === RULE.ipVelocity);
- if (!ipVelocityContrib || ipVelocityContrib.points <= SHARED_CONN_CAP_POINTS) {
- return contributions;
- }
- const delta = ipVelocityContrib.points - SHARED_CONN_CAP_POINTS;
- const next = contributions.filter((c) => c !== ipVelocityContrib);
- next.push({
- rule: RULE.ipVelocity,
- points: SHARED_CONN_CAP_POINTS,
- reason: `${ipVelocityContrib.reason} (capped — shared ${connectionType ?? 'residential'} connection)`,
- });
- next.push({
- rule: RULE.sharedConnectionDampener,
- points: -delta,
- reason: `shared ${connectionType ?? 'residential'} connection detected — IP velocity dampened by ${delta} points`,
- });
- return next;
-}
-
-function scoreTiming(signals: RiskSignals): Array<ScoreContribution> {
- const timing = signals.registrationTiming;
- if (!timing?.isSuspiciousHour) return [];
- return [
- {
- rule: RULE.suspiciousHour,
- points: POINTS_SUSPICIOUS_HOUR,
- reason: `registration at suspicious local hour (${timing.localHour})`,
- },
- ];
-}
-
-function collectContributions(event: RegistrationEvent, signals: RiskSignals): Array<ScoreContribution> {
- let contributions: Array<ScoreContribution> = [];
- const trustedCommercialPrivacy = isTrustedCommercialPrivacySignal(signals.ipInfoAnonymous);
- contributions.push(...scoreIpReputation(signals));
- if (!trustedCommercialPrivacy) {
- contributions.push(...scoreSuspiciousIp(signals));
- contributions.push(...scoreIpVelocity(signals));
- contributions.push(...scoreHistoricalOutcomes(signals));
- contributions.push(...scoreFrequentAbuser(signals));
- }
- if (!event.isUnclaimed) {
- contributions.push(...scoreEmail(event, signals));
- const emailDomain = extractEmailDomain(event.email);
- if (isNicheEmailDomain(emailDomain)) {
- contributions.push(...scoreEmailDomain(signals, emailDomain));
- }
- }
- contributions.push(...scoreUserAgent(signals));
- if (!trustedCommercialPrivacy) {
- contributions.push(...scoreGeoLocale(signals));
- }
- contributions.push(...scoreTiming(signals));
- if (!trustedCommercialPrivacy) {
- contributions = applySharedConnectionDampener(contributions, signals);
- }
- return contributions;
-}
-
-function scoreToLevel(score: number): RiskLevel {
- if (score >= THRESHOLD_VERY_HIGH) return RiskLevel.VeryHigh;
- if (score >= THRESHOLD_HIGH) return RiskLevel.High;
- if (score >= THRESHOLD_MEDIUM) return RiskLevel.Medium;
- return RiskLevel.Low;
-}
-
-function levelToAction(level: RiskLevel): RecommendedAction {
- switch (level) {
- case RiskLevel.VeryHigh:
- return RecommendedAction.RequireInboundPhone;
- case RiskLevel.High:
- return RecommendedAction.RequireOutboundPhone;
- case RiskLevel.Medium:
- return RecommendedAction.RequireVerifiedEmail;
- case RiskLevel.Low:
- return RecommendedAction.Allow;
- }
-}
-
-function deriveConfidence(score: number, contributionCount: number): RiskConfidence {
- if (contributionCount === 0) {
- return RiskConfidence.High;
- }
- if (
- contributionCount >= CONFIDENCE_MIN_CONTRIBUTIONS_HIGH &&
- (score >= THRESHOLD_HIGH || score < THRESHOLD_MEDIUM - CONFIDENCE_LOW_SCORE_MARGIN)
- ) {
- return RiskConfidence.High;
- }
- if (contributionCount >= CONFIDENCE_MIN_CONTRIBUTIONS_MEDIUM) return RiskConfidence.Medium;
- return RiskConfidence.Low;
-}
-
-export class DeterministicRiskEngine {
- private readonly toolbox: RiskToolbox;
- private readonly config: DeterministicRiskEngineConfig;
-
- constructor(toolbox: RiskToolbox, configOverrides: Partial<DeterministicRiskEngineConfig> = {}) {
- this.toolbox = toolbox;
- this.config = {...DEFAULT_CONFIG, ...configOverrides};
- }
-
- async classify(event: RegistrationEvent): Promise<RiskAssessment> {
- const startedAt = Date.now();
- const signals = await this.collectSignals(event);
- const contributions = collectContributions(event, signals);
- let rawScore = 0;
- for (const c of contributions) rawScore += c.points;
- const score = clamp(Math.round(rawScore), 0, 100);
- let level = scoreToLevel(score);
- const floorTrigger = contributions.find((c) => c.flags?.floorsToHigh === true);
- if (floorTrigger && (level === RiskLevel.Low || level === RiskLevel.Medium)) {
- level = RiskLevel.High;
- contributions.push({
- rule: RULE.policyResidentialProxyFloor,
- points: 0,
- reason: `policy: ${floorTrigger.reason} — floor raised to High`,
- });
- }
- const action = levelToAction(level);
- const elapsedMs = Date.now() - startedAt;
- const reasoning = contributions.map((c) => c.reason).join('; ');
- this.config.logger.info(
- {
- ip: event.ip,
- email: event.email,
- score,
- level,
- elapsedMs,
- contributionCount: contributions.length,
- contributions: contributions.map((c) => ({rule: c.rule, points: c.points})),
- },
- 'DeterministicRiskEngine: classification complete',
- );
- return {
- suspicious: level !== RiskLevel.Low,
- level,
- confidence: deriveConfidence(score, contributions.length),
- riskScore: score,
- reasoning,
- recommendedAction: action,
- method: RiskDecisionMethod.Deterministic,
- modelUsed: ENGINE_NAME,
- rounds: 0,
- elapsedMs,
- signals,
- };
- }
-
- private async collectSignals(event: RegistrationEvent): Promise<RiskSignals> {
- const {logger} = this.config;
- const toolbox = this.toolbox;
- const ip = event.ip;
- const emailDomain = extractEmailDomain(event.email);
- const nicheDomain: string | null = isNicheEmailDomain(emailDomain) ? emailDomain : null;
- const plusAddressBase = derivePlusAddressBase(event.email);
- const geoIpAsnP = settled(toolbox.lookupGeoIpAsn({ip}), logger, 'geoIpAsn');
- const geoIpCityP = settled(toolbox.lookupGeoIpCity({ip}), logger, 'geoIpCity');
- const ipInfoP = settled(toolbox.lookupIpInfo({ip}), logger, 'ipInfoAnonymous');
- const userAgentP = settled(
- event.userAgent ? toolbox.analyzeUserAgent({userAgent: event.userAgent}) : null,
- logger,
- 'userAgent',
- );
- const emailSyntaxP = settled(
- event.email ? toolbox.analyzeEmailSyntax({email: event.email}) : null,
- logger,
- 'emailSyntax',
- );
- const domainDisposableP = settled(
- nicheDomain ? toolbox.checkDomainDisposable({domain: nicheDomain}) : null,
- logger,
- 'domainDisposable',
- );
- const registrationsByIpP = settled(
- toolbox.getRegistrationsByIp({ip, windowHours: 24}),
- logger,
- 'registrationsByIp',
- );
- const suspiciousIpP = settled(toolbox.getSuspiciousIp({ip}), logger, 'suspiciousIp');
- const registrationsBySubnetP = settled(
- toolbox.getRegistrationsBySubnet({ip, windowHours: 24}),
- logger,
- 'registrationsBySubnet',
- );
- const historicalOutcomesByIpP = settled(
- toolbox.getHistoricalOutcomesByIp({ip, windowHours: 24}),
- logger,
- 'historicalOutcomesByIp',
- );
- const historicalOutcomesBySubnetP = settled(
- toolbox.getHistoricalOutcomesBySubnet({ip, windowHours: 24}),
- logger,
- 'historicalOutcomesBySubnet',
- );
- const frequentAbuserByIpP = settled(
- toolbox.getHistoricalOutcomesByIp({ip, windowHours: FREQUENT_ABUSER_WINDOW_HOURS}),
- logger,
- 'frequentAbuserByIp',
- );
- const frequentAbuserBySubnetP = settled(
- toolbox.getHistoricalOutcomesBySubnet({ip, windowHours: FREQUENT_ABUSER_WINDOW_HOURS}),
- logger,
- 'frequentAbuserBySubnet',
- );
- const reverseDnsP = settled(toolbox.lookupReverseDns({ip}), logger, 'reverseDns');
- const registrationsByEmailDomainP = settled(
- nicheDomain ? toolbox.getRegistrationsByEmailDomain({domain: nicheDomain, windowHours: 168}) : null,
- logger,
- 'registrationsByEmailDomain',
- );
- const registrationsByPlusAddressBaseP = settled(
- plusAddressBase ? toolbox.getRegistrationsByPlusAddressBase({plusAddressBase, windowHours: 720}) : null,
- logger,
- 'registrationsByPlusAddressBase',
- );
- const historicalOutcomesByEmailDomainP = settled(
- nicheDomain ? toolbox.getHistoricalOutcomesByEmailDomain({domain: nicheDomain, windowHours: 168}) : null,
- logger,
- 'historicalOutcomesByEmailDomain',
- );
- const domainMxP = settled(nicheDomain ? toolbox.checkMx({domain: nicheDomain}) : null, logger, 'domainMx');
- const domainAgeP = settled(nicheDomain ? toolbox.checkDomainAge({domain: nicheDomain}) : null, logger, 'domainAge');
- const registrationTimingP = settled(
- event.timezone ? toolbox.analyzeRegistrationTiming({timezone: event.timezone}) : null,
- logger,
- 'registrationTiming',
- );
- const historicalOutcomesByAsnP = geoIpAsnP.then((asn) =>
- settled(
- asn?.asn != null ? toolbox.getHistoricalOutcomesByAsn({asn: asn.asn, windowHours: 24}) : null,
- logger,
- 'historicalOutcomesByAsn',
- ),
- );
- const localeGeoMatchP = geoIpCityP.then((city) =>
- settled(
- city?.countryIso
- ? toolbox.checkGeoVsLocale({
- geoipCountryIso: city.countryIso,
- registrationLocale: event.locale,
- registrationTimezone: event.timezone,
- })
- : null,
- logger,
- 'localeGeoMatch',
- ),
- );
- return {
- geoIpAsn: await geoIpAsnP,
- geoIpCity: await geoIpCityP,
- ipInfoAnonymous: await ipInfoP,
- userAgent: await userAgentP,
- emailSyntax: await emailSyntaxP,
- domainDisposable: await domainDisposableP,
- suspiciousIp: await suspiciousIpP,
- registrationsByIp: await registrationsByIpP,
- registrationsBySubnet: await registrationsBySubnetP,
- historicalOutcomesByIp: await historicalOutcomesByIpP,
- historicalOutcomesBySubnet: await historicalOutcomesBySubnetP,
- registrationsByEmailDomain: await registrationsByEmailDomainP,
- registrationsByPlusAddressBase: await registrationsByPlusAddressBaseP,
- historicalOutcomesByEmailDomain: await historicalOutcomesByEmailDomainP,
- domainMx: await domainMxP,
- domainAge: await domainAgeP,
- registrationTiming: await registrationTimingP,
- historicalOutcomesByAsn: await historicalOutcomesByAsnP,
- localeGeoMatch: await localeGeoMatchP,
- frequentAbuserByIp: await frequentAbuserByIpP,
- frequentAbuserBySubnet: await frequentAbuserBySubnetP,
- reverseDns: await reverseDnsP,
- };
- }
-}
diff --git a/fluxer_api/src/api/risk/HistoricalOutcomeRepository.ts b/fluxer_api/src/api/risk/HistoricalOutcomeRepository.ts
deleted file mode 100644
index 651257329..000000000
--- a/fluxer_api/src/api/risk/HistoricalOutcomeRepository.ts
+++ /dev/null
@@ -1,209 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createUserID, type UserID} from '@app/api/BrandedTypes';
-import {BatchBuilder, fetchMany, fetchOne, upsertOne} from '@app/api/database/CassandraQueryExecution';
-import type {
- LatestRiskContextByUserRow,
- RiskOutcomeByAsnRow,
- RiskOutcomeByEmailDomainRow,
- RiskOutcomeByIpRow,
- RiskOutcomeBySubnetRow,
-} from '@app/api/database/types/RiskTypes';
-import type {
- HistoricalOutcomeCode,
- HistoricalOutcomeRecord,
- LatestRiskContextRecord,
-} from '@app/api/risk/RiskHistoryTypes';
-import {
- LatestRiskContextByUser,
- RiskOutcomesByAsn,
- RiskOutcomesByEmailDomain,
- RiskOutcomesByIp,
- RiskOutcomesBySubnet,
-} from '@app/api/Tables';
-
-export interface IRiskHistoryRepository {
- upsertLatestContext(context: LatestRiskContextRecord): Promise<void>;
- recordOutcomeForUser(args: {
- userId: string;
- occurredAt: Date;
- source: string;
- outcomeCodes: ReadonlyArray<HistoricalOutcomeCode>;
- }): Promise<void>;
- listByIp(ip: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<HistoricalOutcomeRecord>>;
- listBySubnet(subnet: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<HistoricalOutcomeRecord>>;
- listByEmailDomain(
- emailDomain: string,
- sinceTime: Date,
- limit: number,
- ): Promise<ReadonlyArray<HistoricalOutcomeRecord>>;
- listByAsn(asn: number, sinceTime: Date, limit: number): Promise<ReadonlyArray<HistoricalOutcomeRecord>>;
-}
-
-const SELECT_LATEST_CONTEXT_BY_USER_CQL = LatestRiskContextByUser.selectCql({
- where: [LatestRiskContextByUser.where.eq('user_id')],
- limit: 1,
-});
-const SELECT_OUTCOMES_BY_IP_CQL = RiskOutcomesByIp.selectCql({
- where: [RiskOutcomesByIp.where.eq('ip'), RiskOutcomesByIp.where.gte('created_at')],
- limit: 200,
-});
-const SELECT_OUTCOMES_BY_SUBNET_CQL = RiskOutcomesBySubnet.selectCql({
- where: [RiskOutcomesBySubnet.where.eq('subnet'), RiskOutcomesBySubnet.where.gte('created_at')],
- limit: 200,
-});
-const SELECT_OUTCOMES_BY_EMAIL_DOMAIN_CQL = RiskOutcomesByEmailDomain.selectCql({
- where: [RiskOutcomesByEmailDomain.where.eq('email_domain'), RiskOutcomesByEmailDomain.where.gte('created_at')],
- limit: 200,
-});
-const SELECT_OUTCOMES_BY_ASN_CQL = RiskOutcomesByAsn.selectCql({
- where: [RiskOutcomesByAsn.where.eq('asn'), RiskOutcomesByAsn.where.gte('created_at')],
- limit: 200,
-});
-
-export class CassandraHistoricalOutcomeRepository implements IRiskHistoryRepository {
- async upsertLatestContext(context: LatestRiskContextRecord): Promise<void> {
- await upsertOne(
- LatestRiskContextByUser.insert({
- user_id: createUserID(BigInt(context.userId)),
- updated_at: context.updatedAt,
- ip: context.ip,
- subnet: context.subnet,
- email_domain: context.emailDomain,
- asn: context.asn,
- }),
- );
- }
-
- async recordOutcomeForUser(args: {
- userId: string;
- occurredAt: Date;
- source: string;
- outcomeCodes: ReadonlyArray<HistoricalOutcomeCode>;
- }): Promise<void> {
- const latestContext = await this.getLatestContextByUserId(args.userId);
- if (!latestContext) {
- return;
- }
- const normalizedOutcomeCodes = Array.from(
- new Set(args.outcomeCodes.filter((outcomeCode) => outcomeCode.length > 0)),
- );
- if (normalizedOutcomeCodes.length === 0) {
- return;
- }
- const userId = createUserID(BigInt(args.userId));
- const batch = new BatchBuilder();
- for (const outcomeCode of normalizedOutcomeCodes) {
- batch.addPrepared(
- RiskOutcomesByIp.insert({
- ip: latestContext.ip,
- created_at: args.occurredAt,
- user_id: userId,
- outcome_code: outcomeCode,
- source: args.source,
- }),
- );
- if (latestContext.subnet) {
- batch.addPrepared(
- RiskOutcomesBySubnet.insert({
- subnet: latestContext.subnet,
- created_at: args.occurredAt,
- user_id: userId,
- outcome_code: outcomeCode,
- source: args.source,
- }),
- );
- }
- if (latestContext.emailDomain) {
- batch.addPrepared(
- RiskOutcomesByEmailDomain.insert({
- email_domain: latestContext.emailDomain,
- created_at: args.occurredAt,
- user_id: userId,
- outcome_code: outcomeCode,
- source: args.source,
- }),
- );
- }
- if (latestContext.asn !== null) {
- batch.addPrepared(
- RiskOutcomesByAsn.insert({
- asn: latestContext.asn,
- created_at: args.occurredAt,
- user_id: userId,
- outcome_code: outcomeCode,
- source: args.source,
- }),
- );
- }
- }
- await batch.execute(false);
- }
-
- async listByIp(ip: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<HistoricalOutcomeRecord>> {
- const rows = await fetchMany<RiskOutcomeByIpRow>(SELECT_OUTCOMES_BY_IP_CQL, {ip, created_at: sinceTime});
- return rows.slice(0, limit).map((row) => this.mapOutcomeRow(row));
- }
-
- async listBySubnet(subnet: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<HistoricalOutcomeRecord>> {
- const rows = await fetchMany<RiskOutcomeBySubnetRow>(SELECT_OUTCOMES_BY_SUBNET_CQL, {
- subnet,
- created_at: sinceTime,
- });
- return rows.slice(0, limit).map((row) => this.mapOutcomeRow(row));
- }
-
- async listByEmailDomain(
- emailDomain: string,
- sinceTime: Date,
- limit: number,
- ): Promise<ReadonlyArray<HistoricalOutcomeRecord>> {
- if (!emailDomain) {
- return [];
- }
- const rows = await fetchMany<RiskOutcomeByEmailDomainRow>(SELECT_OUTCOMES_BY_EMAIL_DOMAIN_CQL, {
- email_domain: emailDomain,
- created_at: sinceTime,
- });
- return rows.slice(0, limit).map((row) => this.mapOutcomeRow(row));
- }
-
- async listByAsn(asn: number, sinceTime: Date, limit: number): Promise<ReadonlyArray<HistoricalOutcomeRecord>> {
- const rows = await fetchMany<RiskOutcomeByAsnRow>(SELECT_OUTCOMES_BY_ASN_CQL, {
- asn,
- created_at: sinceTime,
- });
- return rows.slice(0, limit).map((row) => this.mapOutcomeRow(row));
- }
-
- private async getLatestContextByUserId(userId: string): Promise<LatestRiskContextRecord | null> {
- const row = await fetchOne<LatestRiskContextByUserRow>(SELECT_LATEST_CONTEXT_BY_USER_CQL, {
- user_id: createUserID(BigInt(userId)),
- });
- if (!row) {
- return null;
- }
- return {
- userId: row.user_id.toString(),
- ip: row.ip,
- subnet: row.subnet,
- emailDomain: row.email_domain,
- asn: row.asn,
- updatedAt: row.updated_at,
- };
- }
-
- private mapOutcomeRow(row: {
- user_id: UserID;
- created_at: Date;
- outcome_code: string;
- source: string;
- }): HistoricalOutcomeRecord {
- return {
- userId: row.user_id.toString(),
- createdAt: row.created_at,
- outcomeCode: row.outcome_code as HistoricalOutcomeCode,
- source: row.source,
- };
- }
-}
diff --git a/fluxer_api/src/api/risk/IpInfoBudget.ts b/fluxer_api/src/api/risk/IpInfoBudget.ts
deleted file mode 100644
index 24bc66f44..000000000
--- a/fluxer_api/src/api/risk/IpInfoBudget.ts
+++ /dev/null
@@ -1,105 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {Logger} from '@app/api/Logger';
-import type {IpInfoLookupBudget, IpInfoLookupPriority} from '@pkgs/geoip/src/IpInfoService';
-import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
-
-const BURST_KEY_PREFIX = 'ipinfo:budget:burst:';
-const MONTH_KEY_PREFIX = 'ipinfo:budget:month:';
-const MONTH_KEY_TTL_SECONDS = 40 * 24 * 3600;
-const BURST_REFILL_INTERVAL_MS = 60_000;
-const BUDGET_LOG_INTERVAL_MS = 60_000;
-
-let lastBudgetErrorLogMs = 0;
-
-function positiveNumberFromEnv(name: string, fallback: number): number {
- const raw = process.env[name];
- if (!raw) return fallback;
- const parsed = Number(raw);
- return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
-}
-
-function budgetEnabled(): boolean {
- return process.env.FLUXER_IPINFO_BUDGET_ENABLED !== '0';
-}
-
-function burstConfigFor(priority: IpInfoLookupPriority): {maxTokens: number; refillPerMin: number} {
- if (priority === 'critical') {
- return {
- maxTokens: positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_CRITICAL_BURST', 60),
- refillPerMin: positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_CRITICAL_REFILL_PER_MIN', 60),
- };
- }
- if (priority === 'background') {
- return {
- maxTokens: positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_BACKGROUND_BURST', 120),
- refillPerMin: positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_BACKGROUND_REFILL_PER_MIN', 30),
- };
- }
- return {
- maxTokens: positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_STANDARD_BURST', 240),
- refillPerMin: positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_STANDARD_REFILL_PER_MIN', 120),
- };
-}
-
-function monthlyCeilingFor(priority: IpInfoLookupPriority): number {
- const monthlyMax = positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_MONTHLY_MAX', 140000);
- if (priority === 'critical') return monthlyMax;
- const percent =
- priority === 'background'
- ? positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_BACKGROUND_MONTHLY_PCT', 60)
- : positiveNumberFromEnv('FLUXER_IPINFO_BUDGET_STANDARD_MONTHLY_PCT', 90);
- return Math.floor((monthlyMax * Math.min(percent, 100)) / 100);
-}
-
-function currentMonthKey(): string {
- const now = new Date();
- const month = String(now.getUTCMonth() + 1).padStart(2, '0');
- return `${MONTH_KEY_PREFIX}${now.getUTCFullYear()}-${month}`;
-}
-
-function logThrottled(payload: Record<string, unknown>, message: string): void {
- const now = Date.now();
- if (now - lastBudgetErrorLogMs < BUDGET_LOG_INTERVAL_MS) return;
- lastBudgetErrorLogMs = now;
- Logger.warn(payload, message);
-}
-
-export function createKvIpInfoLookupBudget(opts: {getKvClient: () => IKVProvider}): IpInfoLookupBudget {
- return {
- async tryConsume(priority: IpInfoLookupPriority): Promise<boolean> {
- if (!budgetEnabled()) {
- return true;
- }
- try {
- const kv = opts.getKvClient();
- const burst = burstConfigFor(priority);
- const consumed = await kv.tryConsumeTokens(
- `${BURST_KEY_PREFIX}${priority}`,
- 1,
- burst.maxTokens,
- burst.refillPerMin,
- BURST_REFILL_INTERVAL_MS,
- );
- if (consumed < 1) {
- logThrottled({priority, reason: 'burst'}, 'IPInfo lookup budget shed');
- return false;
- }
- const monthKey = currentMonthKey();
- const used = Number((await kv.get(monthKey)) ?? '0');
- if (used >= monthlyCeilingFor(priority)) {
- logThrottled({priority, reason: 'monthly', used}, 'IPInfo lookup budget shed');
- return false;
- }
- const value = await kv.incr(monthKey);
- if (value === 1) {
- await kv.expire(monthKey, MONTH_KEY_TTL_SECONDS);
- }
- return true;
- } catch (error) {
- logThrottled({error, priority}, 'IPInfo lookup budget check failed, admitting lookup');
- return true;
- }
- },
- };
-}
diff --git a/fluxer_api/src/api/risk/MajorEmailProviders.ts b/fluxer_api/src/api/risk/MajorEmailProviders.ts
deleted file mode 100644
index ebb67eed9..000000000
--- a/fluxer_api/src/api/risk/MajorEmailProviders.ts
+++ /dev/null
@@ -1,624 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-const MAJOR_EMAIL_PROVIDERS: ReadonlySet<string> = new Set([
- 'gmail.com',
- 'googlemail.com',
- 'outlook.com',
- 'outlook.co.uk',
- 'outlook.co.nz',
- 'outlook.co.id',
- 'outlook.com.au',
- 'outlook.com.ar',
- 'outlook.com.br',
- 'outlook.com.tr',
- 'outlook.com.vn',
- 'outlook.com.gr',
- 'outlook.fr',
- 'outlook.de',
- 'outlook.it',
- 'outlook.es',
- 'outlook.pt',
- 'outlook.nl',
- 'outlook.be',
- 'outlook.at',
- 'outlook.ch',
- 'outlook.cl',
- 'outlook.cz',
- 'outlook.dk',
- 'outlook.fi',
- 'outlook.hu',
- 'outlook.ie',
- 'outlook.in',
- 'outlook.jp',
- 'outlook.kr',
- 'outlook.lv',
- 'outlook.my',
- 'outlook.ph',
- 'outlook.ru',
- 'outlook.sa',
- 'outlook.sg',
- 'outlook.sk',
- 'hotmail.com',
- 'hotmail.co.uk',
- 'hotmail.co.il',
- 'hotmail.co.jp',
- 'hotmail.co.kr',
- 'hotmail.co.nz',
- 'hotmail.co.th',
- 'hotmail.co.za',
- 'hotmail.co.id',
- 'hotmail.com.ar',
- 'hotmail.com.au',
- 'hotmail.com.br',
- 'hotmail.com.hk',
- 'hotmail.com.mx',
- 'hotmail.com.sg',
- 'hotmail.com.tr',
- 'hotmail.com.tw',
- 'hotmail.com.vn',
- 'hotmail.fr',
- 'hotmail.de',
- 'hotmail.it',
- 'hotmail.es',
- 'hotmail.nl',
- 'hotmail.be',
- 'hotmail.ch',
- 'hotmail.at',
- 'hotmail.se',
- 'hotmail.no',
- 'hotmail.dk',
- 'hotmail.fi',
- 'hotmail.ca',
- 'hotmail.ru',
- 'hotmail.ph',
- 'hotmail.my',
- 'hotmail.kg',
- 'hotmail.lt',
- 'hotmail.bg',
- 'hotmail.cz',
- 'hotmail.hu',
- 'hotmail.gr',
- 'hotmail.sk',
- 'hotmail.ee',
- 'hotmail.lv',
- 'hotmail.ro',
- 'hotmail.rs',
- 'hotmail.hr',
- 'hotmail.sg',
- 'live.com',
- 'live.co.uk',
- 'live.co.kr',
- 'live.co.za',
- 'live.ca',
- 'live.cn',
- 'live.cl',
- 'live.com.ar',
- 'live.com.au',
- 'live.com.mx',
- 'live.com.my',
- 'live.com.pt',
- 'live.com.sg',
- 'live.fr',
- 'live.de',
- 'live.it',
- 'live.es',
- 'live.nl',
- 'live.be',
- 'live.at',
- 'live.se',
- 'live.no',
- 'live.dk',
- 'live.fi',
- 'live.ie',
- 'live.in',
- 'live.jp',
- 'live.ru',
- 'live.hk',
- 'livemail.tw',
- 'msn.com',
- 'msn.co.uk',
- 'msn.ca',
- 'msn.com.br',
- 'msn.com.au',
- 'msn.com.mx',
- 'msn.com.sg',
- 'msn.fr',
- 'msn.de',
- 'msn.it',
- 'msn.es',
- 'msn.nl',
- 'msn.at',
- 'msn.se',
- 'msn.no',
- 'msn.dk',
- 'msn.fi',
- 'msn.net',
- 'windowslive.com',
- 'passport.com',
- 'passport.net',
- 'yahoo.com',
- 'yahoo.co.uk',
- 'yahoo.co.jp',
- 'yahoo.co.nz',
- 'yahoo.co.in',
- 'yahoo.co.id',
- 'yahoo.co.th',
- 'yahoo.co.kr',
- 'yahoo.co.za',
- 'yahoo.com.ar',
- 'yahoo.com.au',
- 'yahoo.com.br',
- 'yahoo.com.hk',
- 'yahoo.com.mx',
- 'yahoo.com.my',
- 'yahoo.com.ph',
- 'yahoo.com.sa',
- 'yahoo.com.sg',
- 'yahoo.com.tr',
- 'yahoo.com.tw',
- 'yahoo.com.ua',
- 'yahoo.com.vn',
- 'yahoo.fr',
- 'yahoo.de',
- 'yahoo.it',
- 'yahoo.es',
- 'yahoo.nl',
- 'yahoo.be',
- 'yahoo.at',
- 'yahoo.ch',
- 'yahoo.se',
- 'yahoo.no',
- 'yahoo.dk',
- 'yahoo.fi',
- 'yahoo.ie',
- 'yahoo.pl',
- 'yahoo.pt',
- 'yahoo.cz',
- 'yahoo.hu',
- 'yahoo.ro',
- 'yahoo.gr',
- 'yahoo.ca',
- 'yahoo.ua',
- 'ymail.com',
- 'ymail.co.uk',
- 'rocketmail.com',
- 'myyahoo.com',
- 'y7mail.com',
- 'yahoomail.com',
- 'icloud.com',
- 'me.com',
- 'mac.com',
- 'hidden.icloud.com',
- 'aol.com',
- 'aim.com',
- 'aol.co.uk',
- 'aol.de',
- 'aol.fr',
- 'aol.it',
- 'aol.es',
- 'aol.jp',
- 'love.com',
- 'games.com',
- 'wow.com',
- 'ygm.com',
- 'netscape.net',
- 'netscape.com',
- 'compuserve.com',
- 'cs.com',
- 'protonmail.com',
- 'protonmail.ch',
- 'proton.me',
- 'pm.me',
- 'tutanota.com',
- 'tutanota.de',
- 'tutamail.com',
- 'tuta.io',
- 'tuta.com',
- 'fastmail.com',
- 'fastmail.fm',
- 'fastmail.us',
- 'fastmail.to',
- 'fastmail.co.uk',
- 'fastmail.net',
- 'fastmail.jp',
- 'fastmail.dev',
- 'hushmail.com',
- 'hush.com',
- 'hush.ai',
- 'mac.hush.com',
- 'mailfence.com',
- 'startmail.com',
- 'mailbox.org',
- 'mailo.com',
- 'posteo.de',
- 'posteo.net',
- 'runbox.com',
- 'countermail.com',
- 'kolabnow.com',
- 'disroot.org',
- 'riseup.net',
- 'autistici.org',
- 'ctemplar.com',
- 'cock.li',
- 'mail.com',
- 'email.com',
- 'zoho.com',
- 'zohomail.com',
- 'zoho.eu',
- 'zoho.in',
- 'inbox.com',
- 'gmx.com',
- 'gmx.us',
- 'gmx.co.uk',
- 'gmx.fr',
- 'gmx.de',
- 'gmx.at',
- 'gmx.ch',
- 'gmx.net',
- 'mail.ru',
- 'bk.ru',
- 'list.ru',
- 'inbox.ru',
- 'internet.ru',
- 'yandex.ru',
- 'yandex.com',
- 'yandex.ua',
- 'yandex.by',
- 'yandex.kz',
- 'ya.ru',
- 'narod.ru',
- 'rambler.ru',
- 'lenta.ru',
- 'autorambler.ru',
- 'myrambler.ru',
- 'ro.ru',
- 'rambler.com',
- 'ukr.net',
- 'i.ua',
- 'meta.ua',
- 'bigmir.net',
- 'mail.ua',
- 'tut.by',
- 'mail.by',
- 'web.de',
- 't-online.de',
- 'freenet.de',
- 'arcor.de',
- 'mail.de',
- 'online.de',
- 'vodafonemail.de',
- 'tiscali.de',
- '1und1.de',
- '1und1.net',
- 'versanet.de',
- 'gmx.at',
- 'aon.at',
- 'a1.net',
- 'chello.at',
- 'bluewin.ch',
- 'sunrise.ch',
- 'hispeed.ch',
- 'swissonline.ch',
- 'laposte.net',
- 'orange.fr',
- 'wanadoo.fr',
- 'sfr.fr',
- 'free.fr',
- 'bbox.fr',
- 'neuf.fr',
- 'aliceadsl.fr',
- 'club-internet.fr',
- '9online.fr',
- 'voila.fr',
- 'numericable.fr',
- 'noos.fr',
- 'cegetel.net',
- 'skynet.be',
- 'telenet.be',
- 'proximus.be',
- 'belgacom.be',
- 'scarlet.be',
- 'pt.lu',
- 'hotmail.lu',
- 'libero.it',
- 'virgilio.it',
- 'tin.it',
- 'alice.it',
- 'tiscali.it',
- 'poste.it',
- 'tele2.it',
- 'email.it',
- 'inwind.it',
- 'iol.it',
- 'fastwebnet.it',
- 'vodafone.it',
- 'vodafoneemail.it',
- 'telefonica.net',
- 'movistar.es',
- 'ya.com',
- 'terra.es',
- 'terra.com',
- 'latinmail.com',
- 'ono.com',
- 'jazztel.com',
- 'orange.es',
- 'euskaltel.net',
- 'sapo.pt',
- 'netcabo.pt',
- 'iol.pt',
- 'clix.pt',
- 'mail.pt',
- 'net.pt',
- 'meo.pt',
- 'nos.pt',
- 'telia.com',
- 'tele2.se',
- 'bredband.net',
- 'swipnet.se',
- 'spray.se',
- 'passagen.se',
- 'home.se',
- 'online.no',
- 'c2i.net',
- 'broadpark.no',
- 'chello.no',
- 'tele.dk',
- 'post.tele.dk',
- 'mail.dk',
- 'elisa.fi',
- 'luukku.com',
- 'suomi24.fi',
- 'saunalahti.fi',
- 'kolumbus.fi',
- 'hetnet.nl',
- 'home.nl',
- 'ziggo.nl',
- 'xs4all.nl',
- 'quicknet.nl',
- 'kpn.nl',
- 'kpnmail.nl',
- 'casema.nl',
- 'planet.nl',
- 'chello.nl',
- 'online.nl',
- 'wanadoo.nl',
- 'btinternet.com',
- 'tiscali.co.uk',
- 'talktalk.net',
- 'talktalk.co.uk',
- 'plus.net',
- 'plusnet.com',
- 'virginmedia.com',
- 'ntlworld.com',
- 'blueyonder.co.uk',
- 'sky.com',
- 'virgin.net',
- 'madasafish.com',
- 'f2s.com',
- 'fsnet.co.uk',
- 'freeserve.co.uk',
- 'supanet.com',
- 'pipex.co.uk',
- 'btconnect.com',
- 'btopenworld.com',
- 'eircom.net',
- 'eir.ie',
- 'iol.ie',
- 'indigo.ie',
- 'vodafone.ie',
- 'rogers.com',
- 'rogers.ca',
- 'sympatico.ca',
- 'videotron.ca',
- 'bell.net',
- 'bell.ca',
- 'shaw.ca',
- 'telus.net',
- 'telus.com',
- 'cogeco.ca',
- 'eastlink.ca',
- 'nbnet.nb.ca',
- 'mts.net',
- 'sasktel.net',
- 'verizon.net',
- 'att.net',
- 'sbcglobal.net',
- 'bellsouth.net',
- 'comcast.net',
- 'cox.net',
- 'charter.net',
- 'rr.com',
- 'roadrunner.com',
- 'twc.com',
- 'earthlink.net',
- 'juno.com',
- 'netzero.net',
- 'netzero.com',
- 'frontier.com',
- 'frontiernet.net',
- 'centurylink.net',
- 'centurylink.com',
- 'windstream.net',
- 'mediacombb.net',
- 'mediacomcable.com',
- 'optonline.net',
- 'optimum.net',
- 'suddenlink.net',
- 'usa.net',
- 'excite.com',
- 'embarqmail.com',
- 'prodigy.net',
- 'swbell.net',
- 'pacbell.net',
- 'ameritech.net',
- 'bellatlantic.net',
- 'nycap.rr.com',
- 'qq.com',
- 'foxmail.com',
- 'vip.qq.com',
- '163.com',
- '126.com',
- 'yeah.net',
- 'vip.163.com',
- 'vip.126.com',
- 'sina.com',
- 'sina.cn',
- 'sina.com.cn',
- 'vip.sina.com',
- 'sohu.com',
- 'vip.sohu.com',
- 'sogou.com',
- 'aliyun.com',
- '139.com',
- '189.cn',
- '188.com',
- '21cn.com',
- 'wo.cn',
- 'wo.com.cn',
- 'tom.com',
- '263.net',
- 'chinaren.com',
- 'netvigator.com',
- 'biznetvigator.com',
- 'pccw.com',
- 'pchome.com.tw',
- 'url.com.tw',
- 'hinet.net',
- 'seed.net.tw',
- 'docomo.ne.jp',
- 'ezweb.ne.jp',
- 'softbank.ne.jp',
- 'i.softbank.jp',
- 'vodafone.ne.jp',
- 'au.com',
- 'au.jp',
- 'nifty.com',
- 'nifty.ne.jp',
- 'ybb.ne.jp',
- 'ocn.ne.jp',
- 'plala.or.jp',
- 'biglobe.ne.jp',
- 'so-net.ne.jp',
- 'dion.ne.jp',
- 'infoseek.jp',
- 'excite.co.jp',
- 'goo.ne.jp',
- 'asahi.net',
- 'gol.com',
- 'ff.iij4u.or.jp',
- 'naver.com',
- 'daum.net',
- 'hanmail.net',
- 'kakao.com',
- 'nate.com',
- 'lycos.co.kr',
- 'korea.com',
- 'empal.com',
- 'hanafos.com',
- 'netsgo.com',
- 'chollian.net',
- 'freechal.com',
- 'rediffmail.com',
- 'rediff.com',
- 'in.com',
- 'indiatimes.com',
- 'sify.com',
- 'vsnl.net',
- 'vsnl.com',
- 'vsnl.in',
- 'vsnl.net.in',
- 'airtelmail.in',
- 'airtel.in',
- 'bsnl.in',
- 'bsnl.co.in',
- 'bsnl.net.in',
- 'singnet.com.sg',
- 'pacific.net.sg',
- 'starhub.com.sg',
- 'tm.net.my',
- 'streamyx.com.my',
- 'unifi.com.my',
- 'po.jaring.my',
- 'pldt.net.ph',
- 'smartbro.net',
- 'smart.com.ph',
- 'globe.com.ph',
- 'loxinfo.co.th',
- 'cscoms.com',
- 'ji-net.com',
- 'fpt.vn',
- 'vnn.vn',
- 'hcm.vnn.vn',
- 'viettel.com.vn',
- 'centrin.net.id',
- 'indo.net.id',
- 'cbn.net.id',
- 'telkom.net.id',
- 'xtra.co.nz',
- 'clear.net.nz',
- 'paradise.net.nz',
- 'vodafone.co.nz',
- 'bigpond.com',
- 'bigpond.com.au',
- 'bigpond.net.au',
- 'optusnet.com.au',
- 'iinet.net.au',
- 'tpg.com.au',
- 'internode.on.net',
- 'westnet.com.au',
- 'terra.com.br',
- 'uol.com.br',
- 'bol.com.br',
- 'ig.com.br',
- 'zipmail.com.br',
- 'globo.com',
- 'globomail.com',
- 'ibest.com.br',
- 'click21.com.br',
- 'gbr.com.br',
- 'oi.com.br',
- 'pop.com.br',
- 'speedy.com.ar',
- 'fibertel.com.ar',
- 'arnet.com.ar',
- 'prodigy.net.mx',
- 'terra.com.mx',
- 'axtel.net',
- 'cablevision.net.mx',
- 'tvcable.net.co',
- 'walla.co.il',
- 'walla.com',
- '013.net.il',
- '012.net.il',
- 'netvision.net.il',
- 'bezeqint.net',
- 'barak.net.il',
- 'ttnet.com.tr',
- 'superonline.com',
- 'turk.net',
- 'mynet.com',
- 'etisalat.ae',
- 'eim.ae',
- 'emirates.net.ae',
- 'stc.com.sa',
- 'mobily.com.sa',
- 'mweb.co.za',
- 'webmail.co.za',
- 'iafrica.com',
- 'vodamail.co.za',
- 'absamail.co.za',
- 'telkomsa.net',
- 'lycos.com',
- 'excite.com',
- 'tripod.com',
- 'angelfire.com',
- 'dnsmadeeasy.com',
- 'contact.net',
- 'hubpages.com',
- 'mailnesia.com',
-]);
-
-export function isMajorEmailProvider(domain: string | null | undefined): boolean {
- if (!domain) return false;
- return MAJOR_EMAIL_PROVIDERS.has(domain.trim().toLowerCase());
-}
diff --git a/fluxer_api/src/api/risk/PlusAddressUtils.ts b/fluxer_api/src/api/risk/PlusAddressUtils.ts
deleted file mode 100644
index 9c1f1f8f7..000000000
--- a/fluxer_api/src/api/risk/PlusAddressUtils.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-export function derivePlusAddressBase(email: string | null | undefined): string | null {
- if (!email) {
- return null;
- }
- const trimmed = email.trim().toLowerCase();
- const atIndex = trimmed.lastIndexOf('@');
- if (atIndex <= 0 || atIndex === trimmed.length - 1) {
- return null;
- }
- const localPart = trimmed.slice(0, atIndex);
- const domain = trimmed.slice(atIndex + 1);
- const plusIndex = localPart.indexOf('+');
- if (plusIndex <= 0) {
- return null;
- }
- return `${localPart.slice(0, plusIndex)}@${domain}`;
-}
diff --git a/fluxer_api/src/api/risk/RegistrationEventsRepository.ts b/fluxer_api/src/api/risk/RegistrationEventsRepository.ts
deleted file mode 100644
index a1e99c87c..000000000
--- a/fluxer_api/src/api/risk/RegistrationEventsRepository.ts
+++ /dev/null
@@ -1,173 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createUserID} from '@app/api/BrandedTypes';
-import {BatchBuilder, fetchMany} from '@app/api/database/CassandraQueryExecution';
-import type {
- RegistrationEventByEmailDomainRow,
- RegistrationEventByIpRow,
- RegistrationEventByPlusAddressBaseRow,
- RegistrationEventBySubnetRow,
-} from '@app/api/database/types/RiskTypes';
-import type {IRegistrationEventsRepository, RegistrationEventRecord} from '@app/api/risk/adapters/VelocityAdapter';
-import {derivePlusAddressBase} from '@app/api/risk/PlusAddressUtils';
-import {
- RegistrationEventsByEmailDomain,
- RegistrationEventsByIp,
- RegistrationEventsByPlusAddressBase,
- RegistrationEventsBySubnet,
-} from '@app/api/Tables';
-import {getSubnet} from '@fluxer/ip_utils/src/IpAddress';
-
-const SELECT_BY_IP_CQL = RegistrationEventsByIp.selectCql({
- where: [RegistrationEventsByIp.where.eq('ip'), RegistrationEventsByIp.where.gte('created_at')],
- limit: 100,
-});
-const SELECT_BY_SUBNET_CQL = RegistrationEventsBySubnet.selectCql({
- where: [RegistrationEventsBySubnet.where.eq('subnet'), RegistrationEventsBySubnet.where.gte('created_at')],
- limit: 100,
-});
-const SELECT_BY_EMAIL_DOMAIN_CQL = RegistrationEventsByEmailDomain.selectCql({
- where: [
- RegistrationEventsByEmailDomain.where.eq('email_domain'),
- RegistrationEventsByEmailDomain.where.gte('created_at'),
- ],
- limit: 100,
-});
-const SELECT_BY_PLUS_ADDRESS_BASE_CQL = RegistrationEventsByPlusAddressBase.selectCql({
- where: [
- RegistrationEventsByPlusAddressBase.where.eq('plus_address_base'),
- RegistrationEventsByPlusAddressBase.where.gte('created_at'),
- ],
- limit: 100,
-});
-
-export class CassandraRegistrationEventsRepository implements IRegistrationEventsRepository {
- async recordEvent(event: RegistrationEventRecord): Promise<void> {
- const subnet = getSubnet(event.ip);
- const userId = createUserID(BigInt(event.userId));
- const email = event.email ?? null;
- const emailDomain = event.emailDomain ?? null;
- const plusAddressBase = derivePlusAddressBase(email);
- const locale = event.locale ?? null;
- const batch = new BatchBuilder();
- batch.addPrepared(
- RegistrationEventsByIp.insert({
- ip: event.ip,
- created_at: event.createdAt,
- user_id: userId,
- email,
- email_domain: emailDomain,
- locale,
- }),
- );
- if (emailDomain) {
- batch.addPrepared(
- RegistrationEventsByEmailDomain.insert({
- email_domain: emailDomain,
- created_at: event.createdAt,
- user_id: userId,
- ip: event.ip,
- email,
- locale,
- }),
- );
- }
- if (plusAddressBase) {
- batch.addPrepared(
- RegistrationEventsByPlusAddressBase.insert({
- plus_address_base: plusAddressBase,
- created_at: event.createdAt,
- user_id: userId,
- ip: event.ip,
- email,
- locale,
- }),
- );
- }
- if (subnet) {
- batch.addPrepared(
- RegistrationEventsBySubnet.insert({
- subnet,
- created_at: event.createdAt,
- user_id: userId,
- ip: event.ip,
- email,
- email_domain: emailDomain,
- locale,
- }),
- );
- }
- await batch.execute(false);
- }
-
- async listByIp(ip: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<RegistrationEventRecord>> {
- const rows = await fetchMany<RegistrationEventByIpRow>(SELECT_BY_IP_CQL, {ip, created_at: sinceTime});
- return rows.slice(0, limit).map(this.rowToRecord);
- }
-
- async listBySubnet(subnet: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<RegistrationEventRecord>> {
- const rows = await fetchMany<RegistrationEventBySubnetRow>(SELECT_BY_SUBNET_CQL, {
- subnet,
- created_at: sinceTime,
- });
- return rows.slice(0, limit).map((row) => ({
- userId: row.user_id.toString(),
- email: row.email,
- emailDomain: row.email_domain,
- ip: row.ip,
- locale: row.locale,
- createdAt: row.created_at,
- }));
- }
-
- async listByEmailDomain(
- emailDomain: string,
- sinceTime: Date,
- limit: number,
- ): Promise<ReadonlyArray<RegistrationEventRecord>> {
- if (!emailDomain) return [];
- const rows = await fetchMany<RegistrationEventByEmailDomainRow>(SELECT_BY_EMAIL_DOMAIN_CQL, {
- email_domain: emailDomain,
- created_at: sinceTime,
- });
- return rows.slice(0, limit).map((row) => ({
- userId: row.user_id.toString(),
- email: row.email,
- emailDomain: row.email_domain,
- ip: row.ip,
- locale: row.locale,
- createdAt: row.created_at,
- }));
- }
-
- async listByPlusAddressBase(
- plusAddressBase: string,
- sinceTime: Date,
- limit: number,
- ): Promise<ReadonlyArray<RegistrationEventRecord>> {
- if (!plusAddressBase) return [];
- const rows = await fetchMany<RegistrationEventByPlusAddressBaseRow>(SELECT_BY_PLUS_ADDRESS_BASE_CQL, {
- plus_address_base: plusAddressBase,
- created_at: sinceTime,
- });
- return rows.slice(0, limit).map((row) => ({
- userId: row.user_id.toString(),
- email: row.email,
- emailDomain: row.email?.split('@')[1]?.toLowerCase() ?? null,
- ip: row.ip,
- locale: row.locale,
- createdAt: row.created_at,
- }));
- }
-
- private rowToRecord(row: RegistrationEventByIpRow): RegistrationEventRecord {
- return {
- userId: row.user_id.toString(),
- email: row.email,
- emailDomain: row.email_domain,
- ip: row.ip,
- locale: row.locale,
- createdAt: row.created_at,
- };
- }
-}
diff --git a/fluxer_api/src/api/risk/RegistrationIpPrescreen.ts b/fluxer_api/src/api/risk/RegistrationIpPrescreen.ts
deleted file mode 100644
index bc7100d18..000000000
--- a/fluxer_api/src/api/risk/RegistrationIpPrescreen.ts
+++ /dev/null
@@ -1,60 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- classifyAccountPolicyReverseDnsHostname,
- isAccountPolicyEducationOrganizationName,
- isAccountPolicyTrustedCommercialPrivacyProvider,
-} from '@app/api/risk/AccountPolicyService';
-
-const ASN_ENTRY_REGEX = /^\d+$/u;
-
-export interface LocalIpIntel {
- countryIso: string | null;
- asn: number | null;
- asnOrg: string | null;
-}
-
-export interface IpInfoPrescreenOptions {
- enabled: boolean;
- allowedAsns: ReadonlySet<number>;
-}
-
-export type IpInfoPrescreenVerdict = 'consult' | 'skip';
-
-export function prescreenIpInfoLookup(local: LocalIpIntel, opts: IpInfoPrescreenOptions): IpInfoPrescreenVerdict {
- if (!opts.enabled) return 'consult';
- if (opts.allowedAsns.size === 0) return 'consult';
- if (local.countryIso === null) return 'consult';
- if (local.asn === null) return 'consult';
- if (!opts.allowedAsns.has(local.asn)) return 'consult';
- if (isAccountPolicyTrustedCommercialPrivacyProvider(local.asnOrg)) return 'consult';
- if (isAccountPolicyEducationOrganizationName(local.asnOrg)) return 'consult';
- if (classifyAccountPolicyReverseDnsHostname(local.asnOrg) === 'cellular') return 'consult';
- return 'skip';
-}
-
-export function ipInfoPrescreenOptionsFromEnv(): IpInfoPrescreenOptions {
- return {
- enabled: booleanFromEnv(process.env.FLUXER_RISK_IPINFO_PRESCREEN_ENABLED),
- allowedAsns: asnSetFromEnv(process.env.FLUXER_RISK_IPINFO_PRESCREEN_ALLOW_ASNS),
- };
-}
-
-function booleanFromEnv(rawValue: string | undefined): boolean {
- if (!rawValue) return false;
- const normalized = rawValue.trim().toLowerCase();
- return normalized === '1' || normalized === 'true';
-}
-
-function asnSetFromEnv(rawValue: string | undefined): ReadonlySet<number> {
- const allowedAsns = new Set<number>();
- if (!rawValue) return allowedAsns;
- for (const entry of rawValue.split(',')) {
- const trimmed = entry.trim();
- if (!ASN_ENTRY_REGEX.test(trimmed)) continue;
- const asn = Number.parseInt(trimmed, 10);
- if (!Number.isSafeInteger(asn)) continue;
- allowedAsns.add(asn);
- }
- return allowedAsns;
-}
diff --git a/fluxer_api/src/api/risk/RiskAssessmentRepository.ts b/fluxer_api/src/api/risk/RiskAssessmentRepository.ts
deleted file mode 100644
index b7b979621..000000000
--- a/fluxer_api/src/api/risk/RiskAssessmentRepository.ts
+++ /dev/null
@@ -1,61 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {randomUUID} from 'node:crypto';
-import type {UserID} from '@app/api/BrandedTypes';
-import {BatchBuilder} from '@app/api/database/CassandraQueryExecution';
-import type {RiskAssessment} from '@app/api/risk/RiskTypes';
-import {RiskAssessments, RiskAssessmentsByUser} from '@app/api/Tables';
-
-export interface IRiskAssessmentRepository {
- recordAssessment(params: {
- userId: UserID | null;
- ip: string;
- email: string | null;
- locale: string | null;
- assessment: RiskAssessment;
- }): Promise<void>;
-}
-
-export class CassandraRiskAssessmentRepository implements IRiskAssessmentRepository {
- async recordAssessment(params: {
- userId: UserID | null;
- ip: string;
- email: string | null;
- locale: string | null;
- assessment: RiskAssessment;
- }): Promise<void> {
- const assessmentId = randomUUID();
- const createdAt = new Date();
- const batch = new BatchBuilder();
- batch.addPrepared(
- RiskAssessments.insert({
- assessment_id: assessmentId,
- created_at: createdAt,
- user_id: params.userId,
- ip: params.ip,
- email: params.email,
- locale: params.locale,
- risk_level: params.assessment.level,
- risk_score: params.assessment.riskScore,
- suspicious: params.assessment.suspicious,
- method: params.assessment.method,
- model_used: params.assessment.modelUsed,
- recommended_action: params.assessment.recommendedAction,
- reasoning: params.assessment.reasoning,
- signals_json: JSON.stringify(params.assessment.signals),
- }),
- );
- if (params.userId != null) {
- batch.addPrepared(
- RiskAssessmentsByUser.insert({
- user_id: params.userId,
- created_at: createdAt,
- assessment_id: assessmentId,
- risk_level: params.assessment.level,
- risk_score: params.assessment.riskScore,
- }),
- );
- }
- await batch.execute(false);
- }
-}
diff --git a/fluxer_api/src/api/risk/RiskHistoryContext.ts b/fluxer_api/src/api/risk/RiskHistoryContext.ts
deleted file mode 100644
index 443ca9748..000000000
--- a/fluxer_api/src/api/risk/RiskHistoryContext.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {LatestRiskContextRecord} from '@app/api/risk/RiskHistoryTypes';
-import {getSubnet} from '@fluxer/ip_utils/src/IpAddress';
-
-export function deriveLatestRiskContext(params: {
- userId: string;
- email: string | null;
- clientIp: string;
- asn: number | null;
- updatedAt: Date;
-}): LatestRiskContextRecord {
- const emailDomain = params.email?.split('@')[1]?.toLowerCase() ?? null;
- return {
- userId: params.userId,
- ip: params.clientIp,
- subnet: getSubnet(params.clientIp),
- emailDomain,
- asn: params.asn,
- updatedAt: params.updatedAt,
- };
-}
diff --git a/fluxer_api/src/api/risk/RiskHistoryTypes.ts b/fluxer_api/src/api/risk/RiskHistoryTypes.ts
deleted file mode 100644
index 929563fd6..000000000
--- a/fluxer_api/src/api/risk/RiskHistoryTypes.ts
+++ /dev/null
@@ -1,19 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-export type HistoricalOutcomeCode = 'challenged' | 'spammer' | 'disabled' | 'disabled_suspicious';
-
-export interface LatestRiskContextRecord {
- userId: string;
- ip: string;
- subnet: string | null;
- emailDomain: string | null;
- asn: number | null;
- updatedAt: Date;
-}
-
-export interface HistoricalOutcomeRecord {
- userId: string;
- createdAt: Date;
- outcomeCode: HistoricalOutcomeCode;
- source: string;
-}
diff --git a/fluxer_api/src/api/risk/RiskToolbox.ts b/fluxer_api/src/api/risk/RiskToolbox.ts
deleted file mode 100644
index 3e9775921..000000000
--- a/fluxer_api/src/api/risk/RiskToolbox.ts
+++ /dev/null
@@ -1,45 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {
- DisposableCheckResult,
- DomainAgeResult,
- EmailSyntaxResult,
- GeoIpAsnResult,
- GeoIpCityResult,
- HistoricalOutcomeResult,
- IpInfoAnonymousResult,
- LocaleGeoMatchResult,
- MxCheckResult,
- RegistrationTimingResult,
- ReverseDnsResult,
- SuspiciousIpResult,
- UserAgentResult,
- VelocityResult,
-} from '@app/api/risk/RiskTypes';
-
-export interface RiskToolbox {
- analyzeEmailSyntax(args: {email: string}): Promise<EmailSyntaxResult>;
- checkDomainDisposable(args: {domain: string}): Promise<DisposableCheckResult>;
- checkMx(args: {domain: string}): Promise<MxCheckResult>;
- checkDomainAge(args: {domain: string}): Promise<DomainAgeResult>;
- lookupGeoIpCity(args: {ip: string}): Promise<GeoIpCityResult>;
- lookupGeoIpAsn(args: {ip: string}): Promise<GeoIpAsnResult>;
- lookupIpInfo(args: {ip: string}): Promise<IpInfoAnonymousResult>;
- lookupReverseDns(args: {ip: string}): Promise<ReverseDnsResult>;
- getSuspiciousIp(args: {ip: string}): Promise<SuspiciousIpResult | null>;
- getRegistrationsByIp(args: {ip: string; windowHours: number}): Promise<VelocityResult>;
- getRegistrationsBySubnet(args: {ip: string; windowHours: number}): Promise<VelocityResult>;
- getRegistrationsByEmailDomain(args: {domain: string; windowHours: number}): Promise<VelocityResult>;
- getRegistrationsByPlusAddressBase(args: {plusAddressBase: string; windowHours: number}): Promise<VelocityResult>;
- getHistoricalOutcomesByIp(args: {ip: string; windowHours: number}): Promise<HistoricalOutcomeResult>;
- getHistoricalOutcomesBySubnet(args: {ip: string; windowHours: number}): Promise<HistoricalOutcomeResult>;
- getHistoricalOutcomesByEmailDomain(args: {domain: string; windowHours: number}): Promise<HistoricalOutcomeResult>;
- getHistoricalOutcomesByAsn(args: {asn: number; windowHours: number}): Promise<HistoricalOutcomeResult>;
- checkGeoVsLocale(args: {
- geoipCountryIso: string | null;
- registrationLocale: string | null;
- registrationTimezone: string | null;
- }): Promise<LocaleGeoMatchResult>;
- analyzeUserAgent(args: {userAgent: string}): Promise<UserAgentResult>;
- analyzeRegistrationTiming(args: {timezone: string | null}): Promise<RegistrationTimingResult>;
-}
diff --git a/fluxer_api/src/api/risk/RiskToolboxFactory.ts b/fluxer_api/src/api/risk/RiskToolboxFactory.ts
deleted file mode 100644
index 9adadee2d..000000000
--- a/fluxer_api/src/api/risk/RiskToolboxFactory.ts
+++ /dev/null
@@ -1,89 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {IAdminRepository} from '@app/api/admin/IAdminRepository';
-import {createDisposableDomainChecker} from '@app/api/risk/adapters/DisposableDomainChecker';
-import {createDnsMxChecker, type MxResolver, NodeDnsMxResolver} from '@app/api/risk/adapters/DnsMxChecker';
-import {createDomainAgeChecker} from '@app/api/risk/adapters/DomainAgeChecker';
-import {analyzeEmailSyntax} from '@app/api/risk/adapters/EmailSyntaxAnalyzer';
-import {createGeoIpAsnAdapter, createGeoIpCityAdapter} from '@app/api/risk/adapters/GeoIpAdapters';
-import {createHistoricalOutcomeAdapter} from '@app/api/risk/adapters/HistoricalOutcomeAdapter';
-import {unavailableIpInfoAnonymousResult} from '@app/api/risk/adapters/IpInfoAdapter';
-import {checkGeoVsLocale} from '@app/api/risk/adapters/LocaleGeoMatcher';
-import {analyzeRegistrationTiming} from '@app/api/risk/adapters/RegistrationTimingAnalyzer';
-import {analyzeUserAgent} from '@app/api/risk/adapters/UserAgentAnalyzer';
-import {createVelocityAdapter, type IRegistrationEventsRepository} from '@app/api/risk/adapters/VelocityAdapter';
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import type {RiskToolbox} from '@app/api/risk/RiskToolbox';
-import type {IpInfoAnonymousResult, ReverseDnsResult} from '@app/api/risk/RiskTypes';
-import type {ISuspiciousIpRepository} from '@app/api/risk/SuspiciousIpRepository';
-import type {ICacheService} from '@pkgs/cache/src/ICacheService';
-import type {GeoipAsnResult, GeoipResult} from '@pkgs/geoip/src/GeoipLookup';
-import type {IpInfoService} from '@pkgs/geoip/src/IpInfoService';
-
-interface RiskToolboxFactoryOptions {
- adminRepository: Pick<IAdminRepository, 'isEmailDomainSuspicious' | 'isEmailDomainDisposable'>;
- ipInfoChecker?: (ip: string) => Promise<IpInfoAnonymousResult>;
- reverseDnsLookup?: (ip: string) => Promise<ReverseDnsResult>;
- ipInfoService: IpInfoService;
- registrationEventsRepository: IRegistrationEventsRepository;
- historicalOutcomeRepository: IRiskHistoryRepository;
- suspiciousIpRepository: ISuspiciousIpRepository;
- mxResolver?: MxResolver;
- mxCacheTtlMs?: number;
- cacheService?: ICacheService;
- lookupLocalCity?: (ip: string) => Promise<GeoipResult>;
- lookupLocalAsn?: (ip: string) => Promise<GeoipAsnResult>;
-}
-
-export function createRiskToolbox(opts: RiskToolboxFactoryOptions): RiskToolbox {
- const checkDomainDisposable = createDisposableDomainChecker({adminRepository: opts.adminRepository});
- const lookupGeoIpCity = createGeoIpCityAdapter({
- ipInfoService: opts.ipInfoService,
- lookupLocalCity: opts.lookupLocalCity,
- });
- const lookupGeoIpAsn = createGeoIpAsnAdapter({
- ipInfoService: opts.ipInfoService,
- lookupLocalAsn: opts.lookupLocalAsn,
- });
- const checkMx = createDnsMxChecker({
- resolver: opts.mxResolver ?? new NodeDnsMxResolver(),
- cacheTtlMs: opts.mxCacheTtlMs,
- });
- const checkDomainAge = createDomainAgeChecker({cacheService: opts.cacheService});
- const velocity = createVelocityAdapter({repository: opts.registrationEventsRepository});
- const historicalOutcomes = createHistoricalOutcomeAdapter({
- repository: opts.historicalOutcomeRepository,
- });
- const lookupIpInfo = opts.ipInfoChecker
- ? async (args: {ip: string}) => opts.ipInfoChecker!(args.ip)
- : async (args: {ip: string}) => unavailableIpInfoAnonymousResult(args.ip, 'IPInfo not configured (no API key)');
- const lookupReverseDns = opts.reverseDnsLookup
- ? async (args: {ip: string}) => opts.reverseDnsLookup!(args.ip)
- : async (args: {ip: string}) => ({
- ip: args.ip,
- hostname: null,
- classification: 'unknown' as const,
- });
- return {
- analyzeEmailSyntax: async (args) => analyzeEmailSyntax(args),
- checkDomainDisposable,
- checkMx,
- checkDomainAge,
- lookupGeoIpCity,
- lookupGeoIpAsn,
- lookupIpInfo,
- lookupReverseDns,
- getSuspiciousIp: async (args) => opts.suspiciousIpRepository.findActiveByIp(args.ip),
- getRegistrationsByIp: velocity.getRegistrationsByIp,
- getRegistrationsBySubnet: velocity.getRegistrationsBySubnet,
- getRegistrationsByEmailDomain: velocity.getRegistrationsByEmailDomain,
- getRegistrationsByPlusAddressBase: velocity.getRegistrationsByPlusAddressBase,
- getHistoricalOutcomesByIp: historicalOutcomes.getHistoricalOutcomesByIp,
- getHistoricalOutcomesBySubnet: historicalOutcomes.getHistoricalOutcomesBySubnet,
- getHistoricalOutcomesByEmailDomain: historicalOutcomes.getHistoricalOutcomesByEmailDomain,
- getHistoricalOutcomesByAsn: historicalOutcomes.getHistoricalOutcomesByAsn,
- checkGeoVsLocale: async (args) => checkGeoVsLocale(args),
- analyzeUserAgent: async (args) => analyzeUserAgent(args),
- analyzeRegistrationTiming: async (args) => analyzeRegistrationTiming(args),
- };
-}
diff --git a/fluxer_api/src/api/risk/RiskTypes.ts b/fluxer_api/src/api/risk/RiskTypes.ts
deleted file mode 100644
index 201800543..000000000
--- a/fluxer_api/src/api/risk/RiskTypes.ts
+++ /dev/null
@@ -1,246 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-export enum RiskLevel {
- Low = 'low',
- Medium = 'medium',
- High = 'high',
- VeryHigh = 'very_high',
-}
-
-export enum RiskConfidence {
- Low = 'low',
- Medium = 'medium',
- High = 'high',
-}
-
-export enum RiskDecisionMethod {
- Deterministic = 'deterministic',
- Noop = 'noop',
-}
-
-export interface RegistrationEvent {
- email: string | null;
- ip: string;
- locale: string | null;
- timezone: string | null;
- userAgent: string | null;
- username?: string | null;
- globalName?: string | null;
- usernameIsUserChosen?: boolean;
- isUnclaimed?: boolean;
-}
-
-export interface RiskSignals {
- emailSyntax?: EmailSyntaxResult;
- domainDisposable?: DisposableCheckResult;
- domainMx?: MxCheckResult;
- domainAge?: DomainAgeResult;
- geoIpCity?: GeoIpCityResult;
- geoIpAsn?: GeoIpAsnResult;
- ipInfoAnonymous?: IpInfoAnonymousResult;
- reverseDns?: ReverseDnsResult;
- suspiciousIp?: SuspiciousIpResult;
- registrationsByIp?: VelocityResult;
- registrationsBySubnet?: VelocityResult;
- registrationsByEmailDomain?: VelocityResult;
- registrationsByPlusAddressBase?: VelocityResult;
- historicalOutcomesByIp?: HistoricalOutcomeResult;
- historicalOutcomesBySubnet?: HistoricalOutcomeResult;
- historicalOutcomesByEmailDomain?: HistoricalOutcomeResult;
- historicalOutcomesByAsn?: HistoricalOutcomeResult;
- frequentAbuserByIp?: HistoricalOutcomeResult;
- frequentAbuserBySubnet?: HistoricalOutcomeResult;
- localeGeoMatch?: LocaleGeoMatchResult;
- userAgent?: UserAgentResult;
- registrationTiming?: RegistrationTimingResult;
-}
-
-export interface RiskAssessment {
- suspicious: boolean;
- level: RiskLevel;
- confidence: RiskConfidence;
- riskScore: number;
- reasoning: string;
- recommendedAction: RecommendedAction;
- method: RiskDecisionMethod;
- modelUsed: string;
- rounds: number;
- elapsedMs: number;
- signals: RiskSignals;
-}
-
-export enum RecommendedAction {
- Allow = 'allow',
- RequireVerifiedEmail = 'require_verified_email',
- RequireOutboundPhone = 'require_outbound_phone',
- RequireInboundPhone = 'require_inbound_phone',
- Block = 'block',
-}
-
-export interface EmailSyntaxResult {
- email: string;
- localPart: string;
- domain: string;
- localPartLength: number;
- entropy: number;
- keyboardMashDetected: boolean;
- looksLikeName: boolean;
- pronounceability: number;
- unusualRepeats: boolean;
- digitRatio: number;
- hasDots: boolean;
- hasPlusTag: boolean;
- gibberishScore: number;
- valid: boolean;
-}
-
-export interface DisposableCheckResult {
- domain: string;
- isDisposable: boolean;
-}
-
-export interface MxCheckResult {
- domain: string;
- hasMx: boolean;
- recordCount: number;
- records: ReadonlyArray<{
- priority: number;
- host: string;
- }>;
- error: string | null;
-}
-
-export interface GeoIpCityResult {
- ip: string;
- available: boolean;
- found: boolean;
- countryIso: string | null;
- country: string | null;
- region: string | null;
- city: string | null;
- latitude: number | null;
- longitude: number | null;
- accuracyRadiusKm: number | null;
- timeZone: string | null;
-}
-
-export interface GeoIpAsnResult {
- ip: string;
- available: boolean;
- found: boolean;
- asn: number | null;
- asnOrg: string | null;
-}
-
-export type IpConnectionType =
- | 'residential'
- | 'residential_proxy'
- | 'mobile'
- | 'data_center'
- | 'corporate'
- | 'education'
- | 'unknown';
-
-export interface IpInfoAnonymousResult {
- ip: string;
- available: boolean;
- isAnonymous: boolean;
- providerName: string | null;
- isVpn: boolean;
- isProxy: boolean;
- isResidentialProxy: boolean;
- isTor: boolean;
- isRelay: boolean;
- isHosting: boolean;
- isMobile: boolean;
- asnType: string | null;
- asnOrg: string | null;
- connectionType: IpConnectionType;
- percentDaysSeen: number | null;
- riskNote: string;
-}
-
-export type ReverseDnsClassification = 'dynamic' | 'static' | 'cellular' | 'business' | 'unknown';
-
-export interface ReverseDnsResult {
- ip: string;
- hostname: string | null;
- classification: ReverseDnsClassification;
-}
-
-export interface SuspiciousIpResult {
- ip: string;
- source: string;
- reason: string;
- sourceUserId: string | null;
- deletionReasonCode: number | null;
- createdAt: string;
- expiresAt: string | null;
- riskNote: string;
-}
-
-export interface VelocityResult {
- identifier: string;
- windowHours: number;
- totalRegistrations: number;
- truncated: boolean;
- uniqueEmails: number;
- uniqueLocales: ReadonlyArray<string>;
- uniqueIps: number;
- riskNote: string;
-}
-
-export interface HistoricalOutcomeResult {
- identifier: string;
- windowHours: number;
- sampledRegistrations: number;
- truncated: boolean;
- sampledUsers: number;
- resolvedUsers: number;
- adverseUsers: number;
- challengedUsers: number;
- enforcedUsers: number;
- spammerUsers: number;
- disabledUsers: number;
- disabledSuspiciousUsers: number;
- riskNote: string;
-}
-
-export interface LocaleGeoMatchResult {
- geoipCountryIso: string | null;
- registrationLocale: string | null;
- registrationTimezone: string | null;
- localeGeoMatch: boolean | null;
- timezoneGeoMatch: boolean | null;
- mismatchDetected: boolean;
- notes: ReadonlyArray<string>;
-}
-
-export interface UserAgentResult {
- raw: string;
- browser: string;
- browserVersion: string | null;
- os: string;
- isBot: boolean;
- isHeadless: boolean;
- isAutomation: boolean;
- isOutdated: boolean;
- suspiciousPatterns: ReadonlyArray<string>;
- riskNote: string;
-}
-
-export interface DomainAgeResult {
- domain: string;
- available: boolean;
- creationDate: string | null;
- ageDays: number | null;
- isNewlyRegistered: boolean;
- riskNote: string;
-}
-
-export interface RegistrationTimingResult {
- timezone: string | null;
- localHour: number | null;
- isSuspiciousHour: boolean;
- riskNote: string;
-}
diff --git a/fluxer_api/src/api/risk/SuspiciousIpRepository.ts b/fluxer_api/src/api/risk/SuspiciousIpRepository.ts
deleted file mode 100644
index 570e7795b..000000000
--- a/fluxer_api/src/api/risk/SuspiciousIpRepository.ts
+++ /dev/null
@@ -1,85 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {UserID} from '@app/api/BrandedTypes';
-import {fetchOne, upsertOne} from '@app/api/database/CassandraQueryExecution';
-import type {SuspiciousIpRow} from '@app/api/database/types/RiskTypes';
-import type {SuspiciousIpResult} from '@app/api/risk/RiskTypes';
-import {SuspiciousIps} from '@app/api/Tables';
-import {getSameIpDecisionKey, normalizeIpString} from '@fluxer/ip_utils/src/IpAddress';
-
-const SUSPICIOUS_IP_TTL_SECONDS = 180 * 24 * 60 * 60;
-const SELECT_SUSPICIOUS_IP_CQL = SuspiciousIps.selectCql({
- where: SuspiciousIps.where.eq('ip'),
- limit: 1,
-});
-
-export interface SuspiciousIpMark {
- ip: string;
- source: string;
- reason: string;
- sourceUserId: UserID | null;
- deletionReasonCode: number | null;
- providerName: string | null;
- asn: number | null;
- asnName: string | null;
- asnType: string | null;
- riskNote: string | null;
- createdAt?: Date;
- expiresAt?: Date;
-}
-
-export interface ISuspiciousIpRepository {
- markSuspiciousIp(mark: SuspiciousIpMark): Promise<void>;
- findActiveByIp(ip: string, now?: Date): Promise<SuspiciousIpResult | null>;
-}
-
-function suspiciousIpKey(ip: string): string {
- return getSameIpDecisionKey(ip) ?? normalizeIpString(ip);
-}
-
-function defaultExpiresAt(createdAt: Date): Date {
- return new Date(createdAt.getTime() + SUSPICIOUS_IP_TTL_SECONDS * 1000);
-}
-
-export class CassandraSuspiciousIpRepository implements ISuspiciousIpRepository {
- async markSuspiciousIp(mark: SuspiciousIpMark): Promise<void> {
- const createdAt = mark.createdAt ?? new Date();
- const expiresAt = mark.expiresAt ?? defaultExpiresAt(createdAt);
- await upsertOne(
- SuspiciousIps.insertWithTtl(
- {
- ip: suspiciousIpKey(mark.ip),
- created_at: createdAt,
- updated_at: createdAt,
- expires_at: expiresAt,
- source: mark.source,
- reason: mark.reason,
- source_user_id: mark.sourceUserId,
- deletion_reason_code: mark.deletionReasonCode,
- provider_name: mark.providerName,
- asn: mark.asn,
- asn_name: mark.asnName,
- asn_type: mark.asnType,
- risk_note: mark.riskNote,
- },
- SUSPICIOUS_IP_TTL_SECONDS,
- ),
- );
- }
-
- async findActiveByIp(ip: string, now: Date = new Date()): Promise<SuspiciousIpResult | null> {
- const row = await fetchOne<SuspiciousIpRow>(SELECT_SUSPICIOUS_IP_CQL, {ip: suspiciousIpKey(ip)});
- if (!row) return null;
- if (row.expires_at && row.expires_at <= now) return null;
- return {
- ip: row.ip,
- source: row.source,
- reason: row.reason,
- sourceUserId: row.source_user_id ? row.source_user_id.toString() : null,
- deletionReasonCode: row.deletion_reason_code ?? null,
- createdAt: row.created_at.toISOString(),
- expiresAt: row.expires_at?.toISOString() ?? null,
- riskNote: row.risk_note ?? 'suspicious IP marker present',
- };
- }
-}
diff --git a/fluxer_api/src/api/risk/TrustedPrivacyProviders.ts b/fluxer_api/src/api/risk/TrustedPrivacyProviders.ts
deleted file mode 100644
index 781ed0534..000000000
--- a/fluxer_api/src/api/risk/TrustedPrivacyProviders.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {isAccountPolicyTrustedCommercialPrivacyProvider} from '@app/api/risk/AccountPolicyService';
-
-export function isTrustedCommercialPrivacyProvider(providerName: string | null | undefined): boolean {
- return isAccountPolicyTrustedCommercialPrivacyProvider(providerName);
-}
diff --git a/fluxer_api/src/api/risk/TwilioInboundSmsWebhook.ts b/fluxer_api/src/api/risk/TwilioInboundSmsWebhook.ts
deleted file mode 100644
index edb33e761..000000000
--- a/fluxer_api/src/api/risk/TwilioInboundSmsWebhook.ts
+++ /dev/null
@@ -1,115 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createHmac, timingSafeEqual} from 'node:crypto';
-import {phonePrefixBanCache} from '@app/api/auth/PhonePrefixBanCache';
-import {PhoneVerificationReuseStore} from '@app/api/auth/PhoneVerificationReuseStore';
-import type {InboundSmsChallengeService} from '@app/api/auth/services/InboundSmsChallengeService';
-import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
-import {Logger} from '@app/api/Logger';
-import type {HonoApp} from '@app/api/types/HonoEnv';
-import type {IUserRepository} from '@app/api/user/IUserRepository';
-import {mapUserToPrivateResponse} from '@app/api/user/UserMappers';
-import {resolveRequestClientIp} from '@app/api/utils/IpUtils';
-import {PHONE_ADD_CLEARABLE_FLAGS} from '@fluxer/constants/src/UserConstants';
-import {PHONE_E164_REGEX} from '@fluxer/schema/src/primitives/UserValidators';
-import type {ICacheService} from '@pkgs/cache/src/ICacheService';
-
-interface TwilioInboundSmsWebhookContext {
- authToken: string;
- publicWebhookUrl: string;
- inboundSmsChallengeService: InboundSmsChallengeService;
- userRepository: IUserRepository;
- gatewayService: IGatewayService;
- cacheService: ICacheService;
-}
-
-export function installTwilioInboundSmsWebhook(app: HonoApp, ctx: TwilioInboundSmsWebhookContext): void {
- const phoneReuseStore = new PhoneVerificationReuseStore(ctx.cacheService);
- app.post('/webhooks/twilio/sms', async (c) => {
- const rawBody = await c.req.text();
- const params = parseFormUrlEncoded(rawBody);
- const signature = c.req.header('x-twilio-signature') ?? '';
- if (!verifyTwilioSignature(ctx.authToken, ctx.publicWebhookUrl, params, signature)) {
- Logger.warn({ip: resolveRequestClientIp(c.req.raw) ?? '?'}, 'Twilio webhook signature failed; rejecting');
- return c.text('forbidden', 403);
- }
- const fromPhone = params.get('From') ?? '';
- const body = (params.get('Body') ?? '').trim();
- const messageSid = params.get('MessageSid') ?? '';
- if (!fromPhone || !body) {
- return c.text(twimlAck(), 200, twiml());
- }
- if (!PHONE_E164_REGEX.test(fromPhone) || phonePrefixBanCache.isBlocked(fromPhone)) {
- Logger.info({fromPhone, messageSid}, 'Twilio inbound SMS: sender phone blocked');
- return c.text(twimlAck(), 200, twiml());
- }
- try {
- const consumed = await ctx.inboundSmsChallengeService.consumeChallenge({code: body, fromPhone});
- if (!consumed) {
- Logger.info({fromPhone, messageSid}, 'Twilio inbound SMS: no matching challenge');
- return c.text(twimlAck(), 200, twiml());
- }
- const user = await ctx.userRepository.findUnique(consumed.userId);
- if (!user) {
- Logger.warn({userId: String(consumed.userId)}, 'Twilio inbound SMS: user vanished');
- return c.text(twimlAck(), 200, twiml());
- }
- if (!(await phoneReuseStore.claimVerificationSlot(fromPhone))) {
- Logger.info({fromPhone, userId: String(consumed.userId)}, 'Twilio inbound SMS: phone recently used');
- return c.text(twimlAck(), 200, twiml());
- }
- const newFlags = (user.suspiciousActivityFlags ?? 0) & ~PHONE_ADD_CLEARABLE_FLAGS;
- await ctx.userRepository.patchUpsert(
- user.id,
- {has_verified_phone: true, suspicious_activity_flags: newFlags},
- user.toRow(),
- );
- const updatedUser = await ctx.userRepository.findUnique(user.id);
- if (updatedUser) {
- await ctx.gatewayService.dispatchPresence({
- userId: user.id,
- event: 'USER_UPDATE',
- data: mapUserToPrivateResponse(updatedUser),
- });
- }
- Logger.info({userId: String(consumed.userId), fromPhone}, 'Twilio inbound SMS: challenge consumed');
- return c.text(twimlAck(), 200, twiml());
- } catch (err) {
- Logger.error({err: String(err)}, 'Twilio inbound SMS handler crashed');
- return c.text(twimlAck(), 200, twiml());
- }
- });
-}
-
-function verifyTwilioSignature(
- authToken: string,
- url: string,
- params: URLSearchParams,
- expectedSignature: string,
-): boolean {
- if (!expectedSignature) return false;
- const sortedKeys = [...params.keys()].sort();
- let payload = url;
- for (const key of sortedKeys) {
- payload += key + (params.get(key) ?? '');
- }
- const computed = createHmac('sha1', authToken).update(payload).digest('base64');
- const a = Buffer.from(computed);
- const b = Buffer.from(expectedSignature);
- if (a.length !== b.length) return false;
- return timingSafeEqual(a, b);
-}
-
-function parseFormUrlEncoded(body: string): URLSearchParams {
- return new URLSearchParams(body);
-}
-
-function twiml(): {
- [key: string]: string;
-} {
- return {'Content-Type': 'text/xml; charset=utf-8'};
-}
-
-function twimlAck(): string {
- return '<?xml version="1.0" encoding="UTF-8"?><Response/>';
-}
diff --git a/fluxer_api/src/api/risk/__tests__/AbusePolicy.test.ts b/fluxer_api/src/api/risk/__tests__/AbusePolicy.test.ts
deleted file mode 100644
index 5fa6c8788..000000000
--- a/fluxer_api/src/api/risk/__tests__/AbusePolicy.test.ts
+++ /dev/null
@@ -1,86 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {Config} from '@app/api/Config';
-import {phoneFlaggingAllowedForCountry, stripDisallowedPhoneFlags} from '@app/api/risk/AbusePolicy';
-import {SuspiciousActivityFlags} from '@fluxer/constants/src/UserConstants';
-import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
-
-const PHONE_AND_EMAIL =
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL |
- SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION;
-
-describe('phone flagging policy', () => {
- const original = {...Config.abusePolicy.phoneFlagging};
-
- beforeEach(() => {
- Config.abusePolicy.phoneFlagging = {enabled: true, exemptCountryCodes: []};
- });
-
- afterEach(() => {
- Config.abusePolicy.phoneFlagging = original;
- });
-
- it('keeps phone flags by default without resolving the country', async () => {
- const resolveCountryCode = vi.fn(async () => 'NG');
- expect(await stripDisallowedPhoneFlags(PHONE_AND_EMAIL, resolveCountryCode)).toBe(PHONE_AND_EMAIL);
- expect(resolveCountryCode).not.toHaveBeenCalled();
- expect(phoneFlaggingAllowedForCountry('NG')).toBe(true);
- });
-
- it('strips only phone flags when disabled', async () => {
- Config.abusePolicy.phoneFlagging = {enabled: false, exemptCountryCodes: []};
- const resolveCountryCode = vi.fn(async () => 'NG');
- expect(await stripDisallowedPhoneFlags(PHONE_AND_EMAIL, resolveCountryCode)).toBe(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL,
- );
- expect(resolveCountryCode).not.toHaveBeenCalled();
- expect(phoneFlaggingAllowedForCountry('NG')).toBe(false);
- expect(phoneFlaggingAllowedForCountry(null)).toBe(false);
- });
-
- it('strips phone flags for exempt countries only', async () => {
- Config.abusePolicy.phoneFlagging = {enabled: true, exemptCountryCodes: [' br', 'PT']};
- expect(await stripDisallowedPhoneFlags(PHONE_AND_EMAIL, async () => 'BR')).toBe(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL,
- );
- expect(await stripDisallowedPhoneFlags(PHONE_AND_EMAIL, async () => 'ng')).toBe(PHONE_AND_EMAIL);
- expect(await stripDisallowedPhoneFlags(PHONE_AND_EMAIL, async () => null)).toBe(PHONE_AND_EMAIL);
- expect(phoneFlaggingAllowedForCountry('pt')).toBe(false);
- expect(phoneFlaggingAllowedForCountry('NG')).toBe(true);
- });
-
- it('replaces email or phone flags with their email only equivalent', async () => {
- Config.abusePolicy.phoneFlagging = {enabled: false, exemptCountryCodes: []};
- expect(
- await stripDisallowedPhoneFlags(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL_OR_VERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL_OR_REVERIFIED_PHONE,
- async () => null,
- ),
- ).toBe(SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL);
- expect(
- await stripDisallowedPhoneFlags(
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL_OR_VERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION,
- async () => null,
- ),
- ).toBe(SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL);
- Config.abusePolicy.phoneFlagging = {enabled: true, exemptCountryCodes: ['BR']};
- expect(
- await stripDisallowedPhoneFlags(
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL_OR_REVERIFIED_PHONE,
- async () => 'BR',
- ),
- ).toBe(SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL);
- });
-
- it('skips the country lookup when no phone flags are present', async () => {
- Config.abusePolicy.phoneFlagging = {enabled: true, exemptCountryCodes: ['BR']};
- const resolveCountryCode = vi.fn(async () => 'BR');
- expect(await stripDisallowedPhoneFlags(SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL, resolveCountryCode)).toBe(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL,
- );
- expect(resolveCountryCode).not.toHaveBeenCalled();
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/AbuseProneEmailTlds.test.ts b/fluxer_api/src/api/risk/__tests__/AbuseProneEmailTlds.test.ts
deleted file mode 100644
index ef8636588..000000000
--- a/fluxer_api/src/api/risk/__tests__/AbuseProneEmailTlds.test.ts
+++ /dev/null
@@ -1,54 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- AbuseProneEmailTldRisk,
- classifyAbuseProneEmailTld,
- isBlockedRegistrationEmailDomain,
- isLowRiskEmailTld,
-} from '@app/api/risk/AbuseProneEmailTlds';
-import {setInjectedAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyService';
-import {createCurrentBehaviorTestAccountPolicyEvaluator} from '@app/api/test/AccountPolicyTestEvaluator';
-import {afterEach, beforeEach, describe, expect, it} from 'vitest';
-
-beforeEach(() => {
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
-});
-
-afterEach(() => {
- setInjectedAccountPolicyEvaluator(undefined);
-});
-
-describe('isBlockedRegistrationEmailDomain', () => {
- it('blocks TLDs from the configured deny list', () => {
- expect(isBlockedRegistrationEmailDomain('name.example.blocked')).toBe(true);
- });
- it('does not hard-block merely unfamiliar TLDs because those are soft-scored only', () => {
- expect(isBlockedRegistrationEmailDomain('example.unknown')).toBe(false);
- expect(isBlockedRegistrationEmailDomain('example.stable')).toBe(false);
- });
- it('does not block malformed domains', () => {
- expect(isBlockedRegistrationEmailDomain('not-a-domain')).toBe(false);
- });
-});
-
-describe('classifyAbuseProneEmailTld', () => {
- it('returns null for configured low-risk TLDs', () => {
- expect(classifyAbuseProneEmailTld('stable')).toBeNull();
- expect(classifyAbuseProneEmailTld('trusted')).toBeNull();
- });
- it('returns High for everything not on the configured low-risk list', () => {
- expect(classifyAbuseProneEmailTld('unknown')).toBe(AbuseProneEmailTldRisk.High);
- expect(classifyAbuseProneEmailTld('blocked')).toBe(AbuseProneEmailTldRisk.High);
- });
- it('normalizes leading dots and casing', () => {
- expect(classifyAbuseProneEmailTld('.Stable')).toBeNull();
- expect(classifyAbuseProneEmailTld('.Unknown')).toBe(AbuseProneEmailTldRisk.High);
- });
-});
-
-describe('isLowRiskEmailTld', () => {
- it('reports configured allowlist membership', () => {
- expect(isLowRiskEmailTld('stable')).toBe(true);
- expect(isLowRiskEmailTld('unknown')).toBe(false);
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/AccountPolicyEvaluator.test.ts b/fluxer_api/src/api/risk/__tests__/AccountPolicyEvaluator.test.ts
deleted file mode 100644
index 035169ce4..000000000
--- a/fluxer_api/src/api/risk/__tests__/AccountPolicyEvaluator.test.ts
+++ /dev/null
@@ -1,236 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- type AccountPolicyContext,
- createAccountPolicyContactContext,
- createAccountPolicyContactDomainContext,
- createAccountPolicyEvaluatorFromConfig,
- normalizePolicyContactDomain,
-} from '@app/api/risk/AccountPolicyEvaluator';
-import {
- RecommendedAction,
- type RiskAssessment,
- RiskConfidence,
- RiskDecisionMethod,
- RiskLevel,
-} from '@app/api/risk/RiskTypes';
-import {
- createCurrentBehaviorTestAccountPolicyEvaluator,
- TEST_POLICY_CONTACT_DOMAIN,
- TEST_POLICY_CONTACT_SUBDOMAIN,
- TEST_POLICY_REPUTATION_EXEMPT_DOMAIN,
-} from '@app/api/test/AccountPolicyTestEvaluator';
-import {SuspiciousActivityFlags} from '@fluxer/constants/src/UserConstants';
-import {describe, expect, it} from 'vitest';
-
-function createAssessment(params: {level?: RiskLevel; action?: RecommendedAction; score?: number}): RiskAssessment {
- const level = params.level ?? RiskLevel.Low;
- const action = params.action ?? RecommendedAction.Allow;
- return {
- suspicious: level !== RiskLevel.Low,
- level,
- confidence: RiskConfidence.High,
- riskScore: params.score ?? 0,
- reasoning: 'test assessment',
- recommendedAction: action,
- method: RiskDecisionMethod.Noop,
- modelUsed: 'test',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- };
-}
-
-function createContext(overrides: {
- domain?: string | null;
- domainStepUpRequired?: boolean;
- regionStepUpRequired?: boolean;
- level?: RiskLevel;
- action?: RecommendedAction;
- score?: number;
-}): AccountPolicyContext {
- const action = overrides.action ?? RecommendedAction.Allow;
- const level = overrides.level ?? RiskLevel.Low;
- return {
- contact: {
- value: '[email protected]',
- domain: overrides.domain ?? 'example.com',
- domainAdminListed: false,
- domainDisposable: false,
- domainBlocked: false,
- domainStepUpRequired: overrides.domainStepUpRequired ?? false,
- },
- region: {
- code: 'US',
- stepUpRequired: overrides.regionStepUpRequired ?? false,
- },
- assessment: {
- raw: createAssessment({level, action, score: overrides.score}),
- level,
- action,
- },
- };
-}
-
-describe('AccountPolicyEvaluator', () => {
- it('normalizes contact domains before policy evaluation', () => {
- expect(normalizePolicyContactDomain(' Example.COM ')).toBe('example.com');
- expect(normalizePolicyContactDomain(null)).toBeNull();
- });
-
- it.each([
- [RecommendedAction.Allow, 0],
- [RecommendedAction.RequireVerifiedEmail, SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL],
- [RecommendedAction.RequireOutboundPhone, SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE],
- [
- RecommendedAction.RequireInboundPhone,
- SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION,
- ],
- [
- RecommendedAction.Block,
- SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION,
- ],
- ])('maps assessment action %s to bitfield %i', (action, expected) => {
- const evaluator = createCurrentBehaviorTestAccountPolicyEvaluator();
- const decision = evaluator.evaluate(createContext({action}));
- expect(decision.flagBits).toBe(expected);
- });
-
- it('adds contact-domain and region step-up bits exactly like the current fixture', () => {
- const evaluator = createCurrentBehaviorTestAccountPolicyEvaluator();
- const domainDecision = evaluator.evaluate(createContext({domainStepUpRequired: true}));
- expect(domainDecision.flagBits).toBe(SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE);
- expect(domainDecision.riskHistoryOutcomeCodes).toEqual(['challenged']);
-
- const regionDecision = evaluator.evaluate(createContext({regionStepUpRequired: true}));
- expect(regionDecision.flagBits).toBe(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION,
- );
- expect(regionDecision.riskHistoryOutcomeCodes).toEqual(['challenged']);
- });
-
- it('uses configured contact-domain exclusions to suppress only bitfield rules', () => {
- const evaluator = createCurrentBehaviorTestAccountPolicyEvaluator();
- const decision = evaluator.evaluate(
- createContext({
- domain: TEST_POLICY_CONTACT_DOMAIN,
- domainStepUpRequired: true,
- regionStepUpRequired: true,
- action: RecommendedAction.RequireInboundPhone,
- level: RiskLevel.VeryHigh,
- score: 90,
- }),
- );
- expect(decision.flagBits).toBe(0);
- expect(decision.riskHistoryOutcomeCodes).toEqual([]);
- expect(decision.auditEvents).toEqual([
- {event: 'assessment_threshold_notice', level: 'warn', ruleId: 'emit_assessment_threshold_notice'},
- ]);
- expect(decision.inviteAutoJoinEnabled).toBe(false);
- });
-
- it('gates invite auto-join and emits threshold audit events from data rules', () => {
- const evaluator = createCurrentBehaviorTestAccountPolicyEvaluator();
- const decision = evaluator.evaluate(createContext({level: RiskLevel.VeryHigh, score: 80}));
- expect(decision.inviteAutoJoinEnabled).toBe(false);
- expect(decision.inviteAutoJoinSkipReason).toBe('assessment_score_gte_80');
- expect(decision.auditEvents).toEqual([
- {event: 'assessment_threshold_notice', level: 'warn', ruleId: 'emit_assessment_threshold_notice'},
- ]);
- });
-
- it('resolves generic contact capabilities from configured contact rules', () => {
- const evaluator = createCurrentBehaviorTestAccountPolicyEvaluator();
- const decision = evaluator.evaluateContact(createAccountPolicyContactContext(`test@${TEST_POLICY_CONTACT_DOMAIN}`));
- expect(decision.hasCapability('captcha_exempt')).toBe(true);
- expect(decision.hasCapability('followup_risk_exempt')).toBe(true);
- expect(decision.hasCapability('required_actions_exempt')).toBe(true);
-
- const subdomainDecision = evaluator.evaluateContact(
- createAccountPolicyContactContext(`test@${TEST_POLICY_CONTACT_SUBDOMAIN}`),
- );
- expect(subdomainDecision.capabilities).toEqual([]);
- });
-
- it('resolves contact-domain reputation capabilities from configured contact rules', () => {
- const evaluator = createCurrentBehaviorTestAccountPolicyEvaluator();
- const decision = evaluator.evaluateContact(
- createAccountPolicyContactDomainContext(TEST_POLICY_REPUTATION_EXEMPT_DOMAIN),
- );
- expect(decision.hasCapability('reputation_checks_exempt')).toBe(true);
- expect(evaluator.evaluateContact(createAccountPolicyContactDomainContext('other.example')).capabilities).toEqual(
- [],
- );
- });
-
- it('classifies configured contact and network policy data', () => {
- const evaluator = createCurrentBehaviorTestAccountPolicyEvaluator();
- expect(evaluator.isLowRiskEmailTld('stable')).toBe(true);
- expect(evaluator.classifyEmailTld('stable')).toBeNull();
- expect(evaluator.classifyEmailTld('unknown')).toBe('high');
- expect(evaluator.isBlockedRegistrationEmailDomain('name.example.blocked')).toBe(true);
- expect(evaluator.isBlockedRegistrationEmailDomain('name.example.stable')).toBe(false);
- expect(evaluator.isTrustedCommercialPrivacyProvider('Example Privacy Relay LLC')).toBe(true);
- expect(evaluator.isTrustedCommercialPrivacyProvider('Unlisted Provider LLC')).toBe(false);
- expect(evaluator.isEducationOrganizationName('North Example Academy')).toBe(true);
- expect(evaluator.isEducationOrganizationName('Example Hosting LLC')).toBe(false);
- expect(evaluator.classifyReverseDnsHostname('host.cell.example')).toBe('cellular');
- expect(evaluator.classifyReverseDnsHostname('host.biz.example')).toBe('business');
- expect(evaluator.classifyReverseDnsHostname('host.static.example')).toBe('static');
- expect(evaluator.classifyReverseDnsHostname('host.dyn.example')).toBe('dynamic');
- expect(evaluator.classifyReverseDnsHostname('host.example')).toBe('unknown');
- expect(evaluator.getMinimumAgeForRegion('ZZ', 13)).toBe(16);
- expect(evaluator.getMinimumAgeForRegion('US', 13)).toBe(13);
- });
-
- it('loads override documents from JSON strings', () => {
- const evaluator = createAccountPolicyEvaluatorFromConfig(
- JSON.stringify({
- version: 1,
- id: 'test_override',
- defaults: {
- flag_bits: 0,
- features: {
- invite_auto_join: true,
- },
- },
- rules: [
- {
- id: 'override-rule',
- when: {fact: 'assessment.score', gte: 10},
- effects: [{type: 'or_bits', bits: SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL}],
- },
- ],
- }),
- );
- expect(evaluator.evaluate(createContext({score: 9})).flagBits).toBe(0);
- expect(evaluator.evaluate(createContext({score: 10})).flagBits).toBe(
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL,
- );
- });
-
- it('uses a disabled no-op policy when config is absent', () => {
- const evaluator = createAccountPolicyEvaluatorFromConfig(undefined);
- expect(evaluator.evaluate(createContext({action: RecommendedAction.RequireInboundPhone})).flagBits).toBe(0);
- expect(evaluator.classifyEmailTld('unknown')).toBeNull();
- expect(createAccountPolicyEvaluatorFromConfig('').isBlockedRegistrationEmailDomain('name.example.blocked')).toBe(
- false,
- );
- });
-
- it('rejects unsupported facts before runtime evaluation', () => {
- expect(() =>
- createAccountPolicyEvaluatorFromConfig({
- version: 1,
- id: 'bad',
- rules: [
- {
- id: 'bad-rule',
- when: {fact: 'contact.unsupported', equals: true},
- effects: [{type: 'or_bits', bits: 1}],
- },
- ],
- }),
- ).toThrow('unknown fact path');
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/AccountPolicyService.test.ts b/fluxer_api/src/api/risk/__tests__/AccountPolicyService.test.ts
deleted file mode 100644
index 3d0277e83..000000000
--- a/fluxer_api/src/api/risk/__tests__/AccountPolicyService.test.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {APIConfig} from '@app/api/config/APIConfig';
-import {describe, expect, it, vi} from 'vitest';
-
-function createRuntimePolicyConfig(params: {
- nodeEnv: 'development' | 'production';
- selfHosted: boolean;
- testModeEnabled: boolean;
- accountPolicyDsl?: unknown;
-}): APIConfig {
- return {
- nodeEnv: params.nodeEnv,
- risk: {
- enabled: true,
- accountPolicyDsl: params.accountPolicyDsl,
- },
- dev: {
- testModeEnabled: params.testModeEnabled,
- },
- instance: {
- selfHosted: params.selfHosted,
- },
- } as APIConfig;
-}
-
-async function loadIsolatedAccountPolicyService(config: APIConfig) {
- vi.resetModules();
- const {initializeConfig} = await import('@app/api/Config');
- initializeConfig(config);
- return import('@app/api/risk/AccountPolicyService');
-}
-
-describe('AccountPolicyService runtime config', () => {
- it('uses a disabled policy when config is absent in development', async () => {
- const service = await loadIsolatedAccountPolicyService(
- createRuntimePolicyConfig({
- nodeEnv: 'development',
- selfHosted: false,
- testModeEnabled: false,
- }),
- );
- service.setInjectedAccountPolicyEvaluator(undefined);
- expect(service.getAccountPolicyEvaluator().classifyEmailTld('unknown')).toBeNull();
- });
-
- it('uses a disabled policy when config is absent in self-hosted production', async () => {
- const service = await loadIsolatedAccountPolicyService(
- createRuntimePolicyConfig({
- nodeEnv: 'production',
- selfHosted: true,
- testModeEnabled: false,
- }),
- );
- service.setInjectedAccountPolicyEvaluator(undefined);
- expect(service.getAccountPolicyEvaluator().classifyEmailTld('unknown')).toBeNull();
- });
-
- it('requires policy config when config is absent in hosted production', async () => {
- const service = await loadIsolatedAccountPolicyService(
- createRuntimePolicyConfig({
- nodeEnv: 'production',
- selfHosted: false,
- testModeEnabled: false,
- }),
- );
- service.setInjectedAccountPolicyEvaluator(undefined);
- expect(() => service.getAccountPolicyEvaluator()).toThrow(
- 'FLUXER_ACCOUNT_POLICY_DSL is required in hosted production',
- );
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/DeterministicRiskEngine.test.ts b/fluxer_api/src/api/risk/__tests__/DeterministicRiskEngine.test.ts
deleted file mode 100644
index e92f98a7e..000000000
--- a/fluxer_api/src/api/risk/__tests__/DeterministicRiskEngine.test.ts
+++ /dev/null
@@ -1,325 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {setInjectedAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyService';
-import {DeterministicRiskEngine} from '@app/api/risk/DeterministicRiskEngine';
-import type {RiskToolbox} from '@app/api/risk/RiskToolbox';
-import {
- type IpInfoAnonymousResult,
- RecommendedAction,
- type RegistrationEvent,
- RiskLevel,
-} from '@app/api/risk/RiskTypes';
-import {createCurrentBehaviorTestAccountPolicyEvaluator} from '@app/api/test/AccountPolicyTestEvaluator';
-import {afterEach, beforeEach, describe, expect, it} from 'vitest';
-
-const BASE_EVENT: RegistrationEvent = {
- email: null,
- ip: '203.0.113.5',
- locale: null,
- timezone: null,
- userAgent: null,
- isUnclaimed: true,
-};
-
-beforeEach(() => {
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
-});
-
-afterEach(() => {
- setInjectedAccountPolicyEvaluator(undefined);
-});
-
-function createToolbox(
- overrides: {
- analyzeEmailSyntax?: RiskToolbox['analyzeEmailSyntax'];
- lookupIpInfo?: RiskToolbox['lookupIpInfo'];
- getSuspiciousIp?: RiskToolbox['getSuspiciousIp'];
- getRegistrationsByPlusAddressBase?: RiskToolbox['getRegistrationsByPlusAddressBase'];
- } = {},
-): RiskToolbox {
- return {
- analyzeEmailSyntax:
- overrides.analyzeEmailSyntax ??
- (async ({email}) => ({
- email,
- localPart: '',
- domain: '',
- localPartLength: 0,
- entropy: 0,
- keyboardMashDetected: false,
- looksLikeName: true,
- pronounceability: 1,
- unusualRepeats: false,
- digitRatio: 0,
- hasDots: false,
- hasPlusTag: false,
- gibberishScore: 0,
- valid: true,
- })),
- checkDomainDisposable: async ({domain}) => ({
- domain,
- isDisposable: false,
- }),
- checkMx: async ({domain}) => ({
- domain,
- hasMx: true,
- recordCount: 1,
- records: [],
- error: null,
- }),
- checkDomainAge: async ({domain}) => ({
- domain,
- available: true,
- creationDate: null,
- ageDays: 365,
- isNewlyRegistered: false,
- riskNote: 'ok',
- }),
- lookupGeoIpCity: async ({ip}) => ({
- ip,
- available: true,
- found: true,
- countryIso: 'US',
- country: 'United States',
- region: null,
- city: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- timeZone: null,
- }),
- lookupGeoIpAsn: async ({ip}) => ({
- ip,
- available: true,
- found: true,
- asn: 64512,
- asnOrg: 'Example Hosting',
- }),
- lookupIpInfo: overrides.lookupIpInfo ?? (async ({ip}) => baseIpInfo(ip)),
- lookupReverseDns: async ({ip}) => ({ip, hostname: null, classification: 'unknown'}),
- getSuspiciousIp: overrides.getSuspiciousIp ?? (async () => null),
- getRegistrationsByIp: async ({ip, windowHours}) => baseVelocity(ip, windowHours),
- getRegistrationsBySubnet: async ({ip, windowHours}) => baseVelocity(ip, windowHours),
- getRegistrationsByEmailDomain: async ({domain, windowHours}) => baseVelocity(domain, windowHours),
- getRegistrationsByPlusAddressBase:
- overrides.getRegistrationsByPlusAddressBase ??
- (async ({plusAddressBase, windowHours}) => baseVelocity(plusAddressBase, windowHours)),
- getHistoricalOutcomesByIp: async ({ip, windowHours}) => baseHistoricalOutcome(ip, windowHours),
- getHistoricalOutcomesBySubnet: async ({ip, windowHours}) => baseHistoricalOutcome(ip, windowHours),
- getHistoricalOutcomesByEmailDomain: async ({domain, windowHours}) => baseHistoricalOutcome(domain, windowHours),
- getHistoricalOutcomesByAsn: async ({asn, windowHours}) => baseHistoricalOutcome(String(asn), windowHours),
- checkGeoVsLocale: async ({geoipCountryIso, registrationLocale, registrationTimezone}) => ({
- geoipCountryIso,
- registrationLocale,
- registrationTimezone,
- localeGeoMatch: null,
- timezoneGeoMatch: null,
- mismatchDetected: false,
- notes: [],
- }),
- analyzeUserAgent: async ({userAgent}) => ({
- raw: userAgent,
- browser: 'Unknown',
- browserVersion: null,
- os: 'Unknown',
- isBot: false,
- isHeadless: false,
- isAutomation: false,
- isOutdated: false,
- suspiciousPatterns: [],
- riskNote: 'ok',
- }),
- analyzeRegistrationTiming: async ({timezone}) => ({
- timezone,
- localHour: 12,
- isSuspiciousHour: false,
- riskNote: 'ok',
- }),
- };
-}
-
-function baseIpInfo(ip: string, overrides: Partial<IpInfoAnonymousResult> = {}): IpInfoAnonymousResult {
- return {
- ip,
- available: true,
- isAnonymous: false,
- providerName: null,
- isVpn: false,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- isHosting: false,
- isMobile: false,
- asnType: null,
- asnOrg: null,
- connectionType: 'residential',
- percentDaysSeen: null,
- riskNote: 'ok',
- ...overrides,
- };
-}
-
-function baseVelocity(identifier: string, windowHours: number) {
- return {
- identifier,
- windowHours,
- totalRegistrations: 0,
- truncated: false,
- uniqueEmails: 0,
- uniqueLocales: [],
- uniqueIps: 0,
- riskNote: 'none',
- };
-}
-
-function baseHistoricalOutcome(identifier: string, windowHours: number) {
- return {
- identifier,
- windowHours,
- sampledRegistrations: 0,
- truncated: false,
- sampledUsers: 0,
- resolvedUsers: 0,
- adverseUsers: 0,
- challengedUsers: 0,
- enforcedUsers: 0,
- spammerUsers: 0,
- disabledUsers: 0,
- disabledSuspiciousUsers: 0,
- riskNote: 'none',
- };
-}
-
-describe('DeterministicRiskEngine', () => {
- it('allows configured privacy providers without adding hosting risk', async () => {
- const engine = new DeterministicRiskEngine(
- createToolbox({
- lookupIpInfo: async ({ip}) =>
- baseIpInfo(ip, {
- isAnonymous: true,
- isVpn: true,
- providerName: 'Example Privacy Relay LLC',
- }),
- }),
- );
- const result = await engine.classify(BASE_EVENT);
- expect(result.level).toBe(RiskLevel.Low);
- expect(result.riskScore).toBe(0);
- expect(result.recommendedAction).toBe(RecommendedAction.Allow);
- });
- it('treats unknown VPN providers as risky', async () => {
- const engine = new DeterministicRiskEngine(
- createToolbox({
- lookupIpInfo: async ({ip}) =>
- baseIpInfo(ip, {
- isAnonymous: true,
- isVpn: true,
- providerName: 'Unknown VPN LLC',
- }),
- }),
- );
- const result = await engine.classify(BASE_EVENT);
- expect(result.riskScore).toBeGreaterThan(0);
- expect(result.reasoning).toContain('untrusted VPN/proxy detected by IPinfo');
- });
- it('scores suspicious IP markers', async () => {
- const engine = new DeterministicRiskEngine(
- createToolbox({
- getSuspiciousIp: async ({ip}) => ({
- ip,
- source: 'scheduled_deletion',
- reason: 'account_scheduled_for_deletion',
- sourceUserId: '123',
- deletionReasonCode: 3,
- createdAt: new Date().toISOString(),
- expiresAt: null,
- riskNote: 'test',
- }),
- }),
- );
- const result = await engine.classify(BASE_EVENT);
- expect(result.level).toBe(RiskLevel.Medium);
- expect(result.recommendedAction).toBe(RecommendedAction.RequireVerifiedEmail);
- expect(result.reasoning).toContain('suspicious IP marker from scheduled_deletion');
- });
- it('ignores suspicious IP markers for trusted paid VPN providers', async () => {
- const engine = new DeterministicRiskEngine(
- createToolbox({
- lookupIpInfo: async ({ip}) =>
- baseIpInfo(ip, {
- isAnonymous: true,
- isVpn: true,
- providerName: 'Example Privacy Relay LLC',
- }),
- getSuspiciousIp: async ({ip}) => ({
- ip,
- source: 'scheduled_deletion',
- reason: 'account_scheduled_for_deletion',
- sourceUserId: '123',
- deletionReasonCode: 3,
- createdAt: new Date().toISOString(),
- expiresAt: null,
- riskNote: 'test',
- }),
- }),
- );
- const result = await engine.classify(BASE_EVENT);
- expect(result.level).toBe(RiskLevel.Low);
- expect(result.riskScore).toBe(0);
- expect(result.reasoning).toContain('trusted commercial VPN');
- });
- it('allows privacy relays without adding hosting risk', async () => {
- const engine = new DeterministicRiskEngine(
- createToolbox({
- lookupIpInfo: async ({ip}) =>
- baseIpInfo(ip, {
- isAnonymous: true,
- isRelay: true,
- providerName: 'Example Privacy Relay LLC',
- }),
- }),
- );
- const result = await engine.classify(BASE_EVENT);
- expect(result.level).toBe(RiskLevel.Low);
- expect(result.riskScore).toBe(0);
- });
- it('treats hosting/datacenter networks as untrusted anonymizing networks', async () => {
- const engine = new DeterministicRiskEngine(
- createToolbox({
- lookupIpInfo: async ({ip}) =>
- baseIpInfo(ip, {
- isHosting: true,
- asnType: 'hosting',
- }),
- }),
- );
- const result = await engine.classify(BASE_EVENT);
- expect(result.riskScore).toBeGreaterThan(0);
- expect(result.reasoning).toContain('hosting/datacenter network detected by IPinfo');
- });
- it('treats heavy plus-address reuse as high risk', async () => {
- const engine = new DeterministicRiskEngine(
- createToolbox({
- analyzeEmailSyntax: async ({email}) => ({
- ...(await createToolbox().analyzeEmailSyntax({email})),
- hasPlusTag: true,
- }),
- getRegistrationsByPlusAddressBase: async ({plusAddressBase, windowHours}) => ({
- ...baseVelocity(plusAddressBase, windowHours),
- totalRegistrations: 4,
- uniqueEmails: 4,
- uniqueIps: 1,
- }),
- }),
- );
- const result = await engine.classify({
- ...BASE_EVENT,
- email: '[email protected]',
- isUnclaimed: false,
- });
- expect(result.level).toBe(RiskLevel.High);
- expect(result.recommendedAction).toBe(RecommendedAction.RequireOutboundPhone);
- expect(result.reasoning).toContain('heavy plus-address reuse');
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/EmailSyntaxAnalyzer.test.ts b/fluxer_api/src/api/risk/__tests__/EmailSyntaxAnalyzer.test.ts
deleted file mode 100644
index 78b6b9a34..000000000
--- a/fluxer_api/src/api/risk/__tests__/EmailSyntaxAnalyzer.test.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {analyzeEmailSyntax} from '@app/api/risk/adapters/EmailSyntaxAnalyzer';
-import {describe, expect, it} from 'vitest';
-
-describe('analyzeEmailSyntax', () => {
- it('rejects malformed addresses', () => {
- const r = analyzeEmailSyntax({email: 'not-an-email'});
- expect(r.valid).toBe(false);
- expect(r.gibberishScore).toBe(100);
- });
- it('marks "[email protected]" as name-like and not gibberish', () => {
- const r = analyzeEmailSyntax({email: '[email protected]'});
- expect(r.valid).toBe(true);
- expect(r.looksLikeName).toBe(true);
- expect(r.gibberishScore).toBeLessThanOrEqual(20);
- });
- it('flags "[email protected]" as gibberish via unusual repeats and digit suffix', () => {
- const r = analyzeEmailSyntax({email: '[email protected]'});
- expect(r.valid).toBe(true);
- expect(r.unusualRepeats).toBe(true);
- expect(r.gibberishScore).toBeGreaterThanOrEqual(40);
- });
- it('flags keyboard-mash strings', () => {
- const r = analyzeEmailSyntax({email: '[email protected]'});
- expect(r.keyboardMashDetected).toBe(true);
- expect(r.gibberishScore).toBeGreaterThanOrEqual(30);
- });
- it('penalizes high-entropy short locals', () => {
- const r = analyzeEmailSyntax({email: '[email protected]'});
- expect(r.gibberishScore).toBeGreaterThanOrEqual(40);
- });
- it('treats well-formatted dotted display-name addresses as low risk', () => {
- const r = analyzeEmailSyntax({email: '[email protected]'});
- expect(r.looksLikeName).toBe(true);
- expect(r.gibberishScore).toBeLessThan(30);
- });
- it('marks the digit-heavy bot pattern with score boost', () => {
- const r = analyzeEmailSyntax({email: '[email protected]'});
- expect(r.gibberishScore).toBeGreaterThan(20);
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/GeoIpAdapters.test.ts b/fluxer_api/src/api/risk/__tests__/GeoIpAdapters.test.ts
deleted file mode 100644
index 8f6d6adae..000000000
--- a/fluxer_api/src/api/risk/__tests__/GeoIpAdapters.test.ts
+++ /dev/null
@@ -1,289 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createGeoIpAsnAdapter, createGeoIpCityAdapter} from '@app/api/risk/adapters/GeoIpAdapters';
-import type {GeoipAsnResult, GeoipResult} from '@pkgs/geoip/src/GeoipLookup';
-import type {IpInfoLookupResult, IpInfoService} from '@pkgs/geoip/src/IpInfoService';
-import {describe, expect, it} from 'vitest';
-
-function throwingIpInfoService(): IpInfoService {
- return {
- lookup: async () => {
- throw new Error('ipinfo must not be consulted');
- },
- };
-}
-
-function countingIpInfoService(result: IpInfoLookupResult): {service: IpInfoService; calls: () => number} {
- let calls = 0;
- return {
- service: {
- lookup: async () => {
- calls += 1;
- return result;
- },
- },
- calls: () => calls,
- };
-}
-
-function ipInfoResult(overrides: Partial<IpInfoLookupResult> = {}): IpInfoLookupResult {
- return {
- ip: '198.51.100.1',
- available: true,
- riskNote: 'test',
- geo: {
- countryCode: 'US',
- countryName: 'United States',
- continent: 'North America',
- continentCode: 'NA',
- region: 'California',
- regionCode: 'CA',
- city: 'San Jose',
- postalCode: null,
- timezone: 'America/Los_Angeles',
- latitude: 37.3,
- longitude: -121.9,
- accuracyRadiusKm: 20,
- },
- asn: {
- asn: 'AS64500',
- number: 64500,
- name: 'Test ISP',
- domain: null,
- type: null,
- },
- mobile: {
- name: null,
- mcc: null,
- mnc: null,
- },
- anonymous: {
- isAnonymous: false,
- providerName: null,
- isVpn: false,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- percentDaysSeen: null,
- },
- flags: {
- isAnycast: false,
- isHosting: false,
- isMobile: false,
- isSatellite: false,
- },
- ...overrides,
- };
-}
-
-function geoipResult(overrides: Partial<GeoipResult> = {}): GeoipResult {
- return {
- countryCode: 'SE',
- normalizedIp: '198.51.100.7',
- city: 'Stockholm',
- region: 'Stockholm County',
- regionCode: 'AB',
- countryName: 'Sweden',
- latitude: 59.33,
- longitude: 18.06,
- accuracyRadiusKm: 5,
- timeZone: 'Europe/Stockholm',
- ...overrides,
- };
-}
-
-function geoipAsnResult(overrides: Partial<GeoipAsnResult> = {}): GeoipAsnResult {
- return {
- normalizedIp: '198.51.100.7',
- asn: 64510,
- asnOrg: 'Example Broadband ISP',
- available: true,
- ...overrides,
- };
-}
-
-describe('createGeoIpCityAdapter', () => {
- it('answers from the local city database without touching IPInfo', async () => {
- const lookupGeoIpCity = createGeoIpCityAdapter({
- ipInfoService: throwingIpInfoService(),
- lookupLocalCity: async () => geoipResult(),
- });
- await expect(lookupGeoIpCity({ip: '198.51.100.7'})).resolves.toEqual({
- ip: '198.51.100.7',
- available: true,
- found: true,
- countryIso: 'SE',
- country: 'Sweden',
- region: 'Stockholm County',
- city: 'Stockholm',
- latitude: 59.33,
- longitude: 18.06,
- accuracyRadiusKm: 5,
- timeZone: 'Europe/Stockholm',
- });
- });
-
- it('normalizes the IP before handing it to the local city database', async () => {
- const seen: Array<string> = [];
- const lookupGeoIpCity = createGeoIpCityAdapter({
- ipInfoService: throwingIpInfoService(),
- lookupLocalCity: async (ip) => {
- seen.push(ip);
- return geoipResult();
- },
- });
- await lookupGeoIpCity({ip: '[2001:0db8:0000::0001]'});
- expect(seen).toEqual(['2001:db8::1']);
- });
-
- it('coalesces missing optional local fields to null', async () => {
- const lookupGeoIpCity = createGeoIpCityAdapter({
- ipInfoService: throwingIpInfoService(),
- lookupLocalCity: async () => ({
- countryCode: 'SE',
- normalizedIp: '198.51.100.7',
- city: null,
- region: null,
- countryName: null,
- }),
- });
- await expect(lookupGeoIpCity({ip: '198.51.100.7'})).resolves.toEqual({
- ip: '198.51.100.7',
- available: true,
- found: true,
- countryIso: 'SE',
- country: null,
- region: null,
- city: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- timeZone: null,
- });
- });
-
- it('falls back to IPInfo when the local city database has no country', async () => {
- const counting = countingIpInfoService(ipInfoResult());
- const lookupGeoIpCity = createGeoIpCityAdapter({
- ipInfoService: counting.service,
- lookupLocalCity: async () => geoipResult({countryCode: null}),
- });
- await expect(lookupGeoIpCity({ip: '198.51.100.1'})).resolves.toEqual({
- ip: '198.51.100.1',
- available: true,
- found: true,
- countryIso: 'US',
- country: 'United States',
- region: 'California',
- city: 'San Jose',
- latitude: 37.3,
- longitude: -121.9,
- accuracyRadiusKm: 20,
- timeZone: 'America/Los_Angeles',
- });
- expect(counting.calls()).toBe(1);
- });
-
- it('falls back to IPInfo when no local city lookup is wired', async () => {
- const counting = countingIpInfoService(ipInfoResult());
- const lookupGeoIpCity = createGeoIpCityAdapter({ipInfoService: counting.service});
- const result = await lookupGeoIpCity({ip: '198.51.100.1'});
- expect(result.countryIso).toBe('US');
- expect(counting.calls()).toBe(1);
- });
-
- it('returns an available not-found result for an unparseable IP without any lookup', async () => {
- const lookupGeoIpCity = createGeoIpCityAdapter({
- ipInfoService: throwingIpInfoService(),
- lookupLocalCity: async () => {
- throw new Error('local city must not be consulted');
- },
- });
- await expect(lookupGeoIpCity({ip: 'not-an-ip'})).resolves.toEqual({
- ip: 'not-an-ip',
- available: true,
- found: false,
- countryIso: null,
- country: null,
- region: null,
- city: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- timeZone: null,
- });
- });
-});
-
-describe('createGeoIpAsnAdapter', () => {
- it('answers from the local ASN database without touching IPInfo', async () => {
- const lookupGeoIpAsn = createGeoIpAsnAdapter({
- ipInfoService: throwingIpInfoService(),
- lookupLocalAsn: async () => geoipAsnResult(),
- });
- await expect(lookupGeoIpAsn({ip: '198.51.100.7'})).resolves.toEqual({
- ip: '198.51.100.7',
- available: true,
- found: true,
- asn: 64510,
- asnOrg: 'Example Broadband ISP',
- });
- });
-
- it('normalizes the IP before handing it to the local ASN database', async () => {
- const seen: Array<string> = [];
- const lookupGeoIpAsn = createGeoIpAsnAdapter({
- ipInfoService: throwingIpInfoService(),
- lookupLocalAsn: async (ip) => {
- seen.push(ip);
- return geoipAsnResult();
- },
- });
- await lookupGeoIpAsn({ip: '[2001:0db8:0000::0001]'});
- expect(seen).toEqual(['2001:db8::1']);
- });
-
- it('falls back to IPInfo when the local ASN database has no ASN', async () => {
- const counting = countingIpInfoService(ipInfoResult());
- const lookupGeoIpAsn = createGeoIpAsnAdapter({
- ipInfoService: counting.service,
- lookupLocalAsn: async () => geoipAsnResult({asn: null, asnOrg: null}),
- });
- await expect(lookupGeoIpAsn({ip: '198.51.100.1'})).resolves.toEqual({
- ip: '198.51.100.1',
- available: true,
- found: true,
- asn: 64500,
- asnOrg: 'Test ISP',
- });
- expect(counting.calls()).toBe(1);
- });
-
- it('falls back to IPInfo when the local ASN database is unavailable', async () => {
- const counting = countingIpInfoService(ipInfoResult());
- const lookupGeoIpAsn = createGeoIpAsnAdapter({
- ipInfoService: counting.service,
- lookupLocalAsn: async () => geoipAsnResult({normalizedIp: null, asn: null, asnOrg: null, available: false}),
- });
- const result = await lookupGeoIpAsn({ip: '198.51.100.1'});
- expect(result.asn).toBe(64500);
- expect(counting.calls()).toBe(1);
- });
-
- it('returns an available not-found result for an unparseable IP without any lookup', async () => {
- const lookupGeoIpAsn = createGeoIpAsnAdapter({
- ipInfoService: throwingIpInfoService(),
- lookupLocalAsn: async () => {
- throw new Error('local ASN must not be consulted');
- },
- });
- await expect(lookupGeoIpAsn({ip: 'not-an-ip'})).resolves.toEqual({
- ip: 'not-an-ip',
- available: true,
- found: false,
- asn: null,
- asnOrg: null,
- });
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/HistoricalOutcomeAdapter.test.ts b/fluxer_api/src/api/risk/__tests__/HistoricalOutcomeAdapter.test.ts
deleted file mode 100644
index 176811c5d..000000000
--- a/fluxer_api/src/api/risk/__tests__/HistoricalOutcomeAdapter.test.ts
+++ /dev/null
@@ -1,62 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- createHistoricalOutcomeAdapter,
- type HistoricalOutcomeAdapterContext,
-} from '@app/api/risk/adapters/HistoricalOutcomeAdapter';
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import type {HistoricalOutcomeRecord} from '@app/api/risk/RiskHistoryTypes';
-import {describe, expect, it} from 'vitest';
-
-function makeRepository(records: ReadonlyArray<HistoricalOutcomeRecord>): IRiskHistoryRepository {
- return {
- upsertLatestContext: async () => undefined,
- recordOutcomeForUser: async () => undefined,
- listByIp: async (ip, sinceTime) =>
- records.filter((record) => record.createdAt >= sinceTime && ip === '203.0.113.10'),
- listBySubnet: async () => [],
- listByEmailDomain: async () => [],
- listByAsn: async () => [],
- };
-}
-
-describe('HistoricalOutcomeAdapter', () => {
- it('deduplicates outcomes per user and aggregates challenge/enforcement counts', async () => {
- const now = new Date('2026-04-12T20:00:00Z');
- const records: ReadonlyArray<HistoricalOutcomeRecord> = [
- {
- userId: '1',
- createdAt: new Date('2026-04-12T19:30:00Z'),
- outcomeCode: 'challenged',
- source: 'registration_risk',
- },
- {
- userId: '1',
- createdAt: new Date('2026-04-12T19:35:00Z'),
- outcomeCode: 'disabled_suspicious',
- source: 'admin_disable_suspicious_activity',
- },
- {
- userId: '2',
- createdAt: new Date('2026-04-12T19:40:00Z'),
- outcomeCode: 'spammer',
- source: 'admin_spammer',
- },
- ];
- const adapter = createHistoricalOutcomeAdapter({
- repository: makeRepository(records),
- now: () => now,
- } satisfies HistoricalOutcomeAdapterContext);
- const result = await adapter.getHistoricalOutcomesByIp({
- ip: '203.0.113.10',
- windowHours: 24,
- });
- expect(result.sampledRegistrations).toBe(3);
- expect(result.sampledUsers).toBe(2);
- expect(result.resolvedUsers).toBe(2);
- expect(result.challengedUsers).toBe(1);
- expect(result.enforcedUsers).toBe(2);
- expect(result.disabledSuspiciousUsers).toBe(1);
- expect(result.spammerUsers).toBe(1);
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/IpInfoAdapterPrescreen.test.ts b/fluxer_api/src/api/risk/__tests__/IpInfoAdapterPrescreen.test.ts
deleted file mode 100644
index 5a26ae9bf..000000000
--- a/fluxer_api/src/api/risk/__tests__/IpInfoAdapterPrescreen.test.ts
+++ /dev/null
@@ -1,156 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {setInjectedAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyService';
-import {createIpInfoChecker, unavailableIpInfoAnonymousResult} from '@app/api/risk/adapters/IpInfoAdapter';
-import {createCurrentBehaviorTestAccountPolicyEvaluator} from '@app/api/test/AccountPolicyTestEvaluator';
-import type {IpInfoLookupContext, IpInfoLookupResult, IpInfoService} from '@pkgs/geoip/src/IpInfoService';
-import {afterEach, beforeEach, describe, expect, it} from 'vitest';
-
-function ipInfoResult(overrides: Partial<IpInfoLookupResult> = {}): IpInfoLookupResult {
- return {
- ip: '198.51.100.1',
- available: true,
- riskNote: 'live lookup',
- geo: {
- countryCode: 'US',
- countryName: 'United States',
- continent: 'North America',
- continentCode: 'NA',
- region: null,
- regionCode: null,
- city: null,
- postalCode: null,
- timezone: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- },
- asn: {
- asn: 'AS64500',
- number: 64500,
- name: 'Test ISP',
- domain: null,
- type: 'isp',
- },
- mobile: {
- name: null,
- mcc: null,
- mnc: null,
- },
- anonymous: {
- isAnonymous: true,
- providerName: 'Example VPN',
- isVpn: true,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- percentDaysSeen: 42,
- },
- flags: {
- isAnycast: false,
- isHosting: false,
- isMobile: false,
- isSatellite: false,
- },
- ...overrides,
- };
-}
-
-function countingIpInfoService(result: IpInfoLookupResult): {
- service: IpInfoService;
- calls: () => number;
- contexts: () => Array<IpInfoLookupContext | undefined>;
-} {
- const contexts: Array<IpInfoLookupContext | undefined> = [];
- return {
- service: {
- lookup: async (_ip, context) => {
- contexts.push(context);
- return result;
- },
- },
- calls: () => contexts.length,
- contexts: () => contexts,
- };
-}
-
-beforeEach(() => {
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
-});
-
-afterEach(() => {
- setInjectedAccountPolicyEvaluator(undefined);
-});
-
-describe('createIpInfoChecker pre-screen', () => {
- it('returns an unavailable result with zero lookups when the pre-screen skips', async () => {
- const counting = countingIpInfoService(ipInfoResult());
- const checkIpInfo = createIpInfoChecker({
- ipInfoService: counting.service,
- prescreen: async () => 'skip',
- });
- await expect(checkIpInfo('198.51.100.1')).resolves.toEqual(
- unavailableIpInfoAnonymousResult('198.51.100.1', 'IPInfo skipped (local pre-screen)'),
- );
- expect(counting.calls()).toBe(0);
- });
-
- it('calls IPInfo exactly once and preserves the mapping when the pre-screen consults', async () => {
- const counting = countingIpInfoService(ipInfoResult());
- const checkIpInfo = createIpInfoChecker({
- ipInfoService: counting.service,
- prescreen: async () => 'consult',
- });
- await expect(checkIpInfo('198.51.100.1')).resolves.toEqual({
- ip: '198.51.100.1',
- available: true,
- isAnonymous: true,
- providerName: 'Example VPN',
- isVpn: true,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- isHosting: false,
- isMobile: false,
- asnType: 'isp',
- asnOrg: 'Test ISP',
- connectionType: 'residential',
- percentDaysSeen: 42,
- riskNote: 'live lookup',
- });
- expect(counting.calls()).toBe(1);
- expect(counting.contexts()).toEqual([{source: 'risk.ipinfo_checker', reason: 'registration_risk'}]);
- });
-
- it('is identical to a consulting pre-screen when no pre-screen is wired', async () => {
- const withoutPrescreen = countingIpInfoService(ipInfoResult());
- const withPrescreen = countingIpInfoService(ipInfoResult());
- const baseline = await createIpInfoChecker({ipInfoService: withoutPrescreen.service})('198.51.100.1');
- const consulted = await createIpInfoChecker({
- ipInfoService: withPrescreen.service,
- prescreen: async () => 'consult',
- })('198.51.100.1');
- expect(baseline).toEqual(consulted);
- expect(withoutPrescreen.calls()).toBe(1);
- expect(withPrescreen.calls()).toBe(1);
- });
-
- it('never synthesizes a clean attestation for a skipped lookup', () => {
- const skipped = unavailableIpInfoAnonymousResult('198.51.100.1', 'IPInfo skipped (local pre-screen)');
- expect(skipped.available).toBe(false);
- expect(skipped.isAnonymous).toBe(false);
- expect(skipped.isVpn).toBe(false);
- expect(skipped.isProxy).toBe(false);
- expect(skipped.isResidentialProxy).toBe(false);
- expect(skipped.isTor).toBe(false);
- expect(skipped.isRelay).toBe(false);
- expect(skipped.isHosting).toBe(false);
- expect(skipped.isMobile).toBe(false);
- expect(skipped.asnType).toBeNull();
- expect(skipped.asnOrg).toBeNull();
- expect(skipped.connectionType).toBe('unknown');
- expect(skipped.percentDaysSeen).toBeNull();
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/IpInfoBudget.test.ts b/fluxer_api/src/api/risk/__tests__/IpInfoBudget.test.ts
deleted file mode 100644
index 6319452df..000000000
--- a/fluxer_api/src/api/risk/__tests__/IpInfoBudget.test.ts
+++ /dev/null
@@ -1,134 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createKvIpInfoLookupBudget} from '@app/api/risk/IpInfoBudget';
-import {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
-import {afterEach, beforeEach, describe, expect, it, vi} from 'vitest';
-
-const BUDGET_ENV_KEYS = [
- 'FLUXER_IPINFO_BUDGET_ENABLED',
- 'FLUXER_IPINFO_BUDGET_MONTHLY_MAX',
- 'FLUXER_IPINFO_BUDGET_BACKGROUND_MONTHLY_PCT',
- 'FLUXER_IPINFO_BUDGET_STANDARD_MONTHLY_PCT',
- 'FLUXER_IPINFO_BUDGET_CRITICAL_BURST',
- 'FLUXER_IPINFO_BUDGET_STANDARD_BURST',
- 'FLUXER_IPINFO_BUDGET_BACKGROUND_BURST',
- 'FLUXER_IPINFO_BUDGET_CRITICAL_REFILL_PER_MIN',
- 'FLUXER_IPINFO_BUDGET_STANDARD_REFILL_PER_MIN',
- 'FLUXER_IPINFO_BUDGET_BACKGROUND_REFILL_PER_MIN',
-];
-
-function monthKey(): string {
- const now = new Date();
- const month = String(now.getUTCMonth() + 1).padStart(2, '0');
- return `ipinfo:budget:month:${now.getUTCFullYear()}-${month}`;
-}
-
-describe('IpInfoBudget', () => {
- const savedEnv = new Map<string, string | undefined>();
-
- beforeEach(() => {
- for (const key of BUDGET_ENV_KEYS) {
- savedEnv.set(key, process.env[key]);
- delete process.env[key];
- }
- process.env.FLUXER_IPINFO_BUDGET_MONTHLY_MAX = '100';
- });
-
- afterEach(() => {
- for (const [key, value] of savedEnv) {
- if (value === undefined) {
- delete process.env[key];
- } else {
- process.env[key] = value;
- }
- }
- savedEnv.clear();
- });
-
- it('sheds background lookups at the background monthly ceiling while standard still admits', async () => {
- const kv = new MockKVProvider();
- await kv.set(monthKey(), '60');
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- expect(await budget.tryConsume('background')).toBe(false);
- expect(await budget.tryConsume('standard')).toBe(true);
- });
-
- it('sheds standard lookups at the standard monthly ceiling', async () => {
- const kv = new MockKVProvider();
- await kv.set(monthKey(), '90');
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- expect(await budget.tryConsume('standard')).toBe(false);
- });
-
- it('admits critical lookups above the standard ceiling', async () => {
- const kv = new MockKVProvider();
- await kv.set(monthKey(), '95');
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- expect(await budget.tryConsume('critical')).toBe(true);
- });
-
- it('never increments the monthly counter for a shed lookup', async () => {
- const kv = new MockKVProvider();
- await kv.set(monthKey(), '60');
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- const outcomes = [
- await budget.tryConsume('background'),
- await budget.tryConsume('background'),
- await budget.tryConsume('standard'),
- await budget.tryConsume('critical'),
- ];
-
- expect(outcomes).toEqual([false, false, true, true]);
- expect(kv.incrSpy).toHaveBeenCalledTimes(2);
- expect(await kv.get(monthKey())).toBe('62');
- });
-
- it('sheds once the per-priority burst bucket is drained', async () => {
- process.env.FLUXER_IPINFO_BUDGET_BACKGROUND_BURST = '3';
- process.env.FLUXER_IPINFO_BUDGET_BACKGROUND_REFILL_PER_MIN = '1';
- const kv = new MockKVProvider();
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- expect(await budget.tryConsume('background')).toBe(true);
- expect(await budget.tryConsume('background')).toBe(true);
- expect(await budget.tryConsume('background')).toBe(true);
- expect(await budget.tryConsume('background')).toBe(false);
- expect(await budget.tryConsume('standard')).toBe(true);
- });
-
- it('expires the month key only on the first increment', async () => {
- const kv = new MockKVProvider();
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- expect(await budget.tryConsume('standard')).toBe(true);
- expect(await budget.tryConsume('standard')).toBe(true);
- expect(await budget.tryConsume('standard')).toBe(true);
-
- expect(kv.expireSpy).toHaveBeenCalledTimes(1);
- expect(kv.expireSpy).toHaveBeenCalledWith(monthKey(), 40 * 24 * 3600);
- });
-
- it('fails open for every priority when the KV provider throws', async () => {
- const kv = new MockKVProvider();
- vi.spyOn(kv, 'get').mockRejectedValue(new Error('kv unavailable'));
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- expect(await budget.tryConsume('background')).toBe(true);
- expect(await budget.tryConsume('standard')).toBe(true);
- expect(await budget.tryConsume('critical')).toBe(true);
- });
-
- it('admits everything when the budget is disabled', async () => {
- process.env.FLUXER_IPINFO_BUDGET_ENABLED = '0';
- const kv = new MockKVProvider();
- await kv.set(monthKey(), '1000');
- const budget = createKvIpInfoLookupBudget({getKvClient: () => kv});
-
- expect(await budget.tryConsume('background')).toBe(true);
- expect(kv.tryConsumeTokensSpy).not.toHaveBeenCalled();
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/LocaleGeoMatcher.test.ts b/fluxer_api/src/api/risk/__tests__/LocaleGeoMatcher.test.ts
deleted file mode 100644
index 244406ca9..000000000
--- a/fluxer_api/src/api/risk/__tests__/LocaleGeoMatcher.test.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {checkGeoVsLocale} from '@app/api/risk/adapters/LocaleGeoMatcher';
-import {describe, expect, it} from 'vitest';
-
-describe('checkGeoVsLocale', () => {
- it('matches en-US to US', async () => {
- const r = await checkGeoVsLocale({geoipCountryIso: 'US', registrationLocale: 'en-US', registrationTimezone: null});
- expect(r.localeGeoMatch).toBe(true);
- expect(r.mismatchDetected).toBe(false);
- });
- it('flags en-US from RU as a mismatch', async () => {
- const r = await checkGeoVsLocale({geoipCountryIso: 'RU', registrationLocale: 'en-US', registrationTimezone: null});
- expect(r.mismatchDetected).toBe(true);
- });
- it('matches ja-JP to JP', async () => {
- const r = await checkGeoVsLocale({geoipCountryIso: 'JP', registrationLocale: 'ja-JP', registrationTimezone: null});
- expect(r.localeGeoMatch).toBe(true);
- });
- it('flags ja from non-JP as language-only mismatch', async () => {
- const r = await checkGeoVsLocale({geoipCountryIso: 'BR', registrationLocale: 'ja', registrationTimezone: null});
- expect(r.mismatchDetected).toBe(true);
- });
- it('returns no mismatch when one input is missing', async () => {
- const r = await checkGeoVsLocale({geoipCountryIso: null, registrationLocale: 'en-US', registrationTimezone: null});
- expect(r.mismatchDetected).toBe(false);
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/RegistrationIpPrescreen.test.ts b/fluxer_api/src/api/risk/__tests__/RegistrationIpPrescreen.test.ts
deleted file mode 100644
index 92bc1470d..000000000
--- a/fluxer_api/src/api/risk/__tests__/RegistrationIpPrescreen.test.ts
+++ /dev/null
@@ -1,110 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {setInjectedAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyService';
-import {
- type IpInfoPrescreenOptions,
- ipInfoPrescreenOptionsFromEnv,
- type LocalIpIntel,
- prescreenIpInfoLookup,
-} from '@app/api/risk/RegistrationIpPrescreen';
-import {createCurrentBehaviorTestAccountPolicyEvaluator} from '@app/api/test/AccountPolicyTestEvaluator';
-import {afterEach, beforeEach, describe, expect, it} from 'vitest';
-
-const CLEAN_LOCAL: LocalIpIntel = {countryIso: 'SE', asn: 64500, asnOrg: 'Example Broadband ISP'};
-
-function options(overrides: Partial<IpInfoPrescreenOptions> = {}): IpInfoPrescreenOptions {
- return {enabled: true, allowedAsns: new Set([64500]), ...overrides};
-}
-
-function local(overrides: Partial<LocalIpIntel> = {}): LocalIpIntel {
- return {...CLEAN_LOCAL, ...overrides};
-}
-
-beforeEach(() => {
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
-});
-
-afterEach(() => {
- setInjectedAccountPolicyEvaluator(undefined);
- delete process.env.FLUXER_RISK_IPINFO_PRESCREEN_ENABLED;
- delete process.env.FLUXER_RISK_IPINFO_PRESCREEN_ALLOW_ASNS;
-});
-
-describe('prescreenIpInfoLookup', () => {
- it('skips the lookup only when every local signal is clean and allowlisted', () => {
- expect(prescreenIpInfoLookup(local(), options())).toBe('skip');
- });
-
- it('consults when the pre-screen is disabled', () => {
- expect(prescreenIpInfoLookup(local(), options({enabled: false}))).toBe('consult');
- });
-
- it('consults when the allowlist is empty', () => {
- expect(prescreenIpInfoLookup(local(), options({allowedAsns: new Set()}))).toBe('consult');
- });
-
- it('consults when the local city database has no country', () => {
- expect(prescreenIpInfoLookup(local({countryIso: null}), options())).toBe('consult');
- });
-
- it('consults when the local ASN database has no ASN', () => {
- expect(prescreenIpInfoLookup(local({asn: null}), options())).toBe('consult');
- });
-
- it('consults when the ASN is not on the allowlist', () => {
- expect(prescreenIpInfoLookup(local({asn: 64501}), options())).toBe('consult');
- });
-
- it('consults for a trusted commercial privacy provider even on the allowlist', () => {
- expect(prescreenIpInfoLookup(local({asnOrg: 'Example Privacy Relay LLC'}), options())).toBe('consult');
- });
-
- it('consults for an education organization even on the allowlist', () => {
- expect(prescreenIpInfoLookup(local({asnOrg: 'North Example Academy'}), options())).toBe('consult');
- });
-
- it('consults for a cellular organization even on the allowlist', () => {
- expect(prescreenIpInfoLookup(local({asnOrg: 'Example cell-net Wireless'}), options())).toBe('consult');
- });
-
- it('skips when the allowlisted ASN carries no organization name to veto', () => {
- expect(prescreenIpInfoLookup(local({asnOrg: null}), options())).toBe('skip');
- });
-});
-
-describe('ipInfoPrescreenOptionsFromEnv', () => {
- it('is disabled with an empty allowlist by default', () => {
- const parsed = ipInfoPrescreenOptionsFromEnv();
- expect(parsed.enabled).toBe(false);
- expect(parsed.allowedAsns.size).toBe(0);
- });
-
- it('treats only 1 and true as enabled', () => {
- process.env.FLUXER_RISK_IPINFO_PRESCREEN_ENABLED = '1';
- expect(ipInfoPrescreenOptionsFromEnv().enabled).toBe(true);
- process.env.FLUXER_RISK_IPINFO_PRESCREEN_ENABLED = 'TRUE';
- expect(ipInfoPrescreenOptionsFromEnv().enabled).toBe(true);
- process.env.FLUXER_RISK_IPINFO_PRESCREEN_ENABLED = 'yes';
- expect(ipInfoPrescreenOptionsFromEnv().enabled).toBe(false);
- process.env.FLUXER_RISK_IPINFO_PRESCREEN_ENABLED = '0';
- expect(ipInfoPrescreenOptionsFromEnv().enabled).toBe(false);
- });
-
- it('parses a comma separated allowlist and drops non numeric entries', () => {
- process.env.FLUXER_RISK_IPINFO_PRESCREEN_ALLOW_ASNS = ' 64500, 64501 ,,notanasn,64502x,-3,64503 ';
- expect([...ipInfoPrescreenOptionsFromEnv().allowedAsns]).toEqual([64500, 64501, 64503]);
- });
-
- it('parses an empty allowlist from an empty or whitespace value', () => {
- process.env.FLUXER_RISK_IPINFO_PRESCREEN_ALLOW_ASNS = '';
- expect(ipInfoPrescreenOptionsFromEnv().allowedAsns.size).toBe(0);
- process.env.FLUXER_RISK_IPINFO_PRESCREEN_ALLOW_ASNS = ' , ,';
- expect(ipInfoPrescreenOptionsFromEnv().allowedAsns.size).toBe(0);
- });
-
- it('yields a consult verdict for every input with the shipped defaults', () => {
- const shipped = ipInfoPrescreenOptionsFromEnv();
- expect(prescreenIpInfoLookup(local(), shipped)).toBe('consult');
- expect(prescreenIpInfoLookup(local({asnOrg: null}), shipped)).toBe('consult');
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/TorReverseDnsChecker.test.ts b/fluxer_api/src/api/risk/__tests__/TorReverseDnsChecker.test.ts
deleted file mode 100644
index e6b92b22a..000000000
--- a/fluxer_api/src/api/risk/__tests__/TorReverseDnsChecker.test.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {matchTorHostname} from '@app/api/risk/adapters/TorReverseDnsChecker';
-import {describe, expect, it} from 'vitest';
-
-describe('matchTorHostname', () => {
- it.each([
- ['tor-exit.example.com'],
- ['exit1.tor.example.net'],
- ['tor-exit-01.example.net'],
- ['torexit23.example.net'],
- ['tor-relay.example.com'],
- ['anonymizer.example.com'],
- ['anonymiser.example.com'],
- ['anon-proxy.example.com'],
- ['tor01.example.com'],
- ['foo.torproject.example'],
- ])('matches Tor-operator pattern: %s', (hostname) => {
- expect(matchTorHostname(hostname)).not.toBeNull();
- });
- it.each([
- ['ec2-1-2-3-4.us-east-1.compute.amazonaws.com'],
- ['ip-10-0-0-1.ec2.internal'],
- ['example.com'],
- ['mx01.google.com'],
- ['a1234.hetzner.example'],
- ['contoro.example.com'],
- ])('does not match benign hostname: %s', (hostname) => {
- expect(matchTorHostname(hostname)).toBeNull();
- });
-});
diff --git a/fluxer_api/src/api/risk/__tests__/VelocityAdapter.test.ts b/fluxer_api/src/api/risk/__tests__/VelocityAdapter.test.ts
deleted file mode 100644
index 9a09b3716..000000000
--- a/fluxer_api/src/api/risk/__tests__/VelocityAdapter.test.ts
+++ /dev/null
@@ -1,122 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {
- createVelocityAdapter,
- type IRegistrationEventsRepository,
- type RegistrationEventRecord,
-} from '@app/api/risk/adapters/VelocityAdapter';
-import {describe, expect, it} from 'vitest';
-
-function makeMockRepo(records: ReadonlyArray<RegistrationEventRecord>): IRegistrationEventsRepository {
- return {
- recordEvent: async () => undefined,
- listByIp: async (ip, sinceTime) =>
- records.filter((r) => r.ip === ip && r.createdAt.getTime() >= sinceTime.getTime()),
- listBySubnet: async (subnet, sinceTime) =>
- records.filter(
- (r) =>
- r.ip.startsWith(subnet.replace('/24', '').replace(/0$/, '')) && r.createdAt.getTime() >= sinceTime.getTime(),
- ),
- listByPlusAddressBase: async (plusAddressBase, sinceTime) =>
- records.filter((r) => {
- const email = r.email?.toLowerCase() ?? null;
- if (!email) return false;
- const [localPart, domain] = email.split('@');
- if (!localPart || !domain) return false;
- const plusIndex = localPart.indexOf('+');
- if (plusIndex <= 0) return false;
- return (
- `${localPart.slice(0, plusIndex)}@${domain}` === plusAddressBase &&
- r.createdAt.getTime() >= sinceTime.getTime()
- );
- }),
- listByEmailDomain: async (domain, sinceTime) =>
- records.filter((r) => r.emailDomain === domain && r.createdAt.getTime() >= sinceTime.getTime()),
- };
-}
-
-describe('VelocityAdapter', () => {
- const NOW = new Date('2026-04-11T12:00:00Z');
- const records: ReadonlyArray<RegistrationEventRecord> = [
- {
- userId: '1',
- email: '[email protected]',
- emailDomain: 'b.com',
- ip: '1.2.3.4',
- locale: 'en-US',
- createdAt: new Date(NOW.getTime() - 30000),
- },
- {
- userId: '2',
- email: '[email protected]',
- emailDomain: 'b.com',
- ip: '1.2.3.4',
- locale: 'en-US',
- createdAt: new Date(NOW.getTime() - 60000),
- },
- {
- userId: '3',
- email: '[email protected]',
- emailDomain: 'b.com',
- ip: '1.2.3.4',
- locale: 'ru-RU',
- createdAt: new Date(NOW.getTime() - 5 * 60000),
- },
- {
- userId: '4',
- email: '[email protected]',
- emailDomain: 'x.com',
- ip: '5.6.7.8',
- locale: null,
- createdAt: new Date(NOW.getTime() - 60000),
- },
- {
- userId: '5',
- email: '[email protected]',
- emailDomain: 'example.com',
- ip: '9.9.9.9',
- locale: 'en-US',
- createdAt: new Date(NOW.getTime() - 10000),
- },
- {
- userId: '6',
- email: '[email protected]',
- emailDomain: 'example.com',
- ip: '9.9.9.10',
- locale: 'en-US',
- createdAt: new Date(NOW.getTime() - 20000),
- },
- ];
- it('counts registrations by IP within window', async () => {
- const adapter = createVelocityAdapter({repository: makeMockRepo(records), now: () => NOW});
- const r = await adapter.getRegistrationsByIp({ip: '1.2.3.4', windowHours: 24});
- expect(r.totalRegistrations).toBe(3);
- expect(r.uniqueEmails).toBe(3);
- expect([...r.uniqueLocales].sort()).toEqual(['en-US', 'ru-RU']);
- });
- it('counts registrations by email domain', async () => {
- const adapter = createVelocityAdapter({repository: makeMockRepo(records), now: () => NOW});
- const r = await adapter.getRegistrationsByEmailDomain({domain: 'b.com', windowHours: 168});
- expect(r.totalRegistrations).toBe(3);
- });
- it('returns empty for unknown identifier', async () => {
- const adapter = createVelocityAdapter({repository: makeMockRepo(records), now: () => NOW});
- const r = await adapter.getRegistrationsByIp({ip: '8.8.8.8', windowHours: 24});
- expect(r.totalRegistrations).toBe(0);
- });
- it('lower-cases the email domain key', async () => {
- const adapter = createVelocityAdapter({repository: makeMockRepo(records), now: () => NOW});
- const r = await adapter.getRegistrationsByEmailDomain({domain: 'B.COM', windowHours: 168});
- expect(r.identifier).toBe('b.com');
- });
- it('counts registrations by plus-address base', async () => {
- const adapter = createVelocityAdapter({repository: makeMockRepo(records), now: () => NOW});
- const r = await adapter.getRegistrationsByPlusAddressBase({
- plusAddressBase: '[email protected]',
- windowHours: 720,
- });
- expect(r.identifier).toBe('[email protected]');
- expect(r.totalRegistrations).toBe(2);
- expect(r.uniqueEmails).toBe(2);
- });
-});
diff --git a/fluxer_api/src/api/risk/adapters/DisposableDomainChecker.ts b/fluxer_api/src/api/risk/adapters/DisposableDomainChecker.ts
deleted file mode 100644
index 205a7104f..000000000
--- a/fluxer_api/src/api/risk/adapters/DisposableDomainChecker.ts
+++ /dev/null
@@ -1,22 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {IAdminRepository} from '@app/api/admin/IAdminRepository';
-import type {DisposableCheckResult} from '@app/api/risk/RiskTypes';
-
-interface DisposableDomainCheckerContext {
- adminRepository: Pick<IAdminRepository, 'isEmailDomainSuspicious' | 'isEmailDomainDisposable'>;
-}
-
-export function createDisposableDomainChecker(ctx: DisposableDomainCheckerContext) {
- return async function checkDomainDisposable(args: {domain: string}): Promise<DisposableCheckResult> {
- const domain = args.domain.toLowerCase().trim();
- const [suspicious, disposable] = await Promise.all([
- ctx.adminRepository.isEmailDomainSuspicious(domain),
- ctx.adminRepository.isEmailDomainDisposable(domain),
- ]);
- return {
- domain,
- isDisposable: suspicious || disposable,
- };
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/DnsMxChecker.ts b/fluxer_api/src/api/risk/adapters/DnsMxChecker.ts
deleted file mode 100644
index a6b844097..000000000
--- a/fluxer_api/src/api/risk/adapters/DnsMxChecker.ts
+++ /dev/null
@@ -1,72 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {Resolver} from 'node:dns/promises';
-import type {MxCheckResult} from '@app/api/risk/RiskTypes';
-
-export interface MxResolver {
- resolveMx(domain: string): Promise<
- ReadonlyArray<{
- exchange: string;
- priority: number;
- }>
- >;
-}
-
-export class NodeDnsMxResolver implements MxResolver {
- private readonly resolver = new Resolver();
-
- async resolveMx(domain: string): Promise<
- ReadonlyArray<{
- exchange: string;
- priority: number;
- }>
- > {
- return this.resolver.resolveMx(domain);
- }
-}
-
-interface DnsMxCheckerContext {
- resolver: MxResolver;
- cacheTtlMs?: number;
-}
-
-interface CacheEntry {
- result: MxCheckResult;
- expiresAt: number;
-}
-
-const DEFAULT_TTL_MS = 60 * 60 * 1000;
-
-export function createDnsMxChecker(ctx: DnsMxCheckerContext) {
- const ttl = ctx.cacheTtlMs ?? DEFAULT_TTL_MS;
- const cache = new Map<string, CacheEntry>();
- return async function checkMx(args: {domain: string}): Promise<MxCheckResult> {
- const domain = args.domain.toLowerCase().trim();
- const now = Date.now();
- const cached = cache.get(domain);
- if (cached && cached.expiresAt > now) return cached.result;
- let result: MxCheckResult;
- try {
- const records = await ctx.resolver.resolveMx(domain);
- const sorted = [...records].sort((a, b) => a.priority - b.priority);
- result = {
- domain,
- hasMx: sorted.length > 0,
- recordCount: sorted.length,
- records: sorted.slice(0, 5).map((r) => ({priority: r.priority, host: r.exchange})),
- error: sorted.length === 0 ? 'no_records' : null,
- };
- } catch (err) {
- const code = (err as NodeJS.ErrnoException).code ?? 'unknown';
- result = {
- domain,
- hasMx: false,
- recordCount: 0,
- records: [],
- error: code,
- };
- }
- cache.set(domain, {result, expiresAt: now + ttl});
- return result;
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/DomainAgeChecker.ts b/fluxer_api/src/api/risk/adapters/DomainAgeChecker.ts
deleted file mode 100644
index 3039d5013..000000000
--- a/fluxer_api/src/api/risk/adapters/DomainAgeChecker.ts
+++ /dev/null
@@ -1,172 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {isMajorEmailProvider} from '@app/api/risk/MajorEmailProviders';
-import type {DomainAgeResult} from '@app/api/risk/RiskTypes';
-import {EXTERNAL_RESPONSE_LIMITS} from '@app/api/utils/ExternalResponseLimits';
-import * as FetchUtils from '@app/api/utils/FetchUtils';
-import {isJsonRecord, parseJsonRecord} from '@app/api/utils/JsonBoundaryUtils';
-import type {ICacheService} from '@pkgs/cache/src/ICacheService';
-
-const RDAP_TIMEOUT_MS = 4000;
-const CACHE_KEY_PREFIX = 'risk:domain_age:';
-const CACHE_TTL_SUCCESS_SECONDS = 30 * 24 * 60 * 60;
-const CACHE_TTL_FAILURE_SECONDS = 15 * 60;
-
-interface CachedDomainAge {
- domain: string;
- available: boolean;
- creationDate: string | null;
- failureNote: string | null;
-}
-
-interface RdapRegistrationEvent {
- eventAction: string;
- eventDate: string;
-}
-
-function readRdapRegistrationEvent(responseText: string): RdapRegistrationEvent | null {
- const data = parseJsonRecord(responseText);
- const events = data?.events;
- if (!Array.isArray(events)) {
- return null;
- }
- for (const event of events) {
- if (!isJsonRecord(event)) continue;
- if (event.eventAction === 'registration' && typeof event.eventDate === 'string') {
- return {
- eventAction: event.eventAction,
- eventDate: event.eventDate,
- };
- }
- }
- return null;
-}
-
-interface DomainAgeCheckerOptions {
- cacheService?: ICacheService;
-}
-
-export function createDomainAgeChecker(opts: DomainAgeCheckerOptions = {}) {
- const cache = opts.cacheService;
- async function readCache(domain: string): Promise<DomainAgeResult | null> {
- if (!cache) return null;
- try {
- const cached = await cache.get<CachedDomainAge>(cacheKey(domain));
- return cached ? hydrate(cached) : null;
- } catch {
- return null;
- }
- }
- async function writeCache(entry: CachedDomainAge): Promise<void> {
- if (!cache) return;
- const ttl = entry.available && entry.creationDate ? CACHE_TTL_SUCCESS_SECONDS : CACHE_TTL_FAILURE_SECONDS;
- try {
- await cache.set(cacheKey(entry.domain), entry, ttl);
- } catch {}
- }
- return async function checkDomainAge(args: {domain: string}): Promise<DomainAgeResult> {
- const domain = args.domain.toLowerCase().trim();
- if (isMajorEmailProvider(domain)) {
- return {
- domain,
- available: true,
- creationDate: null,
- ageDays: null,
- isNewlyRegistered: false,
- riskNote: 'well-known major provider — RDAP lookup skipped',
- };
- }
- const cached = await readCache(domain);
- if (cached) return cached;
- const entry = await fetchFromRdap(domain);
- await writeCache(entry);
- return hydrate(entry);
- };
-}
-
-async function fetchFromRdap(domain: string): Promise<CachedDomainAge> {
- const controller = new AbortController();
- const timeout = setTimeout(() => controller.abort(), RDAP_TIMEOUT_MS);
- try {
- const response = await fetch(`https://rdap.org/domain/${encodeURIComponent(domain)}`, {
- signal: controller.signal,
- headers: {Accept: 'application/rdap+json'},
- });
- if (!response.ok) {
- FetchUtils.discardResponseBody(response.body, response.status);
- return {
- domain,
- available: false,
- creationDate: null,
- failureNote: `RDAP lookup failed: HTTP ${response.status}`,
- };
- }
- const responseText = await FetchUtils.streamToStringWithLimit(response.body, {
- maxBytes: EXTERNAL_RESPONSE_LIMITS.rdapBytes,
- headers: response.headers,
- url: response.url,
- description: 'RDAP response',
- });
- const registrationEvent = readRdapRegistrationEvent(responseText);
- if (!registrationEvent?.eventDate) {
- return {
- domain,
- available: true,
- creationDate: null,
- failureNote: 'RDAP response did not include a registration date',
- };
- }
- return {
- domain,
- available: true,
- creationDate: new Date(registrationEvent.eventDate).toISOString(),
- failureNote: null,
- };
- } catch (err) {
- const message = err instanceof Error ? err.message : String(err);
- return {
- domain,
- available: false,
- creationDate: null,
- failureNote: `RDAP lookup error: ${message.slice(0, 100)}`,
- };
- } finally {
- clearTimeout(timeout);
- }
-}
-
-function hydrate(entry: CachedDomainAge): DomainAgeResult {
- if (!entry.creationDate) {
- return {
- domain: entry.domain,
- available: entry.available,
- creationDate: null,
- ageDays: null,
- isNewlyRegistered: false,
- riskNote: entry.failureNote ?? 'RDAP response did not include a registration date',
- };
- }
- const createdAt = new Date(entry.creationDate);
- const ageDays = Math.floor((Date.now() - createdAt.getTime()) / (1000 * 60 * 60 * 24));
- const isNewlyRegistered = ageDays < 30;
- let riskNote = `domain registered ${ageDays} days ago`;
- if (ageDays < 7) {
- riskNote = `domain registered only ${ageDays} days ago — very fresh, high abuse risk`;
- } else if (ageDays < 30) {
- riskNote = `domain registered ${ageDays} days ago — newly registered, elevated abuse risk`;
- } else if (ageDays < 90) {
- riskNote = `domain registered ${ageDays} days ago — relatively new`;
- }
- return {
- domain: entry.domain,
- available: entry.available,
- creationDate: entry.creationDate,
- ageDays,
- isNewlyRegistered,
- riskNote,
- };
-}
-
-function cacheKey(domain: string): string {
- return `${CACHE_KEY_PREFIX}${domain}`;
-}
diff --git a/fluxer_api/src/api/risk/adapters/EmailSyntaxAnalyzer.ts b/fluxer_api/src/api/risk/adapters/EmailSyntaxAnalyzer.ts
deleted file mode 100644
index d7ba6bfdd..000000000
--- a/fluxer_api/src/api/risk/adapters/EmailSyntaxAnalyzer.ts
+++ /dev/null
@@ -1,258 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {EmailSyntaxResult} from '@app/api/risk/RiskTypes';
-
-const KEYBOARD_ROWS = ['qwertyuiop', 'asdfghjkl', 'zxcvbnm', '1234567890'];
-const COMMON_BIGRAMS = new Set<string>([
- 'th',
- 'he',
- 'in',
- 'er',
- 'an',
- 're',
- 'on',
- 'at',
- 'en',
- 'nd',
- 'st',
- 'es',
- 'or',
- 'te',
- 'of',
- 'it',
- 'is',
- 'al',
- 'ar',
- 'le',
- 'se',
- 'co',
- 'de',
- 'ma',
- 'ri',
- 'ne',
- 'li',
- 'ha',
- 'to',
- 'ta',
- 'io',
- 'no',
- 'la',
- 'el',
- 'me',
- 'do',
- 'si',
- 'ra',
- 'so',
- 'ch',
- 'sh',
- 'mi',
- 'na',
- 'ca',
- 'da',
- 'ni',
- 'be',
- 'di',
- 'lo',
- 'wi',
- 'ke',
- 'tr',
- 'mo',
- 'jo',
- 'ro',
- 'sm',
- 'ni',
- 'ti',
- 'ti',
- 'ti',
- 'as',
- 'us',
- 'om',
- 'ou',
- 'ed',
- 'io',
- 'pa',
- 'bo',
- 'mu',
- 'fi',
- 'va',
- 'wa',
- 'sa',
- 'ye',
- 'ye',
- 'le',
- 'pe',
- 'pi',
- 'po',
- 'pu',
- 'ba',
- 'bi',
- 'bu',
- 'fa',
- 'fe',
- 'fi',
- 'fo',
- 'fu',
- 'ga',
- 'ge',
- 'gi',
- 'go',
- 'gu',
- 'ha',
- 'he',
- 'hi',
- 'ho',
- 'hu',
- 'ka',
- 'ke',
- 'ki',
- 'ko',
- 'ku',
- 'lu',
- 'va',
- 've',
- 'vi',
- 'vo',
- 'vu',
- 'ya',
- 'yi',
- 'yo',
- 'yu',
- 'za',
- 'ze',
- 'zo',
-]);
-
-function shannonEntropy(s: string): number {
- const freq: Record<string, number> = {};
- for (const c of s) freq[c] = (freq[c] ?? 0) + 1;
- const len = s.length;
- if (len === 0) return 0;
- let entropy = 0;
- for (const f of Object.values(freq)) {
- const p = f / len;
- entropy -= p * Math.log2(p);
- }
- return entropy;
-}
-
-function hasKeyboardMash(s: string, threshold = 4): boolean {
- const lower = s.toLowerCase();
- for (const row of KEYBOARD_ROWS) {
- let run = 1;
- for (let i = 1; i < lower.length; i++) {
- const idx = row.indexOf(lower[i]!);
- const prev = row.indexOf(lower[i - 1]!);
- if (idx >= 0 && prev >= 0 && Math.abs(prev - idx) <= 1) {
- run++;
- if (run >= threshold) return true;
- } else {
- run = 1;
- }
- }
- }
- return false;
-}
-
-function looksLikeName(s: string): boolean {
- const clean = s.replace(/[.\-_\d]/g, '');
- if (clean.length === 0) return false;
- const vowels = (clean.match(/[aeiou]/gi) || []).length;
- const ratio = vowels / clean.length;
- if (ratio < 0.15 || ratio > 0.75) return false;
- if (/[^aeiou\d]{5,}/i.test(clean)) return false;
- if (/[aeiou]{4,}/i.test(clean)) return false;
- return true;
-}
-
-function digitRatio(s: string): number {
- if (s.length === 0) return 0;
- return (s.match(/\d/g) || []).length / s.length;
-}
-
-function pronounceabilityScore(s: string): number {
- const clean = s.replace(/[.\-_\d]/g, '').toLowerCase();
- if (clean.length < 3) return 0.5;
- let hits = 0;
- const total = clean.length - 1;
- for (let i = 0; i < total; i++) {
- if (COMMON_BIGRAMS.has(clean.slice(i, i + 2))) hits++;
- }
- return total > 0 ? hits / total : 0;
-}
-
-function hasUnusualRepeats(s: string): boolean {
- const clean = s.replace(/[.\-_]/g, '').toLowerCase();
- if (clean.length < 5) return false;
- const freq: Record<string, number> = {};
- for (const c of clean) freq[c] = (freq[c] ?? 0) + 1;
- const maxFreq = Math.max(...Object.values(freq));
- if (maxFreq / clean.length > 0.3 && clean.length < 15) return true;
- const doubles = (clean.match(/(.)\1/g) || []).length;
- if (doubles >= 2 && clean.length < 12) return true;
- return false;
-}
-
-const EMAIL_SHAPE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
-
-export function analyzeEmailSyntax(args: {email: string}): EmailSyntaxResult {
- const email = args.email.trim();
- const isValid = EMAIL_SHAPE.test(email);
- if (!isValid) {
- return {
- email,
- localPart: '',
- domain: '',
- localPartLength: 0,
- entropy: 0,
- keyboardMashDetected: false,
- looksLikeName: false,
- pronounceability: 0,
- unusualRepeats: false,
- digitRatio: 0,
- hasDots: false,
- hasPlusTag: false,
- gibberishScore: 100,
- valid: false,
- };
- }
- const atIdx = email.lastIndexOf('@');
- const localPart = email.slice(0, atIdx);
- const domain = email.slice(atIdx + 1).toLowerCase();
- const entropy = shannonEntropy(localPart);
- const kbMash = hasKeyboardMash(localPart);
- const namelike = looksLikeName(localPart);
- const digits = digitRatio(localPart);
- const hasDots = localPart.includes('.');
- const hasPlusTag = localPart.includes('+');
- const pronounce = pronounceabilityScore(localPart);
- const unusualRepeats = hasUnusualRepeats(localPart);
- let gibberishScore = 0;
- if (entropy > 3.2 && localPart.length < 12) gibberishScore += 20;
- if (entropy > 3.5) gibberishScore += 15;
- if (kbMash) gibberishScore += 20;
- if (!namelike) gibberishScore += 15;
- if (pronounce < 0.15 && localPart.replace(/[.\-_\d]/g, '').length >= 4) gibberishScore += 25;
- else if (pronounce < 0.25) gibberishScore += 10;
- if (unusualRepeats) gibberishScore += 15;
- if (digits > 0.4) gibberishScore += 15;
- else if (digits > 0.2 && !hasDots) gibberishScore += 5;
- if (localPart.length > 20) gibberishScore += 10;
- if (!hasDots && localPart.length > 8 && !namelike && pronounce < 0.25) gibberishScore += 10;
- if (/^[a-z]+\d{2,}$/i.test(localPart) && !namelike) gibberishScore += 10;
- return {
- email,
- localPart,
- domain,
- localPartLength: localPart.length,
- entropy: Math.round(entropy * 100) / 100,
- keyboardMashDetected: kbMash,
- looksLikeName: namelike,
- pronounceability: Math.round(pronounce * 100) / 100,
- unusualRepeats,
- digitRatio: Math.round(digits * 100) / 100,
- hasDots,
- hasPlusTag,
- gibberishScore: Math.min(gibberishScore, 100),
- valid: true,
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/GeoIpAdapters.ts b/fluxer_api/src/api/risk/adapters/GeoIpAdapters.ts
deleted file mode 100644
index b2b055f4a..000000000
--- a/fluxer_api/src/api/risk/adapters/GeoIpAdapters.ts
+++ /dev/null
@@ -1,116 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {GeoIpAsnResult, GeoIpCityResult} from '@app/api/risk/RiskTypes';
-import {parseIpAddress} from '@fluxer/ip_utils/src/IpAddress';
-import type {GeoipAsnResult, GeoipResult} from '@pkgs/geoip/src/GeoipLookup';
-import type {IpInfoService} from '@pkgs/geoip/src/IpInfoService';
-
-interface GeoIpCityContext {
- ipInfoService: IpInfoService;
- lookupLocalCity?: (ip: string) => Promise<GeoipResult>;
-}
-
-interface GeoIpAsnContext {
- ipInfoService: IpInfoService;
- lookupLocalAsn?: (ip: string) => Promise<GeoipAsnResult>;
-}
-
-export function createGeoIpCityAdapter(ctx: GeoIpCityContext) {
- return async function lookupGeoIpCity(args: {ip: string}): Promise<GeoIpCityResult> {
- const ip = args.ip;
- const parsed = parseIpAddress(ip);
- if (!parsed) {
- return notFound(ip, true);
- }
- const local = ctx.lookupLocalCity ? await ctx.lookupLocalCity(parsed.normalized) : null;
- if (local && local.countryCode !== null) {
- return {
- ip,
- available: true,
- found: true,
- countryIso: local.countryCode,
- country: local.countryName,
- region: local.region,
- city: local.city,
- latitude: local.latitude ?? null,
- longitude: local.longitude ?? null,
- accuracyRadiusKm: local.accuracyRadiusKm ?? null,
- timeZone: local.timeZone ?? null,
- };
- }
- const info = await ctx.ipInfoService.lookup(parsed.normalized, {
- source: 'risk.geoip_city',
- reason: 'registration_risk',
- });
- if (!info.available) {
- return {
- ip,
- available: false,
- found: false,
- countryIso: null,
- country: null,
- region: null,
- city: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- timeZone: null,
- };
- }
- const geo = info.geo;
- const found = geo.countryCode !== null || geo.region !== null || geo.city !== null || geo.latitude !== null;
- return {
- ip,
- available: true,
- found,
- countryIso: geo.countryCode,
- country: geo.countryName,
- region: geo.region,
- city: geo.city,
- latitude: geo.latitude,
- longitude: geo.longitude,
- accuracyRadiusKm: geo.accuracyRadiusKm,
- timeZone: geo.timezone,
- };
- };
-}
-
-export function createGeoIpAsnAdapter(ctx: GeoIpAsnContext) {
- return async function lookupGeoIpAsn(args: {ip: string}): Promise<GeoIpAsnResult> {
- const ip = args.ip;
- const parsed = parseIpAddress(ip);
- if (!parsed) {
- return {ip, available: true, found: false, asn: null, asnOrg: null};
- }
- const local = ctx.lookupLocalAsn ? await ctx.lookupLocalAsn(parsed.normalized) : null;
- if (local && local.asn !== null) {
- return {ip, available: true, found: true, asn: local.asn, asnOrg: local.asnOrg};
- }
- const info = await ctx.ipInfoService.lookup(parsed.normalized, {
- source: 'risk.geoip_asn',
- reason: 'registration_risk',
- });
- if (!info.available) {
- return {ip, available: false, found: false, asn: null, asnOrg: null};
- }
- const {number, name} = info.asn;
- const found = number !== null || name !== null;
- return {ip, available: true, found, asn: number, asnOrg: name};
- };
-}
-
-function notFound(ip: string, available: boolean): GeoIpCityResult {
- return {
- ip,
- available,
- found: false,
- countryIso: null,
- country: null,
- region: null,
- city: null,
- latitude: null,
- longitude: null,
- accuracyRadiusKm: null,
- timeZone: null,
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/HistoricalOutcomeAdapter.ts b/fluxer_api/src/api/risk/adapters/HistoricalOutcomeAdapter.ts
deleted file mode 100644
index 01ac0bdc6..000000000
--- a/fluxer_api/src/api/risk/adapters/HistoricalOutcomeAdapter.ts
+++ /dev/null
@@ -1,183 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import type {HistoricalOutcomeRecord} from '@app/api/risk/RiskHistoryTypes';
-import type {HistoricalOutcomeResult} from '@app/api/risk/RiskTypes';
-import {getSubnet} from '@fluxer/ip_utils/src/IpAddress';
-
-const DEFAULT_LIST_LIMIT = 200;
-
-export interface HistoricalOutcomeAdapterContext {
- repository: IRiskHistoryRepository;
- now?: () => Date;
-}
-
-export function createHistoricalOutcomeAdapter(ctx: HistoricalOutcomeAdapterContext) {
- async function getHistoricalOutcomesByIp(args: {ip: string; windowHours: number}): Promise<HistoricalOutcomeResult> {
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listByIp(args.ip, since, DEFAULT_LIST_LIMIT);
- return summarize(args.ip, args.windowHours, records, DEFAULT_LIST_LIMIT);
- }
- async function getHistoricalOutcomesBySubnet(args: {
- ip: string;
- windowHours: number;
- }): Promise<HistoricalOutcomeResult> {
- const subnet = getSubnet(args.ip);
- if (!subnet) {
- return emptyResult(args.ip, args.windowHours, 'could not derive subnet from IP');
- }
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listBySubnet(subnet, since, DEFAULT_LIST_LIMIT);
- return summarize(subnet, args.windowHours, records, DEFAULT_LIST_LIMIT);
- }
- async function getHistoricalOutcomesByEmailDomain(args: {
- domain: string;
- windowHours: number;
- }): Promise<HistoricalOutcomeResult> {
- const domain = args.domain.toLowerCase().trim();
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listByEmailDomain(domain, since, DEFAULT_LIST_LIMIT);
- return summarize(domain, args.windowHours, records, DEFAULT_LIST_LIMIT);
- }
- async function getHistoricalOutcomesByAsn(args: {
- asn: number;
- windowHours: number;
- }): Promise<HistoricalOutcomeResult> {
- if (!Number.isFinite(args.asn) || args.asn <= 0) {
- return emptyResult(String(args.asn), args.windowHours, 'invalid ASN');
- }
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listByAsn(args.asn, since, DEFAULT_LIST_LIMIT);
- return summarize(`AS${args.asn}`, args.windowHours, records, DEFAULT_LIST_LIMIT);
- }
- return {
- getHistoricalOutcomesByIp,
- getHistoricalOutcomesBySubnet,
- getHistoricalOutcomesByEmailDomain,
- getHistoricalOutcomesByAsn,
- };
-}
-
-function getSinceTime(windowHours: number, nowProvider?: () => Date): Date {
- const now = nowProvider?.() ?? new Date();
- return new Date(now.getTime() - windowHours * 3600 * 1000);
-}
-
-function summarize(
- identifier: string,
- windowHours: number,
- records: ReadonlyArray<HistoricalOutcomeRecord>,
- limit: number,
-): HistoricalOutcomeResult {
- if (records.length === 0) {
- return emptyResult(identifier, windowHours, `no recorded outcomes in the last ${windowHours}h`);
- }
- const truncated = records.length >= limit;
- const byUser = new Map<
- string,
- {
- challenged: boolean;
- spammer: boolean;
- disabled: boolean;
- disabledSuspicious: boolean;
- }
- >();
- for (const record of records) {
- const current = byUser.get(record.userId) ?? {
- challenged: false,
- spammer: false,
- disabled: false,
- disabledSuspicious: false,
- };
- switch (record.outcomeCode) {
- case 'challenged':
- current.challenged = true;
- break;
- case 'spammer':
- current.spammer = true;
- break;
- case 'disabled':
- current.disabled = true;
- break;
- case 'disabled_suspicious':
- current.disabledSuspicious = true;
- break;
- }
- byUser.set(record.userId, current);
- }
- let challengedUsers = 0;
- let enforcedUsers = 0;
- let spammerUsers = 0;
- let disabledUsers = 0;
- let disabledSuspiciousUsers = 0;
- let adverseUsers = 0;
- for (const outcome of byUser.values()) {
- const enforced = outcome.spammer || outcome.disabled || outcome.disabledSuspicious;
- const adverse = outcome.challenged || enforced;
- if (outcome.challenged) challengedUsers++;
- if (outcome.spammer) spammerUsers++;
- if (outcome.disabled) disabledUsers++;
- if (outcome.disabledSuspicious) disabledSuspiciousUsers++;
- if (enforced) enforcedUsers++;
- if (adverse) adverseUsers++;
- }
- const observedUsers = byUser.size;
- return {
- identifier,
- windowHours,
- sampledRegistrations: records.length,
- truncated,
- sampledUsers: observedUsers,
- resolvedUsers: observedUsers,
- adverseUsers,
- challengedUsers,
- enforcedUsers,
- spammerUsers,
- disabledUsers,
- disabledSuspiciousUsers,
- riskNote: describeHistoricalOutcomes({
- windowHours,
- outcomeEvents: records.length,
- observedUsers,
- challengedUsers,
- enforcedUsers,
- truncated,
- }),
- };
-}
-
-function emptyResult(identifier: string, windowHours: number, note: string): HistoricalOutcomeResult {
- return {
- identifier,
- windowHours,
- sampledRegistrations: 0,
- truncated: false,
- sampledUsers: 0,
- resolvedUsers: 0,
- adverseUsers: 0,
- challengedUsers: 0,
- enforcedUsers: 0,
- spammerUsers: 0,
- disabledUsers: 0,
- disabledSuspiciousUsers: 0,
- riskNote: `historical_outcomes: ${note}`,
- };
-}
-
-function describeHistoricalOutcomes(args: {
- windowHours: number;
- outcomeEvents: number;
- observedUsers: number;
- challengedUsers: number;
- enforcedUsers: number;
- truncated: boolean;
-}): string {
- const sampleNote = args.truncated ? ' (sample truncated — true counts may be higher)' : '';
- if (args.enforcedUsers > 0) {
- return `${args.enforcedUsers} prior users hit enforcement in ${args.windowHours}h (${args.outcomeEvents} outcome events across ${args.observedUsers} users)${sampleNote}`;
- }
- if (args.challengedUsers > 0) {
- return `${args.challengedUsers} prior users later required verification in ${args.windowHours}h (${args.outcomeEvents} outcome events across ${args.observedUsers} users)${sampleNote}`;
- }
- return `historical outcomes recorded ${args.outcomeEvents} times across ${args.observedUsers} users in ${args.windowHours}h${sampleNote}`;
-}
diff --git a/fluxer_api/src/api/risk/adapters/IpInfoAdapter.ts b/fluxer_api/src/api/risk/adapters/IpInfoAdapter.ts
deleted file mode 100644
index 3541f20a5..000000000
--- a/fluxer_api/src/api/risk/adapters/IpInfoAdapter.ts
+++ /dev/null
@@ -1,96 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {isAccountPolicyEducationOrganizationName} from '@app/api/risk/AccountPolicyService';
-import type {IpInfoPrescreenVerdict} from '@app/api/risk/RegistrationIpPrescreen';
-import type {IpConnectionType, IpInfoAnonymousResult} from '@app/api/risk/RiskTypes';
-import type {IpInfoService} from '@pkgs/geoip/src/IpInfoService';
-
-interface IpInfoCheckerContext {
- ipInfoService: IpInfoService;
- prescreen?: (ip: string) => Promise<IpInfoPrescreenVerdict>;
-}
-
-export function unavailableIpInfoAnonymousResult(ip: string, riskNote: string): IpInfoAnonymousResult {
- return {
- ip,
- available: false,
- isAnonymous: false,
- providerName: null,
- isVpn: false,
- isProxy: false,
- isResidentialProxy: false,
- isTor: false,
- isRelay: false,
- isHosting: false,
- isMobile: false,
- asnType: null,
- asnOrg: null,
- connectionType: 'unknown',
- percentDaysSeen: null,
- riskNote,
- };
-}
-
-export function createIpInfoChecker(ctx: IpInfoCheckerContext) {
- return async function checkIpInfo(ip: string): Promise<IpInfoAnonymousResult> {
- if (ctx.prescreen && (await ctx.prescreen(ip)) === 'skip') {
- return unavailableIpInfoAnonymousResult(ip, 'IPInfo skipped (local pre-screen)');
- }
- const result = await ctx.ipInfoService.lookup(ip, {
- source: 'risk.ipinfo_checker',
- reason: 'registration_risk',
- });
- const isMobile = result.flags.isMobile;
- const asnType = result.asn.type;
- const asnOrg = result.asn.name;
- return {
- ip: result.ip,
- available: result.available,
- isAnonymous: result.anonymous.isAnonymous,
- providerName: result.anonymous.providerName,
- isVpn: result.anonymous.isVpn,
- isProxy: result.anonymous.isProxy,
- isResidentialProxy: result.anonymous.isResidentialProxy,
- isTor: result.anonymous.isTor,
- isRelay: result.anonymous.isRelay,
- isHosting: result.flags.isHosting,
- isMobile,
- asnType,
- asnOrg,
- connectionType: deriveConnectionType({
- available: result.available,
- isResidentialProxy: result.anonymous.isResidentialProxy,
- isHosting: result.flags.isHosting,
- isMobile,
- asnType,
- asnOrg,
- }),
- percentDaysSeen: result.anonymous.percentDaysSeen,
- riskNote: result.riskNote,
- };
- };
-}
-
-function deriveConnectionType(args: {
- available: boolean;
- isResidentialProxy: boolean;
- isHosting: boolean;
- isMobile: boolean;
- asnType: string | null;
- asnOrg: string | null;
-}): IpConnectionType {
- if (!args.available) return 'unknown';
- if (args.isResidentialProxy) return 'residential_proxy';
- const asnType = args.asnType?.toLowerCase() ?? null;
- if (args.isHosting || asnType === 'hosting') return 'data_center';
- if (args.isMobile || asnType === 'mobile') return 'mobile';
- if (asnType === 'education' || matchesEducationOrg(args.asnOrg)) {
- return 'education';
- }
- if (asnType === 'business' || asnType === 'corporate') return 'corporate';
- return 'residential';
-}
-
-function matchesEducationOrg(org: string | null): boolean {
- return isAccountPolicyEducationOrganizationName(org);
-}
diff --git a/fluxer_api/src/api/risk/adapters/LocaleGeoMatcher.ts b/fluxer_api/src/api/risk/adapters/LocaleGeoMatcher.ts
deleted file mode 100644
index dae7504c3..000000000
--- a/fluxer_api/src/api/risk/adapters/LocaleGeoMatcher.ts
+++ /dev/null
@@ -1,180 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {LocaleGeoMatchResult} from '@app/api/risk/RiskTypes';
-
-const LOCALE_TO_COUNTRIES: Record<string, ReadonlyArray<string>> = {
- 'en-us': ['US', 'PR', 'GU', 'VI', 'AS', 'MP'],
- 'en-gb': ['GB', 'IM', 'JE', 'GG'],
- 'en-au': ['AU'],
- 'en-ca': ['CA'],
- 'en-nz': ['NZ'],
- 'en-in': ['IN'],
- 'en-ie': ['IE'],
- 'en-za': ['ZA'],
- 'fr-fr': ['FR', 'MC'],
- 'fr-ca': ['CA'],
- 'fr-be': ['BE'],
- 'fr-ch': ['CH'],
- 'de-de': ['DE'],
- 'de-at': ['AT'],
- 'de-ch': ['CH'],
- 'de-li': ['LI'],
- 'es-es': ['ES'],
- 'es-mx': ['MX'],
- 'es-ar': ['AR'],
- 'es-419': ['MX', 'AR', 'CL', 'CO', 'PE', 'UY', 'VE', 'BO', 'EC', 'PY', 'CR', 'PA', 'DO', 'GT', 'HN', 'NI', 'SV'],
- 'pt-br': ['BR'],
- 'pt-pt': ['PT'],
- 'ja-jp': ['JP'],
- 'ko-kr': ['KR'],
- 'zh-cn': ['CN'],
- 'zh-tw': ['TW'],
- 'zh-hk': ['HK'],
- 'zh-sg': ['SG'],
- 'ru-ru': ['RU'],
- 'ar-sa': ['SA'],
- 'ar-eg': ['EG'],
- 'ar-ae': ['AE'],
- 'hi-in': ['IN'],
- 'it-it': ['IT', 'SM', 'VA'],
- 'nl-nl': ['NL'],
- 'nl-be': ['BE'],
- 'pl-pl': ['PL'],
- 'tr-tr': ['TR'],
- 'vi-vn': ['VN'],
- 'th-th': ['TH'],
- 'uk-ua': ['UA'],
- 'sv-se': ['SE'],
- 'da-dk': ['DK'],
- 'nb-no': ['NO'],
- 'nn-no': ['NO'],
- 'fi-fi': ['FI'],
- 'cs-cz': ['CZ'],
- 'sk-sk': ['SK'],
- 'hu-hu': ['HU'],
- 'ro-ro': ['RO'],
- 'bg-bg': ['BG'],
- 'el-gr': ['GR'],
- 'he-il': ['IL'],
- 'id-id': ['ID'],
- 'ms-my': ['MY'],
- 'fil-ph': ['PH'],
- 'lt-lt': ['LT'],
- 'lv-lv': ['LV'],
- 'et-ee': ['EE'],
- 'sl-si': ['SI'],
- 'hr-hr': ['HR'],
- 'sr-rs': ['RS'],
- 'mk-mk': ['MK'],
- 'sq-al': ['AL'],
- 'ka-ge': ['GE'],
- 'hy-am': ['AM'],
- 'az-az': ['AZ'],
- 'kk-kz': ['KZ'],
- 'uz-uz': ['UZ'],
- 'bn-bd': ['BD'],
- 'ur-pk': ['PK'],
- tr: ['TR'],
- ru: ['RU', 'BY'],
- pl: ['PL'],
- cs: ['CZ'],
- hu: ['HU'],
- ro: ['RO'],
- bg: ['BG'],
- el: ['GR', 'CY'],
- he: ['IL'],
- id: ['ID'],
- uk: ['UA'],
- sv: ['SE'],
- da: ['DK'],
- fi: ['FI'],
- sk: ['SK'],
- hr: ['HR'],
- sr: ['RS'],
- sl: ['SI'],
- lt: ['LT'],
- lv: ['LV'],
- et: ['EE'],
- sq: ['AL', 'XK'],
- ka: ['GE'],
- hy: ['AM'],
- az: ['AZ'],
- kk: ['KZ'],
- uz: ['UZ'],
- bn: ['BD', 'IN'],
- ur: ['PK'],
- hi: ['IN'],
- it: ['IT', 'SM', 'VA', 'CH'],
- nl: ['NL', 'BE', 'SR'],
- pt: ['PT', 'BR'],
- de: ['DE', 'AT', 'CH', 'LI'],
- fr: ['FR', 'BE', 'CH', 'CA', 'MC', 'LU'],
-};
-const SINGLE_COUNTRY_LANGUAGES: Record<string, ReadonlyArray<string>> = {
- ja: ['JP'],
- ko: ['KR'],
- th: ['TH'],
- vi: ['VN'],
- tr: ['TR'],
- pl: ['PL'],
- cs: ['CZ'],
- hu: ['HU'],
- fi: ['FI'],
- he: ['IL'],
- ro: ['RO'],
- bg: ['BG'],
- sk: ['SK'],
- lt: ['LT'],
- lv: ['LV'],
- et: ['EE'],
- ka: ['GE'],
- hy: ['AM'],
- kk: ['KZ'],
- az: ['AZ'],
- sq: ['AL', 'XK'],
-};
-
-export async function checkGeoVsLocale(args: {
- geoipCountryIso: string | null;
- registrationLocale: string | null;
- registrationTimezone: string | null;
-}): Promise<LocaleGeoMatchResult> {
- const notes: Array<string> = [];
- let localeGeoMatch: boolean | null = null;
- let mismatchDetected = false;
- const country = args.geoipCountryIso?.toUpperCase() ?? null;
- const locale = args.registrationLocale?.toLowerCase() ?? null;
- if (locale && country) {
- const expected = LOCALE_TO_COUNTRIES[locale];
- if (expected) {
- localeGeoMatch = expected.includes(country);
- if (!localeGeoMatch) {
- mismatchDetected = true;
- notes.push(`locale ${locale} expects ${expected.join('/')} but GeoIP reports ${country}`);
- } else {
- notes.push(`locale ${locale} matches GeoIP country ${country}`);
- }
- } else {
- const lang = locale.split('-')[0] ?? '';
- const strict = SINGLE_COUNTRY_LANGUAGES[lang];
- if (strict && !strict.includes(country)) {
- mismatchDetected = true;
- localeGeoMatch = false;
- notes.push(`language ${lang} is nearly single-country (${strict.join('/')}) but GeoIP is ${country}`);
- } else {
- notes.push(`locale ${locale} not in lookup table; no mismatch asserted`);
- }
- }
- } else {
- notes.push('insufficient data to compare locale vs geoip');
- }
- return {
- geoipCountryIso: country,
- registrationLocale: locale,
- registrationTimezone: args.registrationTimezone ?? null,
- localeGeoMatch,
- timezoneGeoMatch: null,
- mismatchDetected,
- notes,
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/RegistrationTimingAnalyzer.ts b/fluxer_api/src/api/risk/adapters/RegistrationTimingAnalyzer.ts
deleted file mode 100644
index 9e30e9047..000000000
--- a/fluxer_api/src/api/risk/adapters/RegistrationTimingAnalyzer.ts
+++ /dev/null
@@ -1,126 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {RegistrationTimingResult} from '@app/api/risk/RiskTypes';
-
-const TZ_OFFSETS: Record<string, number> = {
- 'Pacific/Midway': -11,
- 'Pacific/Honolulu': -10,
- 'America/Anchorage': -9,
- 'America/Los_Angeles': -8,
- 'America/Denver': -7,
- 'America/Chicago': -6,
- 'America/New_York': -5,
- 'America/Halifax': -4,
- 'America/Sao_Paulo': -3,
- 'Atlantic/South_Georgia': -2,
- 'Atlantic/Azores': -1,
- 'Europe/London': 0,
- UTC: 0,
- 'Europe/Paris': 1,
- 'Europe/Berlin': 1,
- 'Europe/Rome': 1,
- 'Europe/Madrid': 1,
- 'Europe/Amsterdam': 1,
- 'Europe/Brussels': 1,
- 'Europe/Vienna': 1,
- 'Europe/Warsaw': 1,
- 'Europe/Zurich': 1,
- 'Europe/Stockholm': 1,
- 'Europe/Oslo': 1,
- 'Europe/Copenhagen': 1,
- 'Europe/Prague': 1,
- 'Africa/Lagos': 1,
- 'Africa/Casablanca': 1,
- 'Europe/Athens': 2,
- 'Europe/Bucharest': 2,
- 'Europe/Helsinki': 2,
- 'Europe/Istanbul': 3,
- 'Europe/Moscow': 3,
- 'Asia/Riyadh': 3,
- 'Asia/Tehran': 3.5,
- 'Asia/Dubai': 4,
- 'Asia/Kabul': 4.5,
- 'Asia/Karachi': 5,
- 'Asia/Kolkata': 5.5,
- 'Asia/Kathmandu': 5.75,
- 'Asia/Dhaka': 6,
- 'Asia/Rangoon': 6.5,
- 'Asia/Bangkok': 7,
- 'Asia/Ho_Chi_Minh': 7,
- 'Asia/Jakarta': 7,
- 'Asia/Shanghai': 8,
- 'Asia/Hong_Kong': 8,
- 'Asia/Singapore': 8,
- 'Asia/Taipei': 8,
- 'Asia/Kuala_Lumpur': 8,
- 'Australia/Perth': 8,
- 'Asia/Tokyo': 9,
- 'Asia/Seoul': 9,
- 'Australia/Adelaide': 9.5,
- 'Australia/Sydney': 10,
- 'Australia/Melbourne': 10,
- 'Australia/Brisbane': 10,
- 'Pacific/Auckland': 12,
- 'Europe/Bratislava': 1,
- 'Europe/Simferopol': 3,
- 'Europe/Kyiv': 2,
- 'Europe/Vilnius': 2,
- 'Europe/Riga': 2,
- 'Europe/Tallinn': 2,
- 'Asia/Almaty': 6,
- 'Asia/Tashkent': 5,
- 'Asia/Tbilisi': 4,
- 'Asia/Yerevan': 4,
- 'Asia/Baku': 4,
- 'America/Toronto': -5,
- 'America/Vancouver': -8,
- 'America/Winnipeg': -6,
- 'America/Edmonton': -7,
- 'America/Mexico_City': -6,
- 'America/Bogota': -5,
- 'America/Lima': -5,
- 'America/Santiago': -4,
- 'America/Buenos_Aires': -3,
- 'America/Argentina/Buenos_Aires': -3,
- 'Africa/Algiers': 1,
- 'Africa/Cairo': 2,
- 'Africa/Johannesburg': 2,
- 'Africa/Nairobi': 3,
-};
-
-export function analyzeRegistrationTiming(args: {timezone: string | null}): RegistrationTimingResult {
- const tz = args.timezone;
- if (!tz) {
- return {
- timezone: null,
- localHour: null,
- isSuspiciousHour: false,
- riskNote: 'no timezone available — timing analysis skipped',
- };
- }
- const offset = TZ_OFFSETS[tz];
- if (offset === undefined) {
- return {
- timezone: tz,
- localHour: null,
- isSuspiciousHour: false,
- riskNote: `timezone "${tz}" not in offset table — timing analysis skipped`,
- };
- }
- const nowUtc = new Date();
- const localHour = (nowUtc.getUTCHours() + offset + 24) % 24;
- const roundedHour = Math.floor(localHour);
- const isSuspicious = roundedHour >= 2 && roundedHour < 5;
- let riskNote: string;
- if (isSuspicious) {
- riskNote = `registration at ~${roundedHour}:00 local time (${tz}) — unusual hour for organic signups`;
- } else {
- riskNote = `registration at ~${roundedHour}:00 local time (${tz}) — normal hours`;
- }
- return {
- timezone: tz,
- localHour: roundedHour,
- isSuspiciousHour: isSuspicious,
- riskNote,
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/ReverseDnsAdapter.ts b/fluxer_api/src/api/risk/adapters/ReverseDnsAdapter.ts
deleted file mode 100644
index eab880bbd..000000000
--- a/fluxer_api/src/api/risk/adapters/ReverseDnsAdapter.ts
+++ /dev/null
@@ -1,26 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {classifyAccountPolicyReverseDnsHostname} from '@app/api/risk/AccountPolicyService';
-import type {ReverseDnsResult} from '@app/api/risk/RiskTypes';
-import {getIpAddressReverse} from '@app/api/utils/IpUtils';
-import type {ICacheService} from '@pkgs/cache/src/ICacheService';
-
-interface ReverseDnsAdapterContext {
- cacheService?: ICacheService;
- resolver?: (ip: string) => Promise<string | null>;
- timeoutMs?: number;
-}
-
-export function createReverseDnsLookup(ctx: ReverseDnsAdapterContext = {}) {
- const timeoutMs = ctx.timeoutMs ?? 500;
- return async function lookupReverseDns(ip: string): Promise<ReverseDnsResult> {
- const hostname = ctx.resolver
- ? await ctx.resolver(ip)
- : await getIpAddressReverse(ip, ctx.cacheService, {timeoutMs});
- return {
- ip,
- hostname,
- classification: classifyAccountPolicyReverseDnsHostname(hostname),
- };
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/TorReverseDnsChecker.ts b/fluxer_api/src/api/risk/adapters/TorReverseDnsChecker.ts
deleted file mode 100644
index 91781264f..000000000
--- a/fluxer_api/src/api/risk/adapters/TorReverseDnsChecker.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-const TOR_HOSTNAME_PATTERNS: ReadonlyArray<{
- pattern: RegExp;
- label: string;
-}> = [
- {pattern: /(^|[.-])tor[.-]?exit(\d+)?([.-]|$)/i, label: 'tor-exit'},
- {pattern: /(^|[.-])exit[.-]?tor([.-]|$)/i, label: 'exit-tor'},
- {pattern: /(^|[.-])torexit(\d+)?([.-]|$)/i, label: 'torexit'},
- {pattern: /(^|[.-])tor[.-]?relay([.-]|$)/i, label: 'tor-relay'},
- {pattern: /(^|[.-])tor[.-]?node(\d+)?([.-]|$)/i, label: 'tor-node'},
- {pattern: /(^|[.-])tor[.-]?srv([.-]|$)/i, label: 'tor-srv'},
- {pattern: /(^|[.-])torsrv(\d+)?([.-]|$)/i, label: 'torsrv'},
- {pattern: /(^|[.-])torproject([.-]|$)/i, label: 'torproject'},
- {pattern: /\.tor\./i, label: 'dotted-tor'},
- {pattern: /(^|[.-])anonymi[sz]er([.-]|$)/i, label: 'anonymiser'},
- {pattern: /(^|[.-])anon[.-]?proxy([.-]|$)/i, label: 'anon-proxy'},
- {pattern: /^tor\d+\./i, label: 'tor-numbered'},
-];
-
-export function matchTorHostname(hostname: string): {
- label: string;
-} | null {
- for (const {pattern, label} of TOR_HOSTNAME_PATTERNS) {
- if (pattern.test(hostname)) return {label};
- }
- return null;
-}
diff --git a/fluxer_api/src/api/risk/adapters/UserAgentAnalyzer.ts b/fluxer_api/src/api/risk/adapters/UserAgentAnalyzer.ts
deleted file mode 100644
index 52264b938..000000000
--- a/fluxer_api/src/api/risk/adapters/UserAgentAnalyzer.ts
+++ /dev/null
@@ -1,141 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {UserAgentResult} from '@app/api/risk/RiskTypes';
-
-const BOT_PATTERNS: ReadonlyArray<RegExp> = [
- /\bbot\b/i,
- /\bcrawler\b/i,
- /\bspider\b/i,
- /\bscraper\b/i,
- /\bcurl\b/i,
- /\bwget\b/i,
- /\bhttpx\b/i,
- /\bpython[-\s]?requests\b/i,
- /\bnode[-\s]?fetch\b/i,
- /\bgot\b\/\d/i,
- /\baxios\b/i,
- /\bgo[-\s]?http[-\s]?client\b/i,
- /\bjava\b.*\bhttp\b/i,
- /\bphp\b/i,
- /\bperl\b/i,
- /\bruby\b/i,
- /\baiohttp\b/i,
- /\bscrapy\b/i,
- /\bpostman\b/i,
- /\binsomnia\b/i,
- /\bthunder\s*client\b/i,
-];
-const HEADLESS_PATTERNS: ReadonlyArray<RegExp> = [
- /\bHeadlessChrome\b/i,
- /\bHeadless\b/i,
- /\bPhantomJS\b/i,
- /\bSlimerJS\b/i,
- /\bNightmare\b/i,
-];
-const AUTOMATION_PATTERNS: ReadonlyArray<RegExp> = [
- /\bSelenium\b/i,
- /\bWebDriver\b/i,
- /\bPuppeteer\b/i,
- /\bPlaywright\b/i,
- /\bCypress\b/i,
- /\bTestCafe\b/i,
- /\bAppium\b/i,
- /\bautomation\b/i,
-];
-const OUTDATED_CHROME_MAJOR = 110;
-const OUTDATED_FIREFOX_MAJOR = 110;
-const CHROME_VERSION_RE = /Chrome\/(\d+)/;
-const FIREFOX_VERSION_RE = /Firefox\/(\d+)/;
-const SAFARI_VERSION_RE = /Version\/(\d+)\.\d.*Safari/;
-
-function matchesAny(ua: string, patterns: ReadonlyArray<RegExp>): boolean {
- return patterns.some((p) => p.test(ua));
-}
-
-function detectBrowser(ua: string): {
- browser: string;
- version: string | null;
-} {
- if (/Edg\/(\d[\d.]+)/.test(ua)) return {browser: 'Edge', version: RegExp.$1};
- if (/OPR\/(\d[\d.]+)/.test(ua)) return {browser: 'Opera', version: RegExp.$1};
- if (/Vivaldi\/(\d[\d.]+)/.test(ua)) return {browser: 'Vivaldi', version: RegExp.$1};
- if (/Brave/.test(ua) && CHROME_VERSION_RE.test(ua)) return {browser: 'Brave', version: RegExp.$1};
- if (/SamsungBrowser\/(\d[\d.]+)/.test(ua)) return {browser: 'Samsung Internet', version: RegExp.$1};
- if (CHROME_VERSION_RE.test(ua)) return {browser: 'Chrome', version: RegExp.$1};
- if (FIREFOX_VERSION_RE.test(ua)) return {browser: 'Firefox', version: RegExp.$1};
- if (SAFARI_VERSION_RE.test(ua)) return {browser: 'Safari', version: RegExp.$1};
- if (/MSIE|Trident/.test(ua)) return {browser: 'Internet Explorer', version: null};
- return {browser: 'unknown', version: null};
-}
-
-function detectOs(ua: string): string {
- if (/Windows NT 10/.test(ua)) return 'Windows 10/11';
- if (/Windows NT/.test(ua)) return 'Windows (older)';
- if (/Mac OS X/.test(ua)) return 'macOS';
- if (/CrOS/.test(ua)) return 'ChromeOS';
- if (/Android/.test(ua)) return 'Android';
- if (/iPhone|iPad|iPod/.test(ua)) return 'iOS';
- if (/Linux/.test(ua)) return 'Linux';
- return 'unknown';
-}
-
-function isOutdated(ua: string): boolean {
- const chromeMatch = ua.match(CHROME_VERSION_RE);
- if (chromeMatch) {
- const major = Number.parseInt(chromeMatch[1]!, 10);
- if (major > 0 && major < OUTDATED_CHROME_MAJOR) return true;
- }
- const firefoxMatch = ua.match(FIREFOX_VERSION_RE);
- if (firefoxMatch) {
- const major = Number.parseInt(firefoxMatch[1]!, 10);
- if (major > 0 && major < OUTDATED_FIREFOX_MAJOR) return true;
- }
- if (/MSIE|Trident/.test(ua)) return true;
- return false;
-}
-
-export function analyzeUserAgent(args: {userAgent: string}): UserAgentResult {
- const ua = args.userAgent;
- if (!ua || ua.length === 0) {
- return {
- raw: '',
- browser: 'missing',
- browserVersion: null,
- os: 'unknown',
- isBot: true,
- isHeadless: false,
- isAutomation: false,
- isOutdated: false,
- suspiciousPatterns: ['empty user-agent'],
- riskNote: 'User-Agent header is missing or empty — likely a script or bot',
- };
- }
- const isBot = matchesAny(ua, BOT_PATTERNS);
- const isHeadless = matchesAny(ua, HEADLESS_PATTERNS);
- const isAutomation = matchesAny(ua, AUTOMATION_PATTERNS);
- const outdated = isOutdated(ua);
- const {browser, version} = detectBrowser(ua);
- const os = detectOs(ua);
- const suspiciousPatterns: Array<string> = [];
- if (isBot) suspiciousPatterns.push('known bot/scraper user-agent');
- if (isHeadless) suspiciousPatterns.push('headless browser detected');
- if (isAutomation) suspiciousPatterns.push('automation framework detected');
- if (outdated) suspiciousPatterns.push('very outdated browser version');
- if (ua.length < 30 && !isBot) suspiciousPatterns.push('unusually short user-agent');
- let riskNote = 'no suspicious user-agent patterns';
- if (suspiciousPatterns.length > 0) {
- riskNote = suspiciousPatterns.join('; ');
- }
- return {
- raw: ua.length > 300 ? `${ua.slice(0, 300)}...` : ua,
- browser,
- browserVersion: version,
- os,
- isBot,
- isHeadless,
- isAutomation,
- isOutdated: outdated,
- suspiciousPatterns,
- riskNote,
- };
-}
diff --git a/fluxer_api/src/api/risk/adapters/VelocityAdapter.ts b/fluxer_api/src/api/risk/adapters/VelocityAdapter.ts
deleted file mode 100644
index 394fc2a5d..000000000
--- a/fluxer_api/src/api/risk/adapters/VelocityAdapter.ts
+++ /dev/null
@@ -1,131 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {VelocityResult} from '@app/api/risk/RiskTypes';
-import {getSubnet} from '@fluxer/ip_utils/src/IpAddress';
-
-export interface RegistrationEventRecord {
- userId: string;
- email: string | null;
- emailDomain: string | null;
- ip: string;
- locale: string | null;
- createdAt: Date;
-}
-
-export interface IRegistrationEventsRepository {
- recordEvent(event: RegistrationEventRecord): Promise<void>;
- listByIp(ip: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<RegistrationEventRecord>>;
- listBySubnet(subnet: string, sinceTime: Date, limit: number): Promise<ReadonlyArray<RegistrationEventRecord>>;
- listByPlusAddressBase(
- plusAddressBase: string,
- sinceTime: Date,
- limit: number,
- ): Promise<ReadonlyArray<RegistrationEventRecord>>;
- listByEmailDomain(
- emailDomain: string,
- sinceTime: Date,
- limit: number,
- ): Promise<ReadonlyArray<RegistrationEventRecord>>;
-}
-
-const DEFAULT_LIST_LIMIT = 100;
-
-interface VelocityAdapterContext {
- repository: IRegistrationEventsRepository;
- now?: () => Date;
-}
-
-export function createVelocityAdapter(ctx: VelocityAdapterContext) {
- async function getRegistrationsByIp(args: {ip: string; windowHours: number}): Promise<VelocityResult> {
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listByIp(args.ip, since, DEFAULT_LIST_LIMIT);
- return summarize(args.ip, args.windowHours, records, 'ip', DEFAULT_LIST_LIMIT);
- }
- async function getRegistrationsBySubnet(args: {ip: string; windowHours: number}): Promise<VelocityResult> {
- const subnet = getSubnet(args.ip);
- if (!subnet) {
- return emptyResult(args.ip, args.windowHours, 'subnet', 'could not derive subnet from IP');
- }
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listBySubnet(subnet, since, DEFAULT_LIST_LIMIT);
- return summarize(subnet, args.windowHours, records, 'subnet', DEFAULT_LIST_LIMIT);
- }
- async function getRegistrationsByEmailDomain(args: {domain: string; windowHours: number}): Promise<VelocityResult> {
- const domain = args.domain.toLowerCase().trim();
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listByEmailDomain(domain, since, DEFAULT_LIST_LIMIT);
- return summarize(domain, args.windowHours, records, 'email_domain', DEFAULT_LIST_LIMIT);
- }
- async function getRegistrationsByPlusAddressBase(args: {
- plusAddressBase: string;
- windowHours: number;
- }): Promise<VelocityResult> {
- const plusAddressBase = args.plusAddressBase.toLowerCase().trim();
- const since = getSinceTime(args.windowHours, ctx.now);
- const records = await ctx.repository.listByPlusAddressBase(plusAddressBase, since, DEFAULT_LIST_LIMIT);
- return summarize(plusAddressBase, args.windowHours, records, 'plus_address_base', DEFAULT_LIST_LIMIT);
- }
- return {
- getRegistrationsByIp,
- getRegistrationsBySubnet,
- getRegistrationsByEmailDomain,
- getRegistrationsByPlusAddressBase,
- };
-}
-
-function getSinceTime(windowHours: number, nowProvider?: () => Date): Date {
- const now = nowProvider?.() ?? new Date();
- return new Date(now.getTime() - windowHours * 3600 * 1000);
-}
-
-function summarize(
- identifier: string,
- windowHours: number,
- records: ReadonlyArray<RegistrationEventRecord>,
- kind: 'ip' | 'subnet' | 'email_domain' | 'plus_address_base',
- limit: number,
-): VelocityResult {
- const truncated = records.length >= limit;
- const uniqueEmails = new Set<string>();
- const uniqueLocales = new Set<string>();
- const uniqueIps = new Set<string>();
- for (const r of records) {
- if (r.email) uniqueEmails.add(r.email.toLowerCase());
- if (r.locale) uniqueLocales.add(r.locale);
- uniqueIps.add(r.ip);
- }
- return {
- identifier,
- windowHours,
- totalRegistrations: records.length,
- truncated,
- uniqueEmails: uniqueEmails.size,
- uniqueLocales: [...uniqueLocales],
- uniqueIps: uniqueIps.size,
- riskNote: describeVelocity(records.length, windowHours, kind, uniqueIps.size, truncated),
- };
-}
-
-function emptyResult(identifier: string, windowHours: number, kind: string, note: string): VelocityResult {
- return {
- identifier,
- windowHours,
- totalRegistrations: 0,
- truncated: false,
- uniqueEmails: 0,
- uniqueLocales: [],
- uniqueIps: 0,
- riskNote: `${kind}: ${note}`,
- };
-}
-
-function describeVelocity(count: number, hours: number, kind: string, uniqueIps: number, truncated: boolean): string {
- const atLeast = truncated ? 'at least ' : '';
- if (count === 0) return `${kind}: no prior registrations in the last ${hours}h — clean`;
- if (count <= 2) return `${kind}: ${count} registrations in the last ${hours}h — normal`;
- if (count <= 5) return `${kind}: ${count} registrations in the last ${hours}h — elevated`;
- if (kind === 'subnet') {
- return `${kind}: ${atLeast}${count} registrations across ${uniqueIps}+ IPs in ${hours}h — high, likely coordinated`;
- }
- return `${kind}: ${atLeast}${count} registrations in the last ${hours}h — high, likely signup farm`;
-}
diff --git a/fluxer_api/src/api/rpc/RpcService.ts b/fluxer_api/src/api/rpc/RpcService.ts
index 408c2b43e..5ed22f553 100644
--- a/fluxer_api/src/api/rpc/RpcService.ts
+++ b/fluxer_api/src/api/rpc/RpcService.ts
@@ -68,9 +68,9 @@ import {
timeRpcStepSync,
} from '@app/api/rpc/RpcTimings';
import type {IUserRepository} from '@app/api/user/IUserRepository';
-import {PaymentRepository} from '@app/api/user/repositories/PaymentRepository';
import {CustomStatusValidator} from '@app/api/user/services/CustomStatusValidator';
import {getCachedUserPartialResponse} from '@app/api/user/UserCacheHelpers';
+import {isSignInRefused} from '@app/api/user/UserHelpers';
import {
mapRelationshipToResponse,
mapUserGuildSettingsToResponse,
@@ -270,7 +270,6 @@ export class RpcService {
userCacheService: this.userCacheService,
gatewayService: this.gatewayService,
discriminatorService: this.discriminatorService,
- paymentRepository: new PaymentRepository(),
});
}
@@ -978,6 +977,10 @@ export class RpcService {
);
throw new UnauthorizedError();
}
+ if (tokenType === 'user' && isSignInRefused(userData.user)) {
+ Logger.warn({tokenType, tokenHashPrefix, userId: userId.toString()}, 'RPC session rejected by account standing');
+ throw new UnauthorizedError();
+ }
let user = userData.user;
if (user.avatarHash && user.avatarColor == null) {
const avatarRepairSteps: RpcTimingSteps = {};
diff --git a/fluxer_api/src/api/rpc/RpcSessionStartService.ts b/fluxer_api/src/api/rpc/RpcSessionStartService.ts
index 7e70314d9..f9a4c34e3 100644
--- a/fluxer_api/src/api/rpc/RpcSessionStartService.ts
+++ b/fluxer_api/src/api/rpc/RpcSessionStartService.ts
@@ -1,18 +1,16 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import {Config} from '@app/api/Config';
import type {UserRow} from '@app/api/database/types/UserTypes';
import {mapGuildMemberToResponse} from '@app/api/guild/GuildModel';
import type {IGuildRepositoryAggregate} from '@app/api/guild/repositories/IGuildRepositoryAggregate';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
import type {IDiscriminatorService} from '@app/api/infrastructure/DiscriminatorService';
import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import {Logger} from '@app/api/Logger';
import type {RequestCache} from '@app/api/middleware/RequestCacheMiddleware';
import type {User} from '@app/api/models/User';
-import {countryRequiresInboundPhoneVerification, phoneFlaggingAllowedForCountry} from '@app/api/risk/AbusePolicy';
import {
- createRpcTimingNode,
RpcTimingRecorder,
type RpcTimingSteps,
startRpcTiming,
@@ -21,23 +19,12 @@ import {
} from '@app/api/rpc/RpcTimings';
import type {UserData} from '@app/api/rpc/RpcTypes';
import type {IUserRepository} from '@app/api/user/IUserRepository';
-import type {PaymentRepository} from '@app/api/user/repositories/PaymentRepository';
import {createPremiumClearPatch, shouldStripExpiredPremium} from '@app/api/user/UserHelpers';
import {mapUserToPrivateResponse} from '@app/api/user/UserMappers';
-import {
- DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- imposePhoneRequirements,
- PremiumFlags,
- SuspiciousActivityFlags,
- UserFlags,
-} from '@fluxer/constants/src/UserConstants';
+import {PremiumFlags, UserFlags} from '@fluxer/constants/src/UserConstants';
import type {RpcSessionTimings} from '@fluxer/schema/src/domains/rpc/RpcSchemas';
-interface SessionStartUserRepository
- extends Pick<
- IUserRepository,
- 'recordCountrySighting' | 'patchUpsert' | 'hasCountrySightingOutsideSet' | 'listUserIdsByLastActiveIp' | 'listUsers'
- > {}
+interface SessionStartUserRepository extends Pick<IUserRepository, 'patchUpsert'> {}
interface SessionStartGuildRepository extends Pick<IGuildRepositoryAggregate, 'getMember' | 'upsertMember'> {}
@@ -48,15 +35,12 @@ interface SessionStartGatewayService extends Pick<IGatewayService, 'dispatchGuil
interface SessionStartDiscriminatorService extends Pick<IDiscriminatorService, 'generateDiscriminator'> {}
-interface SessionStartPaymentRepository extends Pick<PaymentRepository, 'hasEverPaidSuccessfully'> {}
-
interface SessionStartDeps {
userRepository: SessionStartUserRepository;
guildRepository: SessionStartGuildRepository;
userCacheService: SessionStartUserCacheService;
gatewayService: SessionStartGatewayService;
discriminatorService: SessionStartDiscriminatorService;
- paymentRepository: SessionStartPaymentRepository;
}
interface ProcessSessionStartParams {
@@ -79,25 +63,20 @@ export class RpcSessionStartService {
const timings = new RpcTimingRecorder();
const {userData, requestCache, geoipCountryIso, clientIp} = params;
let user = userData.user;
- if (!user.isBot && geoipCountryIso) {
- timings.timeSync('queue_country_sighting_record', () => {
- this.recordCountrySightingInBackground(user, geoipCountryIso);
- });
- }
- const inboundPhonePolicySteps: RpcTimingSteps = {};
- const inboundPhonePolicyStartedAtNs = startRpcTiming();
- const inboundPhoneApplied = await this.applyConfiguredCountryInboundPhoneRequirement({
- user,
- geoipCountryIso,
- clientIp,
- timingSteps: inboundPhonePolicySteps,
- });
- timings.record('apply_country_inbound_phone_requirement', inboundPhonePolicyStartedAtNs, inboundPhonePolicySteps);
- if (inboundPhoneApplied) {
- user = inboundPhoneApplied;
- userData.user = inboundPhoneApplied;
- this.deps.userCacheService.setUserPartialResponseFromUserInBackground(inboundPhoneApplied, requestCache);
- }
+ const startedUser = user;
+ void emitActivity(
+ 'session_started',
+ startedUser.id.toString(),
+ {
+ user_id: startedUser.id.toString(),
+ is_bot: startedUser.isBot,
+ has_verified_phone: startedUser.hasVerifiedPhone,
+ flags: startedUser.flags.toString(),
+ suspicious_flags: startedUser.suspiciousActivityFlags ?? 0,
+ has_ever_paid: startedUser.hasEverPurchased,
+ },
+ {ip: clientIp, country: geoipCountryIso, ua: null, locale: null, channel: 'other', request_id: null},
+ );
timings.timeSync('clear_expired_custom_status', () => {
const userSettings = userData.settings;
if (userSettings?.customStatus?.isExpired()) {
@@ -281,163 +260,4 @@ export class RpcSessionStartService {
}
return {user, flagsToUpdate, timings: timings.finalize()};
}
-
- private recordCountrySightingInBackground(user: User, countryIso: string): void {
- void this.deps.userRepository.recordCountrySighting(user.id, countryIso).catch((error) => {
- Logger.warn(
- {userId: user.id.toString(), countryIso, error},
- 'Failed to record country sighting at RPC session start',
- );
- });
- }
-
- private async applyConfiguredCountryInboundPhoneRequirement({
- user,
- geoipCountryIso,
- clientIp,
- timingSteps,
- }: {
- user: User;
- geoipCountryIso: string | null;
- clientIp: string | null;
- timingSteps: RpcTimingSteps;
- }): Promise<User | null> {
- if (timeRpcStepSync(timingSteps, 'check_bot_user', () => user.isBot)) return null;
- if (timeRpcStepSync(timingSteps, 'check_verified_phone', () => user.hasVerifiedPhone)) return null;
- if (
- !timeRpcStepSync(timingSteps, 'check_configured_country_policy', () =>
- countryRequiresInboundPhoneVerification(geoipCountryIso),
- )
- ) {
- return null;
- }
- if (
- !timeRpcStepSync(timingSteps, 'check_phone_flagging_allowed', () =>
- phoneFlaggingAllowedForCountry(geoipCountryIso),
- )
- ) {
- Logger.info(
- {userId: user.id.toString(), countryIso: geoipCountryIso},
- 'Skipping configured-country inbound phone requirement: phone flagging disabled for this country',
- );
- return null;
- }
- if (
- timeRpcStepSync(timingSteps, 'check_not_suspicious_flag', () => (user.flags & UserFlags.NOT_SUSPICIOUS) !== 0n)
- ) {
- Logger.info(
- {userId: user.id.toString(), countryIso: geoipCountryIso},
- 'Skipping configured-country inbound phone requirement: user has NOT_SUSPICIOUS flag',
- );
- return null;
- }
- if (
- await timeRpcStep(timingSteps, 'check_prior_successful_payment', async () =>
- this.deps.paymentRepository.hasEverPaidSuccessfully(user.id),
- )
- ) {
- Logger.info(
- {userId: user.id.toString(), countryIso: geoipCountryIso},
- 'Skipping configured-country inbound phone requirement: user has prior successful payment',
- );
- return null;
- }
- const hasOutOfPolicyHistory = await timeRpcStep(timingSteps, 'check_out_of_policy_country_history', async () =>
- this.deps.userRepository.hasCountrySightingOutsideSet(user.id, Config.abusePolicy.inboundPhoneCountryCodes),
- );
- if (!hasOutOfPolicyHistory) {
- Logger.info(
- {userId: user.id.toString(), countryIso: geoipCountryIso},
- 'Skipping configured-country inbound phone requirement: no out-of-policy country session history',
- );
- return null;
- }
- const sameIpHistorySteps: RpcTimingSteps = {};
- const sameIpHistoryStartedAtNs = startRpcTiming();
- const hasSameIpVerifiedPhoneHistory = await this.hasVerifiedPhoneHistoryOnSameIp(
- user.id,
- clientIp,
- sameIpHistorySteps,
- );
- timingSteps.check_same_ip_verified_phone_history = createRpcTimingNode(
- sameIpHistoryStartedAtNs,
- sameIpHistorySteps,
- );
- if (hasSameIpVerifiedPhoneHistory) {
- Logger.info(
- {userId: user.id.toString(), countryIso: geoipCountryIso},
- 'Skipping configured-country inbound phone requirement: same-IP phone verification history exists',
- );
- return null;
- }
- const requiredFlags = timeRpcStepSync(
- timingSteps,
- 'compute_required_inbound_phone_flags',
- () => SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION,
- );
- if (
- timeRpcStepSync(
- timingSteps,
- 'check_required_inbound_phone_flags_already_set',
- () =>
- (user.suspiciousActivityFlags & requiredFlags) === requiredFlags &&
- (user.suspiciousActivityFlags & DEFERRED_PHONE_ON_COMMUNITY_JOIN) === 0,
- )
- ) {
- return null;
- }
- const newFlags = imposePhoneRequirements(user.suspiciousActivityFlags, requiredFlags);
- try {
- const updatedUser = await timeRpcStep(timingSteps, 'persist_inbound_phone_requirement', async () =>
- this.deps.userRepository.patchUpsert(user.id, {suspicious_activity_flags: newFlags}, user.toRow()),
- );
- if (updatedUser) {
- Logger.info(
- {userId: user.id.toString(), countryIso: geoipCountryIso, newFlags},
- 'Applied inbound phone verification requirement on session start (configured country policy)',
- );
- return updatedUser;
- }
- } catch (error) {
- Logger.warn(
- {userId: user.id.toString(), countryIso: geoipCountryIso, error},
- 'Failed to apply inbound phone verification requirement on session start',
- );
- }
- return null;
- }
-
- private async hasVerifiedPhoneHistoryOnSameIp(
- userId: User['id'],
- clientIp: string | null,
- timingSteps: RpcTimingSteps,
- ): Promise<boolean> {
- if (!timeRpcStepSync(timingSteps, 'check_client_ip_present', () => clientIp !== null)) return false;
- const resolvedClientIp = clientIp!;
- try {
- const sameIpUsers = await timeRpcStep(timingSteps, 'list_user_ids_by_last_active_ip', async () =>
- this.deps.userRepository.listUserIdsByLastActiveIp(resolvedClientIp, Number.MAX_SAFE_INTEGER, 0),
- );
- const hasSameIpUserIds = timeRpcStepSync(
- timingSteps,
- 'check_same_ip_user_ids_present',
- () => sameIpUsers.userIds.length > 0,
- );
- if (!hasSameIpUserIds) {
- return false;
- }
- const users = await timeRpcStep(timingSteps, 'list_same_ip_users', async () =>
- this.deps.userRepository.listUsers(sameIpUsers.userIds),
- );
- return timeRpcStepSync(timingSteps, 'scan_same_ip_users_for_verified_phone', () =>
- users.some((candidate) => candidate.hasVerifiedPhone),
- );
- } catch (error) {
- Logger.warn(
- {userId: userId.toString(), error},
- 'Failed to evaluate same-IP phone verification history at RPC session start',
- );
- return false;
- }
- }
}
diff --git a/fluxer_api/src/api/stripe/services/StripePaymentFraudService.ts b/fluxer_api/src/api/stripe/services/StripePaymentFraudService.ts
index fac2c49bd..1ae4ac4ca 100644
--- a/fluxer_api/src/api/stripe/services/StripePaymentFraudService.ts
+++ b/fluxer_api/src/api/stripe/services/StripePaymentFraudService.ts
@@ -11,6 +11,7 @@ import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import {Logger} from '@app/api/Logger';
import {getBillingRepository} from '@app/api/middleware/ServiceRegistry';
import type {User} from '@app/api/models/User';
+import type {OAuth2TokenRepository} from '@app/api/oauth/repositories/OAuth2TokenRepository';
import {extractId} from '@app/api/stripe/StripeUtils';
import type {IUserRepository} from '@app/api/user/IUserRepository';
import {reschedulePendingDeletion} from '@app/api/user/services/PendingDeletionCoordinator';
@@ -37,6 +38,7 @@ interface StripePaymentFraudServiceDeps {
cacheService: ICacheService;
auditService: AdminAuditService;
kvDeletionQueue: KVAccountDeletionQueueService;
+ oauth2Tokens: Pick<OAuth2TokenRepository, 'deleteAllAccessTokensForUser' | 'deleteAllRefreshTokensForUser'>;
}
interface FraudAccountActionParams {
@@ -201,6 +203,8 @@ export class StripePaymentFraudService {
deletion_reason_code: DeletionReasons.BILLING_DISPUTE_OR_ABUSE,
deletion_public_reason: 'Payment fraud',
deletion_audit_log_reason: auditReason,
+ deletion_scheduled_by: SYSTEM_USER_ID,
+ deletion_scheduled_at: new Date(),
});
await reschedulePendingDeletion({
userId,
@@ -210,9 +214,11 @@ export class StripePaymentFraudService {
userRepository: this.deps.userRepository,
deletionQueue: this.deps.kvDeletionQueue,
});
+ await this.deps.sessionTerminator.terminateAllUserSessions(userId);
+ await this.deps.oauth2Tokens.deleteAllAccessTokensForUser(userId);
+ await this.deps.oauth2Tokens.deleteAllRefreshTokensForUser(userId);
await this.deps.userCacheService.setUserPartialResponseFromUser(updatedUser);
await this.dispatchUser(updatedUser);
- await this.deps.sessionTerminator.terminateAllUserSessions(userId);
if (updatedUser.email) {
await this.deps.emailService.sendScheduledDeletionNotification(
updatedUser.email,
diff --git a/fluxer_api/src/api/stripe/services/StripePremiumService.ts b/fluxer_api/src/api/stripe/services/StripePremiumService.ts
index 71ecc8e4c..61161b438 100644
--- a/fluxer_api/src/api/stripe/services/StripePremiumService.ts
+++ b/fluxer_api/src/api/stripe/services/StripePremiumService.ts
@@ -303,7 +303,6 @@ export class StripePremiumService {
const existingMember = await this.guildRepository.getMember(visionariesGuildId, userId);
if (!existingMember) {
await this.guildService.members.addUserToGuild({
- skipRiskGate: true,
userId,
guildId: visionariesGuildId,
sendJoinMessage: true,
diff --git a/fluxer_api/src/api/stripe/services/StripeWebhookService.ts b/fluxer_api/src/api/stripe/services/StripeWebhookService.ts
index 6da37e7ab..a3d6e57f0 100644
--- a/fluxer_api/src/api/stripe/services/StripeWebhookService.ts
+++ b/fluxer_api/src/api/stripe/services/StripeWebhookService.ts
@@ -11,6 +11,7 @@ import type {KVAccountDeletionQueueService} from '@app/api/infrastructure/KVAcco
import type {PremiumStateReconciliationQueueService} from '@app/api/infrastructure/PremiumStateReconciliationQueueService';
import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import {Logger} from '@app/api/Logger';
+import {OAuth2TokenRepository} from '@app/api/oauth/repositories/OAuth2TokenRepository';
import {getAcceptedWebhookSecrets} from '@app/api/stripe/BillingConfigCache';
import type {ProductRegistry} from '@app/api/stripe/ProductRegistry';
import type {AgeVerificationService} from '@app/api/stripe/services/AgeVerificationService';
@@ -94,6 +95,7 @@ export class StripeWebhookService {
cacheService,
auditService,
kvDeletionQueue,
+ oauth2Tokens: new OAuth2TokenRepository(),
});
this.subscriptionHandler = new StripeSubscriptionWebhookHandler(
userRepository,
diff --git a/fluxer_api/src/api/stripe/tests/StripeWebhookEarlyFraudWarning.test.ts b/fluxer_api/src/api/stripe/tests/StripeWebhookEarlyFraudWarning.test.ts
index 38f50906c..ef1f9352d 100644
--- a/fluxer_api/src/api/stripe/tests/StripeWebhookEarlyFraudWarning.test.ts
+++ b/fluxer_api/src/api/stripe/tests/StripeWebhookEarlyFraudWarning.test.ts
@@ -2,8 +2,9 @@
import crypto from 'node:crypto';
import {AdminRepository} from '@app/api/admin/AdminRepository';
-import {createUserID} from '@app/api/BrandedTypes';
+import {createApplicationID, createUserID} from '@app/api/BrandedTypes';
import {Config} from '@app/api/Config';
+import {OAuth2TokenRepository} from '@app/api/oauth/repositories/OAuth2TokenRepository';
import {
createTestPayment,
createTestUserWithPremium,
@@ -107,6 +108,23 @@ describe('Stripe Webhook Early Fraud Warning', () => {
paymentIntentId,
subscriptionId,
});
+ const accountUserId = createUserID(BigInt(account.userId));
+ const oauthTokens = new OAuth2TokenRepository();
+ const applicationId = createApplicationID(1234567890123456789n);
+ await oauthTokens.createAccessToken({
+ token_: `access-${account.userId}`,
+ application_id: applicationId,
+ user_id: accountUserId,
+ scope: new Set(['identify']),
+ created_at: new Date(),
+ });
+ await oauthTokens.createRefreshToken({
+ token_: `refresh-${account.userId}`,
+ application_id: applicationId,
+ user_id: accountUserId,
+ scope: new Set(['identify']),
+ created_at: new Date(),
+ });
await sendWebhook({
type: 'radar.early_fraud_warning.created',
data: {
@@ -129,6 +147,8 @@ describe('Stripe Webhook Early Fraud Warning', () => {
expect(updatedUser!.deletionReasonCode).toBe(DeletionReasons.BILLING_DISPUTE_OR_ABUSE);
expect(updatedUser!.stripeSubscriptionId).toBeNull();
expect(updatedUser!.pendingDeletionAt).not.toBeNull();
+ expect(await oauthTokens.getAccessToken(`access-${account.userId}`)).toBeNull();
+ expect(await oauthTokens.listRefreshTokensForUser(accountUserId)).toHaveLength(0);
const daysDifference = (updatedUser!.pendingDeletionAt!.getTime() - Date.now()) / (24 * 60 * 60 * 1000);
expect(daysDifference).toBeGreaterThan(58);
expect(daysDifference).toBeLessThan(62);
diff --git a/fluxer_api/src/api/test/AccountPolicyTestEvaluator.ts b/fluxer_api/src/api/test/AccountPolicyTestEvaluator.ts
deleted file mode 100644
index 969bdcf12..000000000
--- a/fluxer_api/src/api/test/AccountPolicyTestEvaluator.ts
+++ /dev/null
@@ -1,185 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createAccountPolicyEvaluator, type IAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyEvaluator';
-
-export const TEST_POLICY_CONTACT_DOMAIN = 'policy-exempt.example';
-export const TEST_POLICY_CONTACT_SUBDOMAIN = `sub.${TEST_POLICY_CONTACT_DOMAIN}`;
-export const TEST_POLICY_REPUTATION_EXEMPT_DOMAIN = 'reputation-exempt.example';
-
-const CURRENT_BEHAVIOR_TEST_POLICY_DSL = {
- version: 1,
- id: 'current_behavior_test_policy',
- sets: {
- contact_domain_exclusions: [TEST_POLICY_CONTACT_DOMAIN],
- contact_domain_reputation_exemptions: [TEST_POLICY_REPUTATION_EXEMPT_DOMAIN],
- },
- definitions: {
- bits: {
- email_contact_proof: 1,
- phone_contact_proof: 4,
- inbound_contact_proof: 256,
- },
- },
- defaults: {
- flag_bits: 0,
- features: {
- invite_auto_join: true,
- },
- },
- rules: [
- {
- id: 'assessment_action_bits',
- when: {
- not: {
- fact: 'contact.domain',
- in_set: 'contact_domain_exclusions',
- },
- },
- effects: [
- {
- type: 'or_bits_from_map',
- fact: 'assessment.action',
- map: {
- allow: [],
- require_verified_email: ['email_contact_proof'],
- require_outbound_phone: ['phone_contact_proof'],
- require_inbound_phone: ['phone_contact_proof', 'inbound_contact_proof'],
- block: ['phone_contact_proof', 'inbound_contact_proof'],
- },
- },
- ],
- },
- {
- id: 'contact_domain_step_up_bits',
- when: {
- all: [
- {
- not: {
- fact: 'contact.domain',
- in_set: 'contact_domain_exclusions',
- },
- },
- {
- fact: 'contact.domain_step_up_required',
- equals: true,
- },
- ],
- },
- effects: [
- {
- type: 'or_bits',
- bits: ['phone_contact_proof'],
- },
- ],
- },
- {
- id: 'region_step_up_bits',
- when: {
- all: [
- {
- not: {
- fact: 'contact.domain',
- in_set: 'contact_domain_exclusions',
- },
- },
- {
- fact: 'region.step_up_required',
- equals: true,
- },
- ],
- },
- effects: [
- {
- type: 'or_bits',
- bits: ['phone_contact_proof', 'inbound_contact_proof'],
- },
- ],
- },
- {
- id: 'mark_flagged_decision',
- when: {
- fact: 'decision.flag_bits',
- gt: 0,
- },
- effects: [
- {
- type: 'append_markers',
- markers: ['challenged'],
- },
- ],
- },
- {
- id: 'emit_assessment_threshold_notice',
- when: {
- fact: 'assessment.level',
- equals: 'very_high',
- },
- effects: [
- {
- type: 'emit',
- event: 'assessment_threshold_notice',
- level: 'warn',
- },
- ],
- },
- {
- id: 'disable_invite_auto_join_for_assessment_threshold',
- when: {
- fact: 'assessment.score',
- gte: 80,
- },
- effects: [
- {
- type: 'set_feature',
- feature: 'invite_auto_join',
- enabled: false,
- reason: 'assessment_score_gte_80',
- },
- ],
- },
- ],
- contact_capability_rules: [
- {
- id: 'contact_capability_profile',
- when: {
- fact: 'contact.domain',
- in_set: 'contact_domain_exclusions',
- },
- capabilities: ['captcha_exempt', 'followup_risk_exempt', 'required_actions_exempt'],
- },
- {
- id: 'contact_domain_reputation_profile',
- when: {
- fact: 'contact.domain',
- in_set: 'contact_domain_reputation_exemptions',
- },
- capabilities: ['reputation_checks_exempt'],
- },
- ],
- classifiers: {
- email_tlds: {
- low_risk: ['stable', 'trusted'],
- blocked: ['blocked'],
- },
- network: {
- trusted_privacy_provider_markers: ['privacy relay', 'sample shield'],
- education_org_markers: ['academy', 'learning network'],
- reverse_dns_markers: {
- cellular: ['\\bcell[-._]', '\\bmobile[-._]'],
- business: ['\\bbiz[-._]'],
- static: ['\\bstatic[-._]'],
- dynamic: ['\\bdyn[-._]', '\\bpool[-._]'],
- },
- },
- regional_minimum_age: {
- by_country: {
- ZZ: 16,
- YY: 15,
- },
- },
- },
-} as const;
-
-export function createCurrentBehaviorTestAccountPolicyEvaluator(): IAccountPolicyEvaluator {
- return createAccountPolicyEvaluator(CURRENT_BEHAVIOR_TEST_POLICY_DSL);
-}
diff --git a/fluxer_api/src/api/test/ApiTestHarness.ts b/fluxer_api/src/api/test/ApiTestHarness.ts
index 6e1524ed7..b2467de0e 100644
--- a/fluxer_api/src/api/test/ApiTestHarness.ts
+++ b/fluxer_api/src/api/test/ApiTestHarness.ts
@@ -7,14 +7,10 @@ import {
resetCassandraQueryExecutorForTesting,
setCassandraQueryExecutorForTesting,
} from '@app/api/database/CassandraQueryExecution';
+import {resetSharedListsForTests} from '@app/api/infrastructure/activity/SharedLists';
import {NullSearchProvider} from '@app/api/infrastructure/NullSearchProvider';
-import {resetAbuseTrackingForTests} from '@app/api/middleware/AbusiveIpAutoBanner';
import {ipBanCache} from '@app/api/middleware/IpBanMiddleware';
-import {
- setInjectedAccountPolicyEvaluator,
- setInjectedIpInfoService,
- setInjectedRegistrationRiskEvaluator,
-} from '@app/api/middleware/ServiceMiddleware';
+import {setInjectedIpInfoService} from '@app/api/middleware/ServiceMiddleware';
import {
setInjectedBlueskyOAuthService,
setInjectedGatewayService,
@@ -28,10 +24,8 @@ import {
setInjectedStorageService,
setInjectedUnfurlerService,
} from '@app/api/middleware/ServiceSingletons';
-import {torExitListCache} from '@app/api/middleware/TorExitListCache';
import type {ISearchProvider} from '@app/api/search/ISearchProvider';
import {drainSearchTasks} from '@app/api/search/SearchTaskTracker';
-import {createCurrentBehaviorTestAccountPolicyEvaluator} from '@app/api/test/AccountPolicyTestEvaluator';
import {InMemoryCassandraQueryExecutor} from '@app/api/test/InMemoryCassandraQueryExecutor';
import {MockBlueskyOAuthService} from '@app/api/test/mocks/MockBlueskyOAuthService';
import {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
@@ -91,7 +85,6 @@ export async function createApiTestHarness(options: CreateApiTestHarnessOptions
setInjectedUnfurlerService(new NoopUnfurlerService());
const mockBlueskyOAuthService = new MockBlueskyOAuthService();
setInjectedBlueskyOAuthService(mockBlueskyOAuthService);
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
await resetServiceStateForTesting();
const {
app,
@@ -114,11 +107,8 @@ export async function createApiTestHarness(options: CreateApiTestHarnessOptions
kvProvider.reset();
mockBlueskyOAuthService.reset();
setInjectedIpInfoService(undefined);
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
- setInjectedRegistrationRiskEvaluator(undefined);
setInjectedUnfurlerService(undefined);
- resetAbuseTrackingForTests();
- torExitListCache.clearForTesting();
+ resetSharedListsForTests();
}
async function resetData(): Promise<void> {
resetApiServicesForTesting();
@@ -145,10 +135,8 @@ export async function createApiTestHarness(options: CreateApiTestHarnessOptions
setInjectedGatewayService(new NoopGatewayService());
setInjectedKVProvider(new MockKVProvider());
setInjectedIpInfoService(undefined);
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
- setInjectedRegistrationRiskEvaluator(undefined);
setInjectedUnfurlerService(undefined);
- resetAbuseTrackingForTests();
+ resetSharedListsForTests();
const fallbackStorageService = new MockStorageService();
setInjectedStorageService(fallbackStorageService);
setInjectedMediaService(new TestMediaService(fallbackStorageService));
@@ -202,5 +190,5 @@ export async function createApiTestHarness(options: CreateApiTestHarnessOptions
async function clearBannedIpsState(): Promise<void> {
ipBanCache.resetCaches();
- resetAbuseTrackingForTests();
+ resetSharedListsForTests();
}
diff --git a/fluxer_api/src/api/test/ResetServiceState.ts b/fluxer_api/src/api/test/ResetServiceState.ts
index 9ea620df1..5834303aa 100644
--- a/fluxer_api/src/api/test/ResetServiceState.ts
+++ b/fluxer_api/src/api/test/ResetServiceState.ts
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {resetSudoModeServiceForTesting} from '@app/api/auth/services/SudoModeService';
+import {resetIpBanExemptionsForTesting} from '@app/api/ban/IpBanExemptions';
import {resetSsoRequestUrlPolicyForTesting} from '@app/api/instance/SsoConfigValidation';
import {resetGlobalLimitConfigServiceForTesting} from '@app/api/limits/LimitConfigService';
import {bannedAvatarHashCache} from '@app/api/middleware/BannedAvatarHashCache';
@@ -11,11 +12,8 @@ import {profileSubstringBlocklistCache} from '@app/api/middleware/ProfileSubstri
import {resetServiceMiddlewareForTesting} from '@app/api/middleware/ServiceMiddleware';
import {resetServiceRegistryForTesting} from '@app/api/middleware/ServiceRegistry';
import {resetServiceSingletonsForTesting} from '@app/api/middleware/ServiceSingletons';
-import {torExitListCache} from '@app/api/middleware/TorExitListCache';
import {urlBlocklistCache} from '@app/api/middleware/UrlBlocklistCache';
import {resetAdminSecretHashForTesting} from '@app/api/oauth/repositories/ApplicationRepository';
-import {resetAutoBanAsnExemptionsForTesting} from '@app/api/risk/AutoBanAsnExemptions';
-import {resetIpBanExemptionsForTesting} from '@app/api/risk/IpBanExemptions';
import {setThemeCssMaxBytesForTesting} from '@app/api/theme/ThemeService';
import {resetGeoipReadersForTesting} from '@pkgs/geoip/src/GeoipLookup';
@@ -24,7 +22,6 @@ export async function resetServiceStateForTesting(): Promise<void> {
resetServiceSingletonsForTesting();
resetServiceMiddlewareForTesting();
resetIpBanExemptionsForTesting();
- resetAutoBanAsnExemptionsForTesting();
resetGlobalLimitConfigServiceForTesting();
resetSudoModeServiceForTesting();
resetSsoRequestUrlPolicyForTesting();
@@ -32,8 +29,6 @@ export async function resetServiceStateForTesting(): Promise<void> {
setThemeCssMaxBytesForTesting(undefined);
await ipBanCache.shutdown();
ipBanCache.resetCaches();
- await torExitListCache.shutdown();
- torExitListCache.clearForTesting();
urlBlocklistCache.resetForTesting();
resetGeoipReadersForTesting();
fileShaCache.resetForTesting();
diff --git a/fluxer_api/src/api/test/TestHarnessController.ts b/fluxer_api/src/api/test/TestHarnessController.ts
index 6c5fbb841..3bed38d65 100644
--- a/fluxer_api/src/api/test/TestHarnessController.ts
+++ b/fluxer_api/src/api/test/TestHarnessController.ts
@@ -1725,6 +1725,7 @@ export function TestHarnessController(app: HonoApp) {
kvClient: workerDeps.kvClient,
userRepository: workerDeps.userRepository,
deletionQueueService: workerDeps.deletionQueueService,
+ gatewayService: workerDeps.gatewayService,
emailService: workerDeps.emailService,
isEmailEnabled: () => workerDeps.instanceConfigRepository.isEmailEnabled(),
activityTracker: workerDeps.activityTracker,
diff --git a/fluxer_api/src/api/test/mocks/MockKVProvider.ts b/fluxer_api/src/api/test/mocks/MockKVProvider.ts
index 18c2b6ce4..2dc7bea92 100644
--- a/fluxer_api/src/api/test/mocks/MockKVProvider.ts
+++ b/fluxer_api/src/api/test/mocks/MockKVProvider.ts
@@ -486,6 +486,26 @@ export class MockKVProvider implements IKVProvider {
return this.listStore.get(key)?.length ?? 0;
}
+ async lrange(key: string, start: number, stop: number): Promise<Array<string>> {
+ this.evictIfExpired(key);
+ const list = this.listStore.get(key) ?? [];
+ const from = start < 0 ? Math.max(list.length + start, 0) : start;
+ const to = stop < 0 ? list.length + stop : Math.min(stop, list.length - 1);
+ return from > to ? [] : list.slice(from, to + 1);
+ }
+
+ async ltrim(key: string, start: number, stop: number): Promise<void> {
+ this.evictIfExpired(key);
+ const list = this.listStore.get(key);
+ if (!list) return;
+ const kept = await this.lrange(key, start, stop);
+ if (kept.length === 0) {
+ this.listStore.delete(key);
+ return;
+ }
+ list.splice(0, list.length, ...kept);
+ }
+
async hset(key: string, field: string, value: string): Promise<number> {
this.hsetSpy(key, field, value);
this.evictIfExpired(key);
diff --git a/fluxer_api/src/api/user/UserHelpers.test.ts b/fluxer_api/src/api/user/UserHelpers.test.ts
index 66de2226d..a41f686f9 100644
--- a/fluxer_api/src/api/user/UserHelpers.test.ts
+++ b/fluxer_api/src/api/user/UserHelpers.test.ts
@@ -1,19 +1,15 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import {Config} from '@app/api/Config';
+import {applySharedListUpdate, resetSharedListsForTests} from '@app/api/infrastructure/activity/SharedLists';
import type {User} from '@app/api/models/User';
-import {setInjectedAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyService';
-import {setCachedDeferredPhoneGateEnabled} from '@app/api/risk/DeferredPhoneGateCache';
-import {
- createCurrentBehaviorTestAccountPolicyEvaluator,
- TEST_POLICY_CONTACT_DOMAIN,
- TEST_POLICY_CONTACT_SUBDOMAIN,
-} from '@app/api/test/AccountPolicyTestEvaluator';
import {
+ canOwnerRunBots,
checkIsPremium,
getEffectivePremiumUntil,
getEffectiveSuspiciousFlags,
getRequiredActions,
+ isSignInRefused,
+ isTemporarilyBanned,
} from '@app/api/user/UserHelpers';
import {
DEFERRED_PHONE_ON_COMMUNITY_JOIN,
@@ -21,6 +17,7 @@ import {
PHONE_GATE_PROMOTED_FROM_DEFERRAL,
PremiumFlags,
SuspiciousActivityFlags,
+ UserFlags,
UserPremiumTypes,
} from '@fluxer/constants/src/UserConstants';
import {afterEach, beforeEach, describe, expect, it} from 'vitest';
@@ -38,35 +35,6 @@ function createUser(
}
describe('deferred phone gate marker', () => {
- beforeEach(() => {
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
- setCachedDeferredPhoneGateEnabled(true);
- });
- afterEach(() => {
- setInjectedAccountPolicyEvaluator(undefined);
- setCachedDeferredPhoneGateEnabled(false);
- });
- it('does not suppress anything until a policy read has proven the gate is on', () => {
- setCachedDeferredPhoneGateEnabled(false);
- const user = createUser({
- suspiciousActivityFlags: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- });
- expect(getRequiredActions(user)).toEqual(['REQUIRE_VERIFIED_PHONE']);
- });
- it('keeps a deferral suppressed when the gate reads off but phone flagging is disabled', () => {
- setCachedDeferredPhoneGateEnabled(false);
- const original = {...Config.abusePolicy.phoneFlagging};
- Config.abusePolicy.phoneFlagging = {enabled: false, exemptCountryCodes: []};
- try {
- const user = createUser({
- suspiciousActivityFlags: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- });
- expect(getRequiredActions(user)).toEqual([]);
- expect(getEffectiveSuspiciousFlags(user)).toBe(0);
- } finally {
- Config.abusePolicy.phoneFlagging = original;
- }
- });
it('suppresses a deferred phone requirement so the account is not locked out', () => {
const user = createUser({
suspiciousActivityFlags: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | DEFERRED_PHONE_ON_COMMUNITY_JOIN,
@@ -103,14 +71,6 @@ describe('deferred phone gate marker', () => {
expect(getRequiredActions(user)).toEqual([]);
expect(getEffectiveSuspiciousFlags(user)).toBe(0);
});
- it('re-arms stored phone requirements as soon as the gate is switched off', () => {
- const user = createUser({
- suspiciousActivityFlags: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | DEFERRED_PHONE_ON_COMMUNITY_JOIN,
- });
- expect(getRequiredActions(user)).toEqual([]);
- setCachedDeferredPhoneGateEnabled(false);
- expect(getRequiredActions(user)).toEqual(['REQUIRE_VERIFIED_PHONE']);
- });
it('stops suppressing once another subsystem imposes the phone requirement directly', () => {
const deferred = SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | DEFERRED_PHONE_ON_COMMUNITY_JOIN;
const imposed = imposePhoneRequirements(deferred, SuspiciousActivityFlags.REQUIRE_REVERIFIED_PHONE);
@@ -170,10 +130,10 @@ describe('deferred phone gate marker', () => {
describe('getRequiredActions', () => {
beforeEach(() => {
- setInjectedAccountPolicyEvaluator(createCurrentBehaviorTestAccountPolicyEvaluator());
+ applySharedListUpdate('email_domain_exempt', 'exempt.example\n');
});
afterEach(() => {
- setInjectedAccountPolicyEvaluator(undefined);
+ resetSharedListsForTests();
});
it('keeps verified-email requirements active when the account email is unverified', () => {
const user = createUser({
@@ -219,9 +179,9 @@ describe('getRequiredActions', () => {
expect(getRequiredActions(user)).toEqual([]);
expect(getEffectiveSuspiciousFlags(user)).toBe(0);
});
- it('masks all suspicious activity requirements for policy-exempt contact domains', () => {
+ it('masks all suspicious activity requirements for exempt contact domains', () => {
const user = createUser({
- email: `builder@${TEST_POLICY_CONTACT_DOMAIN}`,
+ email: '[email protected]',
suspiciousActivityFlags:
SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL |
SuspiciousActivityFlags.REQUIRE_REVERIFIED_PHONE |
@@ -232,12 +192,20 @@ describe('getRequiredActions', () => {
});
it('does not mask suspicious activity requirements for non-matching subdomains', () => {
const user = createUser({
- email: `builder@${TEST_POLICY_CONTACT_SUBDOMAIN}`,
+ email: '[email protected]',
suspiciousActivityFlags: SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL,
});
expect(getRequiredActions(user)).toEqual(['REQUIRE_REVERIFIED_EMAIL']);
expect(getEffectiveSuspiciousFlags(user)).toBe(SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL);
});
+ it('keeps requirements while the exempt list is missing', () => {
+ resetSharedListsForTests();
+ const user = createUser({
+ email: '[email protected]',
+ suspiciousActivityFlags: SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL,
+ });
+ expect(getRequiredActions(user)).toEqual(['REQUIRE_VERIFIED_EMAIL']);
+ });
});
describe('checkIsPremium', () => {
@@ -288,3 +256,36 @@ describe('checkIsPremium', () => {
expect(checkIsPremium(user)).toBe(false);
});
});
+
+describe('account standing', () => {
+ const hour = 3_600_000;
+ function standing(flags: bigint, tempBannedUntil: Date | null = null, deletionStartedAt: Date | null = null) {
+ return {flags, tempBannedUntil, deletionStartedAt};
+ }
+ it('treats an active temporary ban as a refused sign-in', () => {
+ const banned = standing(UserFlags.DISABLED, new Date(Date.now() + hour));
+ expect(isTemporarilyBanned(banned)).toBe(true);
+ expect(isSignInRefused(banned)).toBe(true);
+ expect(canOwnerRunBots(banned)).toBe(false);
+ });
+ it('lets an expired temporary ban through', () => {
+ const expired = standing(UserFlags.DISABLED, new Date(Date.now() - hour));
+ expect(isTemporarilyBanned(expired)).toBe(false);
+ expect(isSignInRefused(expired)).toBe(false);
+ expect(canOwnerRunBots(expired)).toBe(true);
+ });
+ it('keeps a self-disabled account able to sign in but stops its bots', () => {
+ const disabled = standing(UserFlags.DISABLED);
+ expect(isSignInRefused(disabled)).toBe(false);
+ expect(canOwnerRunBots(disabled)).toBe(false);
+ });
+ it('refuses closed accounts', () => {
+ expect(isSignInRefused(standing(UserFlags.DELETED))).toBe(true);
+ expect(isSignInRefused(standing(0n, null, new Date()))).toBe(true);
+ expect(canOwnerRunBots(standing(UserFlags.DELETED))).toBe(false);
+ });
+ it('accepts an account in good standing', () => {
+ expect(isSignInRefused(standing(0n))).toBe(false);
+ expect(canOwnerRunBots(standing(0n))).toBe(true);
+ });
+});
diff --git a/fluxer_api/src/api/user/UserHelpers.ts b/fluxer_api/src/api/user/UserHelpers.ts
index 43fdb3fc4..e5d9d8184 100644
--- a/fluxer_api/src/api/user/UserHelpers.ts
+++ b/fluxer_api/src/api/user/UserHelpers.ts
@@ -3,11 +3,11 @@
import {Config} from '@app/api/Config';
import type {UserRow} from '@app/api/database/types/UserTypes';
import {resolveExperimentTargeting} from '@app/api/experiment/ExperimentTargeting';
+import {sharedListHas} from '@app/api/infrastructure/activity/SharedLists';
import {getCachedInstancePremiumMode} from '@app/api/limits/InstancePremiumModeCache';
import {getInstanceConfigRepository} from '@app/api/middleware/ServiceSingletons';
import type {User} from '@app/api/models/User';
-import {accountPolicyContactHasCapability} from '@app/api/risk/AccountPolicyService';
-import {getCachedDeferredPhoneGateEnabled} from '@app/api/risk/DeferredPhoneGateCache';
+import {extractEmailDomain} from '@app/api/utils/EmailDomainUtils';
import {
DEFERRABLE_PHONE_FLAGS,
DEFERRED_PHONE_ON_COMMUNITY_JOIN,
@@ -137,9 +137,6 @@ function suppressDeferredPhoneFlags(rawFlags: number): number {
if ((rawFlags & DEFERRED_PHONE_ON_COMMUNITY_JOIN) === 0) {
return rawFlags;
}
- if (getCachedDeferredPhoneGateEnabled() === false && Config.abusePolicy.phoneFlagging.enabled) {
- return rawFlags & ~DEFERRED_PHONE_ON_COMMUNITY_JOIN;
- }
return rawFlags & ~DEFERRABLE_PHONE_FLAGS;
}
@@ -151,7 +148,7 @@ export function getRequiredActions(user: User): ReadonlyArray<RequiredAction> {
if (!user.email) {
return [];
}
- if (accountPolicyContactHasCapability(user.email, 'required_actions_exempt')) {
+ if (sharedListHas('email_domain_exempt', extractEmailDomain(user.email))) {
return [];
}
const activeClauses = buildRequiredActionClauses(flags).filter(
@@ -174,6 +171,33 @@ export function getRequiredActions(user: User): ReadonlyArray<RequiredAction> {
return requiredActions;
}
+export function isAccountClosed(user: Pick<User, 'flags' | 'deletionStartedAt'>): boolean {
+ return (user.flags & UserFlags.DELETED) !== 0n || user.deletionStartedAt != null;
+}
+
+export function isTemporarilyBanned(user: Pick<User, 'flags' | 'tempBannedUntil'>, now = Date.now()): boolean {
+ return (
+ (user.flags & UserFlags.DISABLED) !== 0n && user.tempBannedUntil != null && user.tempBannedUntil.getTime() > now
+ );
+}
+
+function isAccountDisabled(user: Pick<User, 'flags' | 'tempBannedUntil'>, now = Date.now()): boolean {
+ if ((user.flags & UserFlags.DISABLED) === 0n) return false;
+ return user.tempBannedUntil == null || user.tempBannedUntil.getTime() > now;
+}
+
+export function isSignInRefused(user: Pick<User, 'flags' | 'deletionStartedAt' | 'tempBannedUntil'>): boolean {
+ return isAccountClosed(user) || isTemporarilyBanned(user);
+}
+
+export function canOwnerRunBots(owner: Pick<User, 'flags' | 'deletionStartedAt' | 'tempBannedUntil'>): boolean {
+ return !isAccountClosed(owner) && !isAccountDisabled(owner);
+}
+
+export function isDirectDeliverySuppressed(user: Pick<User, 'isBot' | 'flags'>): boolean {
+ return !user.isBot && (user.flags & UserFlags.SPAMMER) === UserFlags.SPAMMER;
+}
+
export function getEffectiveSuspiciousFlags(user: User): number {
let flags = 0;
for (const action of getRequiredActions(user)) {
diff --git a/fluxer_api/src/api/user/controllers/UserAccountController.ts b/fluxer_api/src/api/user/controllers/UserAccountController.ts
index bb35cee14..c22e07bf3 100644
--- a/fluxer_api/src/api/user/controllers/UserAccountController.ts
+++ b/fluxer_api/src/api/user/controllers/UserAccountController.ts
@@ -1197,17 +1197,13 @@ export function UserAccountController(app: HonoApp) {
security: ['bearerToken', 'sessionToken'],
tags: ['Users'],
description:
- 'Reports whether this account can set a deferred phone verification requirement aside, and which communities would be left if it did. Returns available false with empty lists for any account outside that state.',
+ 'Reports whether this account can set a due phone verification requirement aside. The community lists are always empty.',
}),
async (ctx) => {
- const {available, guilds, ownedGuilds} = await ctx
+ const available = await ctx
.get('userService')
.accountService.lifecycleService.previewPhoneGateEscape(ctx.get('user').id);
- return ctx.json({
- available,
- guilds: guilds.map((guild) => ({id: guild.id.toString(), name: guild.name})),
- owned_guilds: ownedGuilds.map((guild) => ({id: guild.id.toString(), name: guild.name})),
- });
+ return ctx.json({available, guilds: [], owned_guilds: []});
},
);
app.post(
@@ -1224,10 +1220,10 @@ export function UserAccountController(app: HonoApp) {
security: ['bearerToken', 'sessionToken'],
tags: ['Users'],
description:
- 'Leaves the communities that trigger the deferred phone verification check and restores the deferral, so the account works normally again. Communities the user owns are kept, and a run that hits the per-call community limit leaves what it can and can be repeated. Returns the updated private user object.',
+ 'Defers a due phone verification requirement again, so the account works normally without leaving any community. Returns the updated private user object.',
}),
async (ctx) => {
- const {user} = await ctx
+ const user = await ctx
.get('userService')
.accountService.lifecycleService.executePhoneGateEscape(ctx.get('user').id);
return ctx.json(mapUserToPrivateResponse(user));
diff --git a/fluxer_api/src/api/user/controllers/UserAuthController.ts b/fluxer_api/src/api/user/controllers/UserAuthController.ts
index aa28f9df0..5e2449350 100644
--- a/fluxer_api/src/api/user/controllers/UserAuthController.ts
+++ b/fluxer_api/src/api/user/controllers/UserAuthController.ts
@@ -262,7 +262,7 @@ export function UserAuthController(app: HonoApp) {
security: ['bearerToken', 'sessionToken'],
tags: ['Users'],
description:
- "For very-high-risk registrations the platform requires the user to text a one-time code to the platform's number, instead of receiving a code from the platform. This endpoint generates the code and the destination number to display.",
+ "When an account must verify its phone number inbound, the user texts a one-time code to the platform's number instead of receiving one. This endpoint generates the code and the destination number to display.",
}),
async (ctx) => {
return ctx.json(await ctx.get('userAuthRequestService').startInboundPhoneChallenge(ctx.get('user')));
diff --git a/fluxer_api/src/api/user/repositories/IUserAccountRepository.ts b/fluxer_api/src/api/user/repositories/IUserAccountRepository.ts
index b778341fb..2ee7afeb4 100644
--- a/fluxer_api/src/api/user/repositories/IUserAccountRepository.ts
+++ b/fluxer_api/src/api/user/repositories/IUserAccountRepository.ts
@@ -10,6 +10,8 @@ export interface UserDeletionScheduleUpdate {
deletion_reason_code?: number | null;
deletion_public_reason?: string | null;
deletion_audit_log_reason?: string | null;
+ deletion_scheduled_by?: UserID | null;
+ deletion_scheduled_at?: Date | null;
temp_banned_until?: Date | null;
first_refund_at?: Date | null;
}
@@ -18,6 +20,7 @@ export interface IUserAccountRepository {
create(data: UserRow): Promise<User>;
upsert(data: UserRow, oldData?: UserRow | null): Promise<User>;
patchUpsert(userId: UserID, patchData: Partial<UserRow>, oldData?: UserRow | null): Promise<User>;
+ compareAndSetSuspiciousFlags(user: User, suspiciousFlags: number): Promise<User | null>;
updateDeletionSchedule(user: User, patch: UserDeletionScheduleUpdate): Promise<User>;
startDeletion(userId: UserID, pendingDeletionAt: Date): Promise<User | null>;
anonymizeForDeletion(user: User, patch: Partial<UserRow>): Promise<User>;
diff --git a/fluxer_api/src/api/user/repositories/IUserAuthRepository.ts b/fluxer_api/src/api/user/repositories/IUserAuthRepository.ts
index 2a28fa854..7a0c2a309 100644
--- a/fluxer_api/src/api/user/repositories/IUserAuthRepository.ts
+++ b/fluxer_api/src/api/user/repositories/IUserAuthRepository.ts
@@ -1,12 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import type {PhoneVerificationToken, UserID} from '@app/api/BrandedTypes';
+import type {UserID} from '@app/api/BrandedTypes';
import type {
AuthSessionRow,
EmailRevertTokenRow,
EmailVerificationTokenRow,
PasswordResetTokenRow,
- PhoneTokenRow,
} from '@app/api/database/types/AuthTypes';
import type {AuthSession, AuthSessionTombstone} from '@app/api/models/AuthSession';
import type {EmailRevertToken} from '@app/api/models/EmailRevertToken';
@@ -23,8 +22,6 @@ export interface IUserAuthRepository {
updateAuthSessionLastUsed(sessionIdHash: Buffer): Promise<void>;
deleteAuthSessions(userId: UserID, sessionIdHashes: Array<Buffer>): Promise<void>;
deleteAllAuthSessions(userId: UserID): Promise<void>;
- recordCountrySighting(userId: UserID, country: string): Promise<void>;
- hasCountrySightingOutsideSet(userId: UserID, countryCodes: Iterable<string>): Promise<boolean>;
listMfaBackupCodes(userId: UserID): Promise<Array<MfaBackupCode>>;
createMfaBackupCodes(userId: UserID, codes: Array<string>): Promise<Array<MfaBackupCode>>;
clearMfaBackupCodes(userId: UserID): Promise<void>;
@@ -40,9 +37,6 @@ export interface IUserAuthRepository {
getEmailRevertToken(token: string): Promise<EmailRevertToken | null>;
createEmailRevertToken(tokenData: EmailRevertTokenRow): Promise<EmailRevertToken>;
deleteEmailRevertToken(token: string): Promise<void>;
- createPhoneToken(token: PhoneVerificationToken, phone: string, userId: UserID | null): Promise<void>;
- getPhoneToken(token: PhoneVerificationToken): Promise<PhoneTokenRow | null>;
- deletePhoneToken(token: PhoneVerificationToken): Promise<void>;
checkIpAuthorized(userId: UserID, ip: string): Promise<boolean>;
createAuthorizedIp(userId: UserID, ip: string): Promise<void>;
createIpAuthorizationToken(userId: UserID, token: string, email: string): Promise<void>;
diff --git a/fluxer_api/src/api/user/repositories/UserAccountRepository.ts b/fluxer_api/src/api/user/repositories/UserAccountRepository.ts
index 47eb8523e..0438efa60 100644
--- a/fluxer_api/src/api/user/repositories/UserAccountRepository.ts
+++ b/fluxer_api/src/api/user/repositories/UserAccountRepository.ts
@@ -71,6 +71,10 @@ export class UserAccountRepository implements IUserAccountRepository {
return this.accountRepo.patchUpsert(userId, patchData, oldData);
}
+ async compareAndSetSuspiciousFlags(user: User, suspiciousFlags: number): Promise<User | null> {
+ return this.accountRepo.compareAndSetSuspiciousFlags(user, suspiciousFlags);
+ }
+
async updateDeletionSchedule(user: User, patch: UserDeletionScheduleUpdate): Promise<User> {
return this.accountRepo.updateDeletionSchedule(user, patch);
}
diff --git a/fluxer_api/src/api/user/repositories/UserAuthRepository.ts b/fluxer_api/src/api/user/repositories/UserAuthRepository.ts
index 3a693a516..dcbea295b 100644
--- a/fluxer_api/src/api/user/repositories/UserAuthRepository.ts
+++ b/fluxer_api/src/api/user/repositories/UserAuthRepository.ts
@@ -1,12 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import type {PhoneVerificationToken, UserID} from '@app/api/BrandedTypes';
+import type {UserID} from '@app/api/BrandedTypes';
import type {
AuthSessionRow,
EmailRevertTokenRow,
EmailVerificationTokenRow,
PasswordResetTokenRow,
- PhoneTokenRow,
} from '@app/api/database/types/AuthTypes';
import type {AuthSession, AuthSessionTombstone} from '@app/api/models/AuthSession';
import type {EmailRevertToken} from '@app/api/models/EmailRevertToken';
@@ -67,14 +66,6 @@ export class UserAuthRepository implements IUserAuthRepository {
return this.authSessionRepository.deleteAllAuthSessions(userId);
}
- async recordCountrySighting(userId: UserID, country: string): Promise<void> {
- return this.authSessionRepository.recordCountrySighting(userId, country);
- }
-
- async hasCountrySightingOutsideSet(userId: UserID, countryCodes: Iterable<string>): Promise<boolean> {
- return this.authSessionRepository.hasCountrySightingOutsideSet(userId, countryCodes);
- }
-
async listMfaBackupCodes(userId: UserID): Promise<Array<MfaBackupCode>> {
return this.mfaBackupCodeRepository.listMfaBackupCodes(userId);
}
@@ -135,18 +126,6 @@ export class UserAuthRepository implements IUserAuthRepository {
return this.tokenRepository.deleteEmailRevertToken(token);
}
- async createPhoneToken(token: PhoneVerificationToken, phone: string, userId: UserID | null): Promise<void> {
- return this.tokenRepository.createPhoneToken(token, phone, userId);
- }
-
- async getPhoneToken(token: PhoneVerificationToken): Promise<PhoneTokenRow | null> {
- return this.tokenRepository.getPhoneToken(token);
- }
-
- async deletePhoneToken(token: PhoneVerificationToken): Promise<void> {
- return this.tokenRepository.deletePhoneToken(token);
- }
-
async checkIpAuthorized(userId: UserID, ip: string): Promise<boolean> {
return this.ipAuthorizationRepository.checkIpAuthorized(userId, ip);
}
diff --git a/fluxer_api/src/api/user/repositories/UserRelationshipRepository.ts b/fluxer_api/src/api/user/repositories/UserRelationshipRepository.ts
index 188db09d6..868cafb36 100644
--- a/fluxer_api/src/api/user/repositories/UserRelationshipRepository.ts
+++ b/fluxer_api/src/api/user/repositories/UserRelationshipRepository.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {createUserID, type UserID} from '@app/api/BrandedTypes';
-import {BatchBuilder, deleteOneOrMany, fetchMany, fetchOne} from '@app/api/database/CassandraQueryExecution';
+import {deleteOneOrMany, executeGroupedBatches, fetchMany, fetchOne} from '@app/api/database/CassandraQueryExecution';
import {Db, nextVersion} from '@app/api/database/CassandraTypes';
import {executeVersionedUpdate} from '@app/api/database/CassandraVersionedUpdate';
import type {NoteRow, RelationshipRow} from '@app/api/database/types/UserTypes';
@@ -62,20 +62,16 @@ export class UserRelationshipRepository implements IUserRelationshipRepository {
source_user_id: bigint;
target_user_id: bigint;
}>(FETCH_ALL_NOTES_FOR_DELETE_QUERY, {});
- const batch = new BatchBuilder();
- for (const note of allNotes) {
- if (note.target_user_id === BigInt(userId)) {
- batch.addPrepared(
+ await executeGroupedBatches(
+ allNotes
+ .filter((note) => note.target_user_id === BigInt(userId))
+ .map((note) => [
Notes.deleteByPk({
source_user_id: createUserID(note.source_user_id),
target_user_id: createUserID(note.target_user_id),
}),
- );
- }
- }
- if (batch) {
- await batch.execute();
- }
+ ]),
+ );
}
async deleteAllRelationships(userId: UserID): Promise<void> {
@@ -83,40 +79,20 @@ export class UserRelationshipRepository implements IUserRelationshipRepository {
fetchMany<RelationshipRow>(FETCH_RELATIONSHIPS_CQL, {source_user_id: userId}),
fetchMany<RelationshipRow>(FETCH_RELATIONSHIPS_BY_TARGET_CQL, {target_user_id: userId}),
]);
- const batch = new BatchBuilder();
- for (const rel of relationshipsFromUser) {
- batch.addPrepared(
+ await executeGroupedBatches(
+ [...relationshipsFromUser, ...relationshipsPointingToUser].map((rel) => [
Relationships.deleteByPk({
source_user_id: rel.source_user_id,
target_user_id: rel.target_user_id,
type: rel.type,
}),
- );
- batch.addPrepared(
RelationshipsByTarget.deleteByPk({
target_user_id: rel.target_user_id,
source_user_id: rel.source_user_id,
type: rel.type,
}),
- );
- }
- for (const rel of relationshipsPointingToUser) {
- batch.addPrepared(
- Relationships.deleteByPk({
- source_user_id: rel.source_user_id,
- target_user_id: rel.target_user_id,
- type: rel.type,
- }),
- );
- batch.addPrepared(
- RelationshipsByTarget.deleteByPk({
- target_user_id: rel.target_user_id,
- source_user_id: rel.source_user_id,
- type: rel.type,
- }),
- );
- }
- await batch.execute();
+ ]),
+ );
}
async deleteRelationship(sourceUserId: UserID, targetUserId: UserID, type: number): Promise<void> {
diff --git a/fluxer_api/src/api/user/repositories/UserRepository.ts b/fluxer_api/src/api/user/repositories/UserRepository.ts
index f8b1ce290..c7481cfdb 100644
--- a/fluxer_api/src/api/user/repositories/UserRepository.ts
+++ b/fluxer_api/src/api/user/repositories/UserRepository.ts
@@ -1,12 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import type {ChannelID, GuildID, MessageID, PhoneVerificationToken, UserID} from '@app/api/BrandedTypes';
+import type {ChannelID, GuildID, MessageID, UserID} from '@app/api/BrandedTypes';
import type {
AuthSessionRow,
EmailRevertTokenRow,
EmailVerificationTokenRow,
PasswordResetTokenRow,
- PhoneTokenRow,
} from '@app/api/database/types/AuthTypes';
import type {GiftCodeRow, PaymentBySubscriptionRow, PaymentRow} from '@app/api/database/types/PaymentTypes';
import type {
@@ -84,6 +83,10 @@ export class UserRepository implements IUserRepositoryAggregate {
return this.accountRepo.patchUpsert(userId, patchData, oldData);
}
+ async compareAndSetSuspiciousFlags(user: User, suspiciousFlags: number): Promise<User | null> {
+ return this.accountRepo.compareAndSetSuspiciousFlags(user, suspiciousFlags);
+ }
+
async updateDeletionSchedule(user: User, patch: UserDeletionScheduleUpdate): Promise<User> {
return this.accountRepo.updateDeletionSchedule(user, patch);
}
@@ -281,14 +284,6 @@ export class UserRepository implements IUserRepositoryAggregate {
return this.authRepo.deleteAllAuthSessions(userId);
}
- async recordCountrySighting(userId: UserID, country: string): Promise<void> {
- return this.authRepo.recordCountrySighting(userId, country);
- }
-
- async hasCountrySightingOutsideSet(userId: UserID, countryCodes: Iterable<string>): Promise<boolean> {
- return this.authRepo.hasCountrySightingOutsideSet(userId, countryCodes);
- }
-
async listMfaBackupCodes(userId: UserID): Promise<Array<MfaBackupCode>> {
return this.authRepo.listMfaBackupCodes(userId);
}
@@ -349,18 +344,6 @@ export class UserRepository implements IUserRepositoryAggregate {
return this.authRepo.deleteEmailRevertToken(token);
}
- async createPhoneToken(token: PhoneVerificationToken, phone: string, userId: UserID | null): Promise<void> {
- return this.authRepo.createPhoneToken(token, phone, userId);
- }
-
- async getPhoneToken(token: PhoneVerificationToken): Promise<PhoneTokenRow | null> {
- return this.authRepo.getPhoneToken(token);
- }
-
- async deletePhoneToken(token: PhoneVerificationToken): Promise<void> {
- return this.authRepo.deletePhoneToken(token);
- }
-
async checkIpAuthorized(userId: UserID, ip: string): Promise<boolean> {
return this.authRepo.checkIpAuthorized(userId, ip);
}
diff --git a/fluxer_api/src/api/user/repositories/account/UserAccountRepository.ts b/fluxer_api/src/api/user/repositories/account/UserAccountRepository.ts
index 5d8ad13b3..f492e9329 100644
--- a/fluxer_api/src/api/user/repositories/account/UserAccountRepository.ts
+++ b/fluxer_api/src/api/user/repositories/account/UserAccountRepository.ts
@@ -112,8 +112,25 @@ export class UserAccountRepository {
return this.patchAccount(userId, patchData, oldData);
}
+ async compareAndSetSuspiciousFlags(user: User, suspiciousFlags: number): Promise<User | null> {
+ const result = await this.dataRepo.compareAndSetSuspiciousFlags(user, suspiciousFlags);
+ if (!result) return null;
+ const updatedUser = new User(result.updatedData);
+ await this.searchRepo.updateUser(updatedUser);
+ return updatedUser;
+ }
+
async updateDeletionSchedule(user: User, patch: UserDeletionScheduleUpdate): Promise<User> {
- return this.patchAccount(user.id, patch, user.toRow(), 'schedule');
+ return this.patchAccount(
+ user.id,
+ {
+ ...patch,
+ deletion_scheduled_by: patch.deletion_scheduled_by ?? null,
+ deletion_scheduled_at: patch.deletion_scheduled_at ?? null,
+ },
+ user.toRow(),
+ 'schedule',
+ );
}
async startDeletion(userId: UserID, pendingDeletionAt: Date): Promise<User | null> {
diff --git a/fluxer_api/src/api/user/repositories/account/crud/UserDataRepository.ts b/fluxer_api/src/api/user/repositories/account/crud/UserDataRepository.ts
index c9abf77c2..585982e4b 100644
--- a/fluxer_api/src/api/user/repositories/account/crud/UserDataRepository.ts
+++ b/fluxer_api/src/api/user/repositories/account/crud/UserDataRepository.ts
@@ -7,6 +7,7 @@ import {Db, type DbOp, nextVersion} from '@app/api/database/CassandraTypes';
import {applyPatchToRow, buildPatchFromData, executeVersionedUpdate} from '@app/api/database/CassandraVersionedUpdate';
import type {UserRow} from '@app/api/database/types/UserTypes';
import {EMPTY_USER_ROW, USER_COLUMNS} from '@app/api/database/types/UserTypes';
+import {emitAccountChangedIfRelevant} from '@app/api/infrastructure/activity/AccountChangeEvents';
import {User} from '@app/api/models/User';
import {Users} from '@app/api/Tables';
import {isPendingDeletionBlocked} from '@app/api/user/services/PendingDeletionCoordinator';
@@ -152,11 +153,9 @@ export class UserDataRepository {
Users,
{initialData: oldData},
);
- return {
- finalVersion: result.finalVersion,
- previousData: result.previousData,
- updatedData: {...data, version: result.finalVersion ?? data.version},
- };
+ const updatedData = {...data, version: result.finalVersion ?? data.version};
+ await emitAccountChangedIfRelevant(result.previousData, updatedData);
+ return {finalVersion: result.finalVersion, previousData: result.previousData, updatedData};
}
async patchUser(
@@ -187,6 +186,7 @@ export class UserDataRepository {
user_id: userId,
version: result.finalVersion ?? nextVersion(previousData?.version),
};
+ await emitAccountChangedIfRelevant(previousData, updatedData);
return {finalVersion: result.finalVersion, previousData, updatedData};
}
@@ -228,9 +228,38 @@ export class UserDataRepository {
throw new ConflictError({code: APIErrorCodes.CONFLICT, message: 'Account deletion state has changed'});
}
const updatedData = {...previousData, ...applyPatchToRow(previousData, patch), version: finalVersion};
+ await emitAccountChangedIfRelevant(previousData, updatedData, 'deletion');
return {finalVersion, previousData, updatedData};
}
+ async compareAndSetSuspiciousFlags(
+ user: User,
+ suspiciousFlags: number,
+ ): Promise<{previousData: UserRow; updatedData: UserRow} | null> {
+ assertWritableUserId(user.id);
+ const previousData = user.toRow();
+ const version = nextVersion(user.version);
+ const expected = previousData.suspicious_activity_flags ?? 0;
+ const conditions: Array<Partial<UserRow>> = [{suspicious_activity_flags: expected}];
+ if (expected === 0 && previousData.version != null) {
+ conditions.push({suspicious_activity_flags: null, version: previousData.version});
+ }
+ for (const condition of conditions) {
+ const applied = await executeConditional(
+ Users.conditionalPatchByPk(
+ {user_id: user.id},
+ {suspicious_activity_flags: Db.set(suspiciousFlags), version: Db.set(version)},
+ condition,
+ ),
+ );
+ if (!applied) continue;
+ const updatedData = {...previousData, suspicious_activity_flags: suspiciousFlags, version};
+ await emitAccountChangedIfRelevant(previousData, updatedData);
+ return {previousData, updatedData};
+ }
+ return null;
+ }
+
async startDeletion(userId: UserID, pendingDeletionAt: Date): Promise<User | null> {
assertWritableUserId(userId);
const scheduledAt = pendingDeletionAt.getTime();
diff --git a/fluxer_api/src/api/user/repositories/auth/AuthSessionRepository.ts b/fluxer_api/src/api/user/repositories/auth/AuthSessionRepository.ts
index e5e93ec01..6e96e3788 100644
--- a/fluxer_api/src/api/user/repositories/auth/AuthSessionRepository.ts
+++ b/fluxer_api/src/api/user/repositories/auth/AuthSessionRepository.ts
@@ -2,12 +2,12 @@
import {createUserID, type UserID} from '@app/api/BrandedTypes';
import {BatchBuilder, fetchMany, fetchOne, upsertOne} from '@app/api/database/CassandraQueryExecution';
-import {Db} from '@app/api/database/CassandraTypes';
-import type {AuthSessionRow, AuthSessionTombstoneRow, UserCountryHistoryRow} from '@app/api/database/types/AuthTypes';
+import {Db, type PreparedQuery} from '@app/api/database/CassandraTypes';
+import type {AuthSessionRow, AuthSessionTombstoneRow} from '@app/api/database/types/AuthTypes';
import {Logger} from '@app/api/Logger';
-import {getCacheService, getPhoneFraudGraphService} from '@app/api/middleware/ServiceSingletons';
+import {getCacheService, getUserActivityBuffer} from '@app/api/middleware/ServiceSingletons';
import {AuthSession, AuthSessionTombstone} from '@app/api/models/AuthSession';
-import {AuthSessions, AuthSessionsByUserId, AuthSessionTombstones, UserCountryHistory} from '@app/api/Tables';
+import {AuthSessions, AuthSessionsByUserId, AuthSessionTombstones} from '@app/api/Tables';
import {awaitAll} from '@app/api/utils/ConcurrencyUtils';
import {isValidTimestamp} from '@app/api/utils/TimestampUtils';
import {SnowflakeType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
@@ -15,6 +15,8 @@ import {z} from 'zod';
const AUTH_SESSION_CACHE_TTL_SECONDS = 30;
const AUTH_SESSION_MISS_CACHE_TTL_SECONDS = 5;
+const AUTH_SESSION_READ_SLICE = 100;
+const AUTH_SESSIONS_PER_BATCH = 20;
interface CachedAuthSession {
user_id: string;
@@ -106,15 +108,6 @@ const FETCH_AUTH_SESSION_HASHES_BY_USER_ID_CQL = AuthSessionsByUserId.selectCql(
columns: ['session_id_hash'],
where: AuthSessionsByUserId.where.eq('user_id'),
});
-const FETCH_USER_COUNTRY_HISTORY_CQL = UserCountryHistory.selectCql({
- columns: ['country'],
- where: UserCountryHistory.where.eq('user_id'),
-});
-const FETCH_USER_COUNTRY_HISTORY_ENTRY_CQL = UserCountryHistory.selectCql({
- columns: ['first_seen_at'],
- where: [UserCountryHistory.where.eq('user_id'), UserCountryHistory.where.eq('country')],
- limit: 1,
-});
const FETCH_AUTH_SESSION_TOMBSTONES_BY_USER_ID_CQL = AuthSessionTombstones.selectCql({
where: AuthSessionTombstones.where.eq('user_id'),
});
@@ -131,66 +124,9 @@ export class AuthSessionRepository {
);
await batch.execute();
await invalidateAuthSessionCache([sessionData.session_id_hash]);
- try {
- await getPhoneFraudGraphService().recordSessionForCohortGraph(
- sessionData.user_id,
- sessionData.client_ip,
- sessionData.created_at,
- );
- } catch (error) {
- Logger.warn({error}, 'phone_fraud_graph.record_session_cohort failed (non-fatal)');
- }
- if (sessionData.client_country) {
- try {
- await this.recordCountrySighting(sessionData.user_id, sessionData.client_country, sessionData.created_at);
- } catch (error) {
- Logger.warn(
- {userId: sessionData.user_id.toString(), country: sessionData.client_country, error},
- 'Failed to record country sighting at session creation',
- );
- }
- }
return new AuthSession(sessionData);
}
- async recordCountrySighting(userId: UserID, country: string, now: Date = new Date()): Promise<void> {
- const normalizedCountry = country.toUpperCase();
- const existing = await fetchOne<{
- first_seen_at: Date;
- }>(FETCH_USER_COUNTRY_HISTORY_ENTRY_CQL, {
- user_id: userId,
- country: normalizedCountry,
- });
- const firstSeenAt = existing?.first_seen_at ?? now;
- await upsertOne(
- UserCountryHistory.insert({
- user_id: userId,
- country: normalizedCountry,
- first_seen_at: firstSeenAt,
- last_seen_at: now,
- }),
- );
- }
-
- async hasCountrySightingOutsideSet(userId: UserID, countryCodes: Iterable<string>): Promise<boolean> {
- const rows = await fetchMany<Pick<UserCountryHistoryRow, 'country'>>(FETCH_USER_COUNTRY_HISTORY_CQL, {
- user_id: userId,
- });
- const excludedCountries = new Set(Array.from(countryCodes, (country) => country.toUpperCase()));
- return rows.some((row) => !excludedCountries.has(row.country.toUpperCase()));
- }
-
- async listCountryHistory(userId: UserID): Promise<
- Array<{
- country: string;
- }>
- > {
- const rows = await fetchMany<Pick<UserCountryHistoryRow, 'country'>>(FETCH_USER_COUNTRY_HISTORY_CQL, {
- user_id: userId,
- });
- return rows.map((r) => ({country: r.country}));
- }
-
async getAuthSessionByToken(sessionIdHash: Buffer): Promise<AuthSession | null> {
let sessionRead: Promise<AuthSessionRow | null> | undefined;
const readSession = () => (sessionRead ??= this.fetchAuthSessionByToken(sessionIdHash));
@@ -212,9 +148,10 @@ export class AuthSessionRepository {
}
private async fetchAuthSessionByToken(sessionIdHash: Buffer): Promise<AuthSessionRow | null> {
- return fetchOne<AuthSessionRow>(FETCH_AUTH_SESSION_BY_TOKEN_CQL, {
+ const row = await fetchOne<AuthSessionRow>(FETCH_AUTH_SESSION_BY_TOKEN_CQL, {
session_id_hash: sessionIdHash,
});
+ return row && isLiveAuthSessionRow(row) ? row : null;
}
async listAuthSessions(userId: UserID): Promise<Array<AuthSession>> {
@@ -224,10 +161,8 @@ export class AuthSessionRepository {
user_id: userId,
});
if (sessionHashes.length === 0) return [];
- const sessions = await fetchMany<AuthSessionRow>(FETCH_AUTH_SESSIONS_CQL, {
- session_id_hashes: sessionHashes.map((s) => s.session_id_hash),
- });
- return sessions.map((session) => new AuthSession(session));
+ const sessions = await fetchAuthSessionRows(sessionHashes.map((s) => s.session_id_hash));
+ return sessions.filter((session) => session.user_id === userId).map((session) => new AuthSession(session));
}
async listAuthSessionTombstones(userId: UserID): Promise<Array<AuthSessionTombstone>> {
@@ -248,19 +183,25 @@ export class AuthSessionRepository {
async deleteAuthSessions(userId: UserID, sessionIdHashes: Array<Buffer>): Promise<void> {
if (sessionIdHashes.length === 0) return;
await invalidateAuthSessionCache(sessionIdHashes);
- const originals = await fetchMany<AuthSessionRow>(FETCH_AUTH_SESSIONS_CQL, {
- session_id_hashes: sessionIdHashes,
- });
- const owned = originals.filter((original) => original.user_id === userId);
- if (owned.length === 0) return;
+ const originals = new Map(
+ (await fetchRawAuthSessionRows(sessionIdHashes)).map((row) => [row.session_id_hash.toString('base64url'), row]),
+ );
const deletedAt = new Date();
- const batch = new BatchBuilder();
- for (const original of owned) {
- batch.addPrepared(AuthSessions.deleteByPk({session_id_hash: original.session_id_hash}));
- batch.addPrepared(AuthSessionsByUserId.deleteByPk({user_id: userId, session_id_hash: original.session_id_hash}));
- batch.addPrepared(AuthSessionTombstones.insert(toTombstoneRow(original, deletedAt)));
+ const revoked: Array<Buffer> = [];
+ const groups: Array<Array<PreparedQuery>> = [];
+ for (const sessionIdHash of sessionIdHashes) {
+ const original = originals.get(sessionIdHash.toString('base64url'));
+ if (original && isLiveAuthSessionRow(original) && original.user_id !== userId) continue;
+ revoked.push(sessionIdHash);
+ groups.push(
+ revokeStatements(userId, sessionIdHash, original && isLiveAuthSessionRow(original) ? original : null, {
+ deletePrimary: original !== undefined,
+ deletedAt,
+ }),
+ );
}
- await batch.execute();
+ await executeSessionGroups(groups);
+ await forgetAuthSessionActivity(revoked);
await invalidateAuthSessionCache(sessionIdHashes);
}
@@ -273,11 +214,11 @@ export class AuthSessionRepository {
if (sessionRefs.length === 0) return;
const sessionIdHashes = sessionRefs.map((session) => session.session_id_hash);
await invalidateAuthSessionCache(sessionIdHashes);
- let originals: Array<AuthSessionRow> = [];
+ let originals = new Map<string, AuthSessionRow>();
try {
- originals = await fetchMany<AuthSessionRow>(FETCH_AUTH_SESSIONS_CQL, {
- session_id_hashes: sessionIdHashes,
- });
+ originals = new Map(
+ (await fetchAuthSessionRows(sessionIdHashes)).map((row) => [row.session_id_hash.toString('base64url'), row]),
+ );
} catch (error) {
Logger.warn(
{userId: userId.toString(), error},
@@ -285,21 +226,68 @@ export class AuthSessionRepository {
);
}
const deletedAt = new Date();
+ const groups = sessionIdHashes.map((sessionIdHash) => {
+ const original = originals.get(sessionIdHash.toString('base64url'));
+ return revokeStatements(userId, sessionIdHash, original?.user_id === userId ? original : null, {
+ deletePrimary: true,
+ deletedAt,
+ });
+ });
+ await executeSessionGroups(groups);
+ await forgetAuthSessionActivity(sessionIdHashes);
+ await invalidateAuthSessionCache(sessionIdHashes);
+ }
+}
+
+function isLiveAuthSessionRow(row: AuthSessionRow): boolean {
+ return row.user_id != null && row.created_at != null;
+}
+
+async function fetchRawAuthSessionRows(sessionIdHashes: ReadonlyArray<Buffer>): Promise<Array<AuthSessionRow>> {
+ const rows: Array<AuthSessionRow> = [];
+ for (let index = 0; index < sessionIdHashes.length; index += AUTH_SESSION_READ_SLICE) {
+ rows.push(
+ ...(await fetchMany<AuthSessionRow>(FETCH_AUTH_SESSIONS_CQL, {
+ session_id_hashes: sessionIdHashes.slice(index, index + AUTH_SESSION_READ_SLICE),
+ })),
+ );
+ }
+ return rows;
+}
+
+async function fetchAuthSessionRows(sessionIdHashes: ReadonlyArray<Buffer>): Promise<Array<AuthSessionRow>> {
+ return (await fetchRawAuthSessionRows(sessionIdHashes)).filter(isLiveAuthSessionRow);
+}
+
+function revokeStatements(
+ userId: UserID,
+ sessionIdHash: Buffer,
+ original: AuthSessionRow | null,
+ options: {deletePrimary: boolean; deletedAt: Date},
+): Array<PreparedQuery> {
+ const statements: Array<PreparedQuery> = [];
+ if (options.deletePrimary) statements.push(AuthSessions.deleteByPk({session_id_hash: sessionIdHash}));
+ statements.push(AuthSessionsByUserId.deleteByPk({user_id: userId, session_id_hash: sessionIdHash}));
+ if (original) statements.push(AuthSessionTombstones.insert(toTombstoneRow(original, options.deletedAt)));
+ return statements;
+}
+
+async function executeSessionGroups(groups: ReadonlyArray<ReadonlyArray<PreparedQuery>>): Promise<void> {
+ for (let index = 0; index < groups.length; index += AUTH_SESSIONS_PER_BATCH) {
const batch = new BatchBuilder();
- for (const sessionIdHash of sessionIdHashes) {
- batch.addPrepared(AuthSessions.deleteByPk({session_id_hash: sessionIdHash}));
- batch.addPrepared(
- AuthSessionsByUserId.deleteByPk({
- user_id: userId,
- session_id_hash: sessionIdHash,
- }),
- );
- }
- for (const original of originals) {
- batch.addPrepared(AuthSessionTombstones.insert(toTombstoneRow(original, deletedAt)));
+ for (const group of groups.slice(index, index + AUTH_SESSIONS_PER_BATCH)) {
+ for (const statement of group) batch.addPrepared(statement);
}
await batch.execute();
- await invalidateAuthSessionCache(sessionIdHashes);
+ }
+}
+
+async function forgetAuthSessionActivity(sessionIdHashes: ReadonlyArray<Buffer>): Promise<void> {
+ if (sessionIdHashes.length === 0) return;
+ try {
+ await getUserActivityBuffer().forgetAuthSessions(sessionIdHashes);
+ } catch (error) {
+ Logger.warn({error}, 'Failed to clear pending activity for revoked auth sessions');
}
}
diff --git a/fluxer_api/src/api/user/repositories/auth/TokenRepository.ts b/fluxer_api/src/api/user/repositories/auth/TokenRepository.ts
index c2f3b1005..de985df04 100644
--- a/fluxer_api/src/api/user/repositories/auth/TokenRepository.ts
+++ b/fluxer_api/src/api/user/repositories/auth/TokenRepository.ts
@@ -1,17 +1,12 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import type {
- PasswordResetToken as PasswordResetTokenBrand,
- PhoneVerificationToken,
- UserID,
-} from '@app/api/BrandedTypes';
+import type {PasswordResetToken as PasswordResetTokenBrand, UserID} from '@app/api/BrandedTypes';
import {createEmailRevertToken, createEmailVerificationToken, createPasswordResetToken} from '@app/api/BrandedTypes';
import {BatchBuilder, deleteOneOrMany, fetchMany, fetchOne, upsertOne} from '@app/api/database/CassandraQueryExecution';
import type {
EmailRevertTokenRow,
EmailVerificationTokenRow,
PasswordResetTokenRow,
- PhoneTokenRow,
} from '@app/api/database/types/AuthTypes';
import {EmailRevertToken} from '@app/api/models/EmailRevertToken';
import {EmailVerificationToken} from '@app/api/models/EmailVerificationToken';
@@ -21,7 +16,6 @@ import {
EmailVerificationTokens,
PasswordResetTokens,
PasswordResetTokensByUserId,
- PhoneTokens,
} from '@app/api/Tables';
import {seconds} from 'itty-time';
@@ -40,10 +34,6 @@ const FETCH_EMAIL_REVERT_TOKEN_CQL = EmailRevertTokens.selectCql({
where: EmailRevertTokens.where.eq('token_'),
limit: 1,
});
-const FETCH_PHONE_TOKEN_CQL = PhoneTokens.selectCql({
- where: PhoneTokens.where.eq('token_'),
- limit: 1,
-});
export class TokenRepository {
async getEmailVerificationToken(token: string): Promise<EmailVerificationToken | null> {
@@ -130,31 +120,4 @@ export class TokenRepository {
{token_: createEmailRevertToken(token)},
);
}
-
- async createPhoneToken(token: PhoneVerificationToken, phone: string, userId: UserID | null): Promise<void> {
- const TTL = seconds('15 minutes');
- await upsertOne(
- PhoneTokens.insertWithTtl(
- {
- token_: token,
- phone,
- user_id: userId,
- },
- TTL,
- ),
- );
- }
-
- async getPhoneToken(token: PhoneVerificationToken): Promise<PhoneTokenRow | null> {
- return await fetchOne<PhoneTokenRow>(FETCH_PHONE_TOKEN_CQL, {token_: token});
- }
-
- async deletePhoneToken(token: PhoneVerificationToken): Promise<void> {
- await deleteOneOrMany(
- PhoneTokens.deleteCql({
- where: PhoneTokens.where.eq('token_'),
- }),
- {token_: token},
- );
- }
}
diff --git a/fluxer_api/src/api/user/repositories/auth/WebAuthnRepository.ts b/fluxer_api/src/api/user/repositories/auth/WebAuthnRepository.ts
index 165439144..27f698f41 100644
--- a/fluxer_api/src/api/user/repositories/auth/WebAuthnRepository.ts
+++ b/fluxer_api/src/api/user/repositories/auth/WebAuthnRepository.ts
@@ -1,7 +1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {UserID} from '@app/api/BrandedTypes';
-import {BatchBuilder, deleteOneOrMany, fetchMany, fetchOne, upsertOne} from '@app/api/database/CassandraQueryExecution';
+import {
+ deleteOneOrMany,
+ executeGroupedBatches,
+ fetchMany,
+ fetchOne,
+ upsertOne,
+} from '@app/api/database/CassandraQueryExecution';
import {Db} from '@app/api/database/CassandraTypes';
import type {WebAuthnCredentialRow} from '@app/api/database/types/AuthTypes';
import {WebAuthnCredential} from '@app/api/models/WebAuthnCredential';
@@ -145,20 +151,11 @@ export class WebAuthnRepository {
}>(FETCH_WEBAUTHN_CREDENTIALS_FOR_USER_CQL, {
user_id: userId,
});
- const batch = new BatchBuilder();
- for (const cred of credentials) {
- batch.addPrepared(
- WebAuthnCredentials.deleteByPk({
- user_id: userId,
- credential_id: cred.credential_id,
- }),
- );
- batch.addPrepared(
- WebAuthnCredentialLookup.deleteByPk({
- credential_id: cred.credential_id,
- }),
- );
- }
- await batch.execute();
+ await executeGroupedBatches(
+ credentials.map((cred) => [
+ WebAuthnCredentials.deleteByPk({user_id: userId, credential_id: cred.credential_id}),
+ WebAuthnCredentialLookup.deleteByPk({credential_id: cred.credential_id}),
+ ]),
+ );
}
}
diff --git a/fluxer_api/src/api/user/services/AccountStateApplier.ts b/fluxer_api/src/api/user/services/AccountStateApplier.ts
new file mode 100644
index 000000000..486cc30f7
--- /dev/null
+++ b/fluxer_api/src/api/user/services/AccountStateApplier.ts
@@ -0,0 +1,197 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import type {ApiContext} from '@app/api/ApiContext';
+import type {AdminRepository} from '@app/api/admin/AdminRepository';
+import {createUserID} from '@app/api/BrandedTypes';
+import {isIpBanExempt} from '@app/api/ban/IpBanExemptions';
+import {IP_BAN_REFRESH_CHANNEL} from '@app/api/constants/IpBan';
+import {withAccountChangeSource} from '@app/api/infrastructure/activity/ActivityMeta';
+import type {
+ ActionEnvelope,
+ ActionOutcome,
+ Observed,
+ OutcomeStatus,
+} from '@app/api/infrastructure/activity/Contract.generated';
+import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
+import type {User} from '@app/api/models/User';
+import type {IUserRepository} from '@app/api/user/IUserRepository';
+import type {UserContactChangeLogService} from '@app/api/user/services/UserContactChangeLogService';
+import {mapUserToPartialResponse, mapUserToPrivateResponse} from '@app/api/user/UserMappers';
+import {UserFlags} from '@fluxer/constants/src/UserConstants';
+import {getSameIpDecisionKey, isPublicIpAddress, parseIpAddress} from '@fluxer/ip_utils/src/IpAddress';
+import type {ICacheService} from '@pkgs/cache/src/ICacheService';
+
+export type ActionOf<T extends ActionEnvelope['type']> = Extract<ActionEnvelope, {type: T}>;
+
+export interface AccountUpdateDispatch {
+ userUpdated(user: User): Promise<void>;
+ memberProfilesUpdated(user: User): Promise<void>;
+}
+
+export interface AccountStateDeps {
+ users: Pick<IUserRepository, 'findUnique' | 'patchUpsert' | 'compareAndSetSuspiciousFlags'>;
+ dispatch: AccountUpdateDispatch;
+ contactChangeLog: Pick<UserContactChangeLogService, 'recordDiff'>;
+ ipBans: Pick<AdminRepository, 'isIpBanned' | 'banIpTemp'>;
+ cache: Pick<ICacheService, 'publish'>;
+ now?: () => number;
+}
+
+const SUSPICIOUS_FLAGS_WRITE_ATTEMPTS = 3;
+const MIN_TEMP_BAN_SECONDS = 60;
+
+function gatewayDispatch(
+ gateway: Pick<IGatewayService, 'dispatchPresence' | 'dispatchGuild' | 'getGuildMember'>,
+ users: Pick<IUserRepository, 'getUserGuildIds'>,
+): AccountUpdateDispatch {
+ return {
+ async userUpdated(user) {
+ await gateway.dispatchPresence({userId: user.id, event: 'USER_UPDATE', data: mapUserToPrivateResponse(user)});
+ },
+ async memberProfilesUpdated(user) {
+ const userPartial = mapUserToPartialResponse(user);
+ for (const guildId of await users.getUserGuildIds(user.id)) {
+ const member = await gateway.getGuildMember({guildId, userId: user.id});
+ if (!member.success || !member.memberData) continue;
+ await gateway.dispatchGuild({
+ guildId,
+ event: 'GUILD_MEMBER_UPDATE',
+ data: {...member.memberData, user: userPartial},
+ });
+ }
+ },
+ };
+}
+
+export function accountStateDepsFromContext(ctx: ApiContext, ipBans: AccountStateDeps['ipBans']): AccountStateDeps {
+ return {
+ users: ctx.services.users,
+ dispatch: gatewayDispatch(ctx.services.gateway, ctx.services.users),
+ contactChangeLog: ctx.services.contactChangeLog,
+ ipBans,
+ cache: ctx.services.cache,
+ };
+}
+
+export function observedOf(user: User): Observed {
+ return {
+ flags: user.flags.toString(),
+ suspicious_flags: user.suspiciousActivityFlags ?? 0,
+ has_verified_phone: user.hasVerifiedPhone,
+ deleted: (user.flags & UserFlags.DELETED) !== 0n,
+ };
+}
+
+export function outcomeOf(
+ env: Pick<ActionEnvelope, 'id'> & {type: string},
+ status: OutcomeStatus,
+ user: User | null = null,
+ detail: string | null = null,
+): ActionOutcome {
+ return {
+ action_id: env.id,
+ action_type: env.type,
+ status,
+ detail,
+ observed: user ? observedOf(user) : null,
+ };
+}
+
+function isIneligible(user: User): boolean {
+ return user.isBot || (user.flags & UserFlags.DELETED) !== 0n;
+}
+
+export async function applySuspiciousFlags(
+ deps: AccountStateDeps,
+ env: ActionOf<'set_suspicious_flags'>,
+): Promise<ActionOutcome> {
+ return withAccountChangeSource('action', async () => {
+ const userId = createUserID(BigInt(env.user_id));
+ let user = await deps.users.findUnique(userId);
+ for (let attempt = 0; attempt < SUSPICIOUS_FLAGS_WRITE_ATTEMPTS; attempt++) {
+ if (!user) return outcomeOf(env, 'ineligible');
+ if (isIneligible(user)) return outcomeOf(env, 'ineligible', user);
+ const current = user.suspiciousActivityFlags ?? 0;
+ const target = (current | env.set) & ~env.clear;
+ if (target === current) return outcomeOf(env, 'noop', user);
+ if (env.if_current !== null && env.if_current !== current) return outcomeOf(env, 'conflict', user);
+ const updated = await deps.users.compareAndSetSuspiciousFlags(user, target);
+ if (updated) {
+ await deps.dispatch.userUpdated(updated);
+ return outcomeOf(env, 'applied', updated);
+ }
+ user = await deps.users.findUnique(userId);
+ }
+ throw new Error('Suspicious activity flags kept changing during apply');
+ });
+}
+
+export async function applySpammer(deps: AccountStateDeps, env: ActionOf<'set_spammer'>): Promise<ActionOutcome> {
+ return withAccountChangeSource('action', async () => {
+ const user = await deps.users.findUnique(createUserID(BigInt(env.user_id)));
+ if (!user) return outcomeOf(env, 'ineligible');
+ if (isIneligible(user)) return outcomeOf(env, 'ineligible', user);
+ const has = (user.flags & UserFlags.SPAMMER) !== 0n;
+ if (has === env.on) return outcomeOf(env, 'noop', user);
+ const flags = env.on ? user.flags | UserFlags.SPAMMER : user.flags & ~UserFlags.SPAMMER;
+ const updated = await deps.users.patchUpsert(user.id, {flags}, user.toRow());
+ await deps.dispatch.userUpdated(updated);
+ await deps.dispatch.memberProfilesUpdated(updated);
+ return outcomeOf(env, 'applied', updated);
+ });
+}
+
+export async function applyPhoneVerified(
+ deps: AccountStateDeps,
+ env: ActionOf<'phone_verified'>,
+): Promise<ActionOutcome> {
+ return withAccountChangeSource('phone_verify', async () => {
+ const user = await deps.users.findUnique(createUserID(BigInt(env.user_id)));
+ if (!user) return outcomeOf(env, 'ineligible');
+ if (isIneligible(user)) return outcomeOf(env, 'ineligible', user);
+ const suspicious = user.suspiciousActivityFlags ?? 0;
+ const nextSuspicious = suspicious & ~env.clear_suspicious;
+ if (user.hasVerifiedPhone && nextSuspicious === suspicious) {
+ return outcomeOf(env, 'noop', user);
+ }
+ const updates: {has_verified_phone: boolean; suspicious_activity_flags?: number} = {
+ has_verified_phone: true,
+ };
+ if (nextSuspicious !== suspicious) updates.suspicious_activity_flags = nextSuspicious;
+ const updated = await deps.users.patchUpsert(user.id, updates, user.toRow());
+ if (!user.hasVerifiedPhone) {
+ await deps.contactChangeLog.recordDiff({
+ oldUser: user,
+ newUser: updated,
+ reason: 'user_requested',
+ actorUserId: user.id,
+ });
+ }
+ await deps.dispatch.userUpdated(updated);
+ return outcomeOf(env, 'applied', updated);
+ });
+}
+
+function parseBanTarget(value: string): ReturnType<typeof parseIpAddress> {
+ const direct = parseIpAddress(value);
+ if (direct) return direct;
+ const slash = value.lastIndexOf('/');
+ if (slash <= 0) return null;
+ const network = parseIpAddress(value.slice(0, slash));
+ if (!network || getSameIpDecisionKey(network.normalized) !== value) return null;
+ return network;
+}
+
+export async function applyTempBanIp(deps: AccountStateDeps, env: ActionOf<'temp_ban_ip'>): Promise<ActionOutcome> {
+ const parsed = parseBanTarget(env.ip);
+ if (!parsed || !isPublicIpAddress(parsed.normalized) || isIpBanExempt(parsed.normalized)) {
+ return outcomeOf(env, 'exempt');
+ }
+ const now = deps.now?.() ?? Date.now();
+ const ttlSeconds = Math.floor((env.until_ms - now) / 1000);
+ if (ttlSeconds < MIN_TEMP_BAN_SECONDS) return outcomeOf(env, 'noop');
+ if (await deps.ipBans.isIpBanned(parsed.normalized)) return outcomeOf(env, 'noop');
+ await deps.ipBans.banIpTemp(getSameIpDecisionKey(parsed.normalized) ?? parsed.normalized, ttlSeconds);
+ await deps.cache.publish(IP_BAN_REFRESH_CHANNEL, 'refresh');
+ return outcomeOf(env, 'applied');
+}
diff --git a/fluxer_api/src/api/user/services/DirectMessageSpamMitigationService.ts b/fluxer_api/src/api/user/services/DirectMessageSpamMitigationService.ts
deleted file mode 100644
index af85e48ba..000000000
--- a/fluxer_api/src/api/user/services/DirectMessageSpamMitigationService.ts
+++ /dev/null
@@ -1,237 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {ApiContext} from '@app/api/ApiContext';
-import type {UserID} from '@app/api/BrandedTypes';
-import {Config} from '@app/api/Config';
-import type {UserRow} from '@app/api/database/types/UserTypes';
-import {Logger} from '@app/api/Logger';
-import type {User} from '@app/api/models/User';
-import {lookupGeoip} from '@app/api/utils/IpUtils';
-import {UserFlags} from '@fluxer/constants/src/UserConstants';
-import {parseIpAddress} from '@fluxer/ip_utils/src/IpAddress';
-import type {IKVProvider} from '@pkgs/kv_client/src/IKVProvider';
-
-const DIRECT_CONTACT_SPAM_TARGET_KEY_PREFIX = 'direct-contact-spam:distinct-targets:';
-
-interface DirectMessageSpamMitigationDecision {
- shouldSuppressRecipientDelivery: boolean;
- flaggedNow: boolean;
- distinctRecipientCount: number | null;
-}
-
-type DirectMessageSpamCountryResolver = (clientIp: string) => Promise<string | null>;
-
-interface DirectContactSpamPolicy {
- enabled: boolean;
- countryCodes: Array<string>;
- distinctTargetThreshold: number;
- targetWindowMs: number;
- action: 'flag_spammer' | 'suppress_delivery';
-}
-
-interface DirectMessageSpamUserRepository {
- patchUpsert(userId: UserID, patchData: Partial<UserRow>, oldData?: UserRow | null): Promise<User>;
-}
-
-export function createDirectMessageSpamMitigationService(
- apiContext: ApiContext,
- userRepository: DirectMessageSpamUserRepository,
-): DirectMessageSpamMitigationService {
- return new DirectMessageSpamMitigationService({
- userRepository,
- kv: apiContext.services.kv,
- clientIp: apiContext.request.clientIp,
- policy: Config.abusePolicy.directContactSpam,
- });
-}
-
-interface DirectMessageSpamMitigationServiceDeps {
- userRepository: DirectMessageSpamUserRepository;
- kv: IKVProvider;
- clientIp: string | null;
- countryResolver?: DirectMessageSpamCountryResolver;
- policy?: DirectContactSpamPolicy;
- nowMs?: () => number;
-}
-
-function isDirectMessageSpammer(user: User): boolean {
- if (user.isBot) {
- return false;
- }
- return (user.flags & UserFlags.SPAMMER) === UserFlags.SPAMMER;
-}
-
-function countryMatchesDirectContactSpamPolicy(
- policy: DirectContactSpamPolicy,
- countryCode: string | null | undefined,
-): boolean {
- if (!policy.enabled) {
- return false;
- }
- if (countryCode == null) {
- return false;
- }
- const configuredCountries = new Set(policy.countryCodes.map((country) => country.toUpperCase()));
- return configuredCountries.has(countryCode.toUpperCase());
-}
-
-async function resolveGeoipCountryCode(clientIp: string): Promise<string | null> {
- const geoip = await lookupGeoip(clientIp);
- return geoip.countryCode?.toUpperCase() ?? null;
-}
-
-function normalizeClientIp(clientIp: string | null): string | null {
- if (!clientIp) {
- return null;
- }
- const firstHop = clientIp.split(',')[0]?.trim();
- if (!firstHop) {
- return null;
- }
- return parseIpAddress(firstHop)?.normalized ?? null;
-}
-
-export class DirectMessageSpamMitigationService {
- private readonly countryResolver: DirectMessageSpamCountryResolver;
- private readonly nowMs: () => number;
- private readonly policy: DirectContactSpamPolicy;
-
- constructor(private readonly deps: DirectMessageSpamMitigationServiceDeps) {
- this.countryResolver = deps.countryResolver ?? resolveGeoipCountryCode;
- this.nowMs = deps.nowMs ?? Date.now;
- this.policy = deps.policy ?? {
- enabled: false,
- countryCodes: [],
- distinctTargetThreshold: 25,
- targetWindowMs: 2 * 60 * 60 * 1000,
- action: 'flag_spammer',
- };
- }
-
- shouldSuppressDirectMessageDelivery(user: User): boolean {
- return isDirectMessageSpammer(user);
- }
-
- async recordOneToOneDmSend(params: {
- sender: User;
- recipientId: UserID;
- }): Promise<DirectMessageSpamMitigationDecision> {
- return await this.recordDirectContactAttempt({
- actor: params.sender,
- targetId: params.recipientId,
- action: 'dm_send',
- });
- }
-
- async recordFriendRequestSend(params: {
- requester: User;
- targetId: UserID;
- }): Promise<DirectMessageSpamMitigationDecision> {
- return await this.recordDirectContactAttempt({
- actor: params.requester,
- targetId: params.targetId,
- action: 'friend_request_send',
- });
- }
-
- private async recordDirectContactAttempt(params: {
- actor: User;
- targetId: UserID;
- action: 'dm_send' | 'friend_request_send';
- }): Promise<DirectMessageSpamMitigationDecision> {
- const {actor, targetId, action} = params;
- if (actor.isBot) {
- return {
- shouldSuppressRecipientDelivery: false,
- flaggedNow: false,
- distinctRecipientCount: null,
- };
- }
- if (isDirectMessageSpammer(actor)) {
- return {
- shouldSuppressRecipientDelivery: true,
- flaggedNow: false,
- distinctRecipientCount: null,
- };
- }
- try {
- const countryCode = await this.resolveClientCountryCode();
- if (!countryMatchesDirectContactSpamPolicy(this.policy, countryCode)) {
- return {
- shouldSuppressRecipientDelivery: false,
- flaggedNow: false,
- distinctRecipientCount: null,
- };
- }
- const distinctRecipientCount = await this.recordDistinctRecipient({
- senderId: actor.id,
- recipientId: targetId,
- windowMs: Math.max(1000, this.policy.targetWindowMs),
- });
- if (distinctRecipientCount < Math.max(1, this.policy.distinctTargetThreshold)) {
- return {
- shouldSuppressRecipientDelivery: false,
- flaggedNow: false,
- distinctRecipientCount,
- };
- }
- if (this.policy.action === 'flag_spammer') {
- await this.flagSpammer(actor);
- }
- return {
- shouldSuppressRecipientDelivery: true,
- flaggedNow: this.policy.action === 'flag_spammer',
- distinctRecipientCount,
- };
- } catch (error) {
- Logger.warn(
- {
- error,
- action,
- actorId: actor.id.toString(),
- targetId: targetId.toString(),
- },
- 'DM spam mitigation check failed',
- );
- return {
- shouldSuppressRecipientDelivery: false,
- flaggedNow: false,
- distinctRecipientCount: null,
- };
- }
- }
-
- private async resolveClientCountryCode(): Promise<string | null> {
- const clientIp = normalizeClientIp(this.deps.clientIp);
- if (!clientIp) {
- return null;
- }
- const countryCode = await this.countryResolver(clientIp);
- return countryCode?.toUpperCase() ?? null;
- }
-
- private async recordDistinctRecipient(params: {
- senderId: UserID;
- recipientId: UserID;
- windowMs: number;
- }): Promise<number> {
- const now = this.nowMs();
- const key = `${DIRECT_CONTACT_SPAM_TARGET_KEY_PREFIX}${params.senderId.toString()}`;
- await this.deps.kv.zadd(key, now, params.recipientId.toString());
- await this.deps.kv.expire(key, Math.ceil(params.windowMs / 1000));
- const expiredRecipientIds = await this.deps.kv.zrangebyscore(key, '-inf', now - params.windowMs);
- if (expiredRecipientIds.length > 0) {
- await this.deps.kv.zrem(key, ...expiredRecipientIds);
- }
- return await this.deps.kv.zcard(key);
- }
-
- private async flagSpammer(user: User): Promise<void> {
- if (isDirectMessageSpammer(user)) {
- return;
- }
- await this.deps.userRepository.patchUpsert(user.id, {
- flags: user.flags | UserFlags.SPAMMER,
- });
- }
-}
diff --git a/fluxer_api/src/api/user/services/EmailChangeService.ts b/fluxer_api/src/api/user/services/EmailChangeService.ts
index ed69615c8..46c4ec897 100644
--- a/fluxer_api/src/api/user/services/EmailChangeService.ts
+++ b/fluxer_api/src/api/user/services/EmailChangeService.ts
@@ -4,6 +4,7 @@ import {randomUUID} from 'node:crypto';
import type {ApiContext} from '@app/api/ApiContext';
import {EMAIL_CLEARABLE_SUSPICIOUS_ACTIVITY_FLAGS} from '@app/api/auth/AuthEmail';
import * as AuthPassword from '@app/api/auth/AuthPassword';
+import {assertEmailNotBlocklisted} from '@app/api/auth/EmailBlocklist';
import type {User} from '@app/api/models/User';
import type {EmailChangeRepository} from '@app/api/user/repositories/auth/EmailChangeRepository';
import {
@@ -176,6 +177,7 @@ export class EmailChangeService {
if (row.original_email && trimmedEmail.toLowerCase() === row.original_email.toLowerCase()) {
throw InputValidationError.fromCode('new_email', ValidationErrorCodes.NEW_EMAIL_MUST_BE_DIFFERENT);
}
+ await assertEmailNotBlocklisted(trimmedEmail, 'new_email');
const hasValidDns = await emailDnsValidation.hasValidDnsRecords(trimmedEmail);
if (!hasValidDns) {
throw InputValidationError.fromCode('new_email', ValidationErrorCodes.EMAIL_DOMAIN_CANNOT_RECEIVE_MAIL);
diff --git a/fluxer_api/src/api/user/services/UserAccountLifecycleService.ts b/fluxer_api/src/api/user/services/UserAccountLifecycleService.ts
index eb0fc1a42..f45710a31 100644
--- a/fluxer_api/src/api/user/services/UserAccountLifecycleService.ts
+++ b/fluxer_api/src/api/user/services/UserAccountLifecycleService.ts
@@ -5,27 +5,22 @@ import * as AuthSession from '@app/api/auth/AuthSession';
import type {UserID} from '@app/api/BrandedTypes';
import {Config} from '@app/api/Config';
import type {IGuildRepositoryAggregate} from '@app/api/guild/repositories/IGuildRepositoryAggregate';
-import type {GuildService} from '@app/api/guild/services/GuildService';
import type {KVAccountDeletionQueueService} from '@app/api/infrastructure/KVAccountDeletionQueueService';
import {Logger} from '@app/api/Logger';
-import type {Guild} from '@app/api/models/Guild';
import type {User} from '@app/api/models/User';
-import {
- canEscapePhoneGate,
- type DeferredPhoneGateStatus,
- getDeferredPhoneGateConfig,
- guildTriggersPhoneGate,
- PHONE_GATE_ESCAPE_MAX_GUILDS,
- restorePhoneGateDeferral,
-} from '@app/api/risk/DeferredPhoneGate';
import type {IUserAccountRepository} from '@app/api/user/repositories/IUserAccountRepository';
import {reschedulePendingDeletion} from '@app/api/user/services/PendingDeletionCoordinator';
import type {UserAccountUpdatePropagator} from '@app/api/user/services/UserAccountUpdatePropagator';
import {getEffectiveSuspiciousFlags} from '@app/api/user/UserHelpers';
import {hasPartialUserFieldsChanged} from '@app/api/user/UserMappers';
import {DeletionReasons} from '@fluxer/constants/src/Core';
-import {DEFERRABLE_PHONE_FLAGS, DEFERRED_PHONE_ON_COMMUNITY_JOIN, UserFlags} from '@fluxer/constants/src/UserConstants';
-import {UnknownGuildMemberError} from '@fluxer/errors/src/domains/guild/UnknownGuildMemberError';
+import {
+ DEFERRABLE_PHONE_FLAGS,
+ DEFERRED_PHONE_ON_COMMUNITY_JOIN,
+ NEVER_DEFERRABLE_PHONE_FLAGS,
+ PHONE_GATE_PROMOTED_FROM_DEFERRAL,
+ UserFlags,
+} from '@fluxer/constants/src/UserConstants';
import {UserOwnsGuildsError} from '@fluxer/errors/src/domains/guild/UserOwnsGuildsError';
import {PhoneGateEscapeUnavailableError} from '@fluxer/errors/src/domains/user/PhoneGateEscapeUnavailableError';
import {UnknownUserError} from '@fluxer/errors/src/domains/user/UnknownUserError';
@@ -35,36 +30,31 @@ import {ms} from 'itty-time';
const WRITE_RESTORED_DEFERRAL_ATTEMPTS = 3;
+function holdsPromotedDeferral(user: User): boolean {
+ const flagBits = user.suspiciousActivityFlags ?? 0;
+ return (
+ !user.hasVerifiedPhone &&
+ (flagBits & PHONE_GATE_PROMOTED_FROM_DEFERRAL) !== 0 &&
+ (flagBits & DEFERRED_PHONE_ON_COMMUNITY_JOIN) === 0 &&
+ (flagBits & DEFERRABLE_PHONE_FLAGS) !== 0 &&
+ (flagBits & NEVER_DEFERRABLE_PHONE_FLAGS) === 0 &&
+ getEffectiveSuspiciousFlags(user) !== 0
+ );
+}
+
+function restorePhoneGateDeferral(flagBits: number): number {
+ return (flagBits | DEFERRED_PHONE_ON_COMMUNITY_JOIN) & ~PHONE_GATE_PROMOTED_FROM_DEFERRAL;
+}
+
interface UserAccountLifecycleServiceDeps {
apiContext: ApiContext;
userAccountRepository: IUserAccountRepository;
guildRepository: IGuildRepositoryAggregate;
- guildService: GuildService;
emailService: IEmailService;
updatePropagator: UserAccountUpdatePropagator;
kvDeletionQueue: KVAccountDeletionQueueService;
}
-interface PhoneGateEscapePlan {
- available: boolean;
- leavable: Array<Guild>;
- owned: Array<Guild>;
- gateStatus: DeferredPhoneGateStatus;
- threshold: number;
- refusedReason: 'ineligible' | 'not_locked' | null;
-}
-
-interface PhoneGateEscapePreview {
- available: boolean;
- guilds: Array<Guild>;
- ownedGuilds: Array<Guild>;
-}
-
-interface PhoneGateEscapeResult {
- user: User;
- remainingGuildCount: number;
-}
-
export class UserAccountLifecycleService {
constructor(private readonly deps: UserAccountLifecycleServiceDeps) {}
@@ -104,6 +94,8 @@ export class UserAccountLifecycleService {
flags: user.flags | UserFlags.SELF_DELETED,
pending_deletion_at: pendingDeletionAt,
deletion_reason_code: DeletionReasons.USER_REQUESTED,
+ deletion_scheduled_by: userId,
+ deletion_scheduled_at: new Date(),
});
await reschedulePendingDeletion({
userId,
@@ -113,6 +105,7 @@ export class UserAccountLifecycleService {
userRepository: this.deps.userAccountRepository,
deletionQueue: this.deps.kvDeletionQueue,
});
+ await AuthSession.terminateAllUserSessions(this.deps.apiContext, userId);
if (user.email) {
await this.deps.emailService.sendSelfDeletionScheduledEmail(
user.email,
@@ -121,7 +114,6 @@ export class UserAccountLifecycleService {
user.locale,
);
}
- await AuthSession.terminateAllUserSessions(this.deps.apiContext, userId);
if (updatedUser) {
await this.deps.updatePropagator.dispatchUserUpdate(updatedUser);
if (hasPartialUserFieldsChanged(user, updatedUser)) {
@@ -130,127 +122,38 @@ export class UserAccountLifecycleService {
}
}
- private async buildPhoneGateEscapePlan(user: User): Promise<PhoneGateEscapePlan> {
- const {status, config} = await getDeferredPhoneGateConfig();
- const refused = {
- available: false,
- leavable: [],
- owned: [],
- gateStatus: status,
- threshold: config.memberThreshold,
- };
- if (!canEscapePhoneGate(user, status)) {
- return {...refused, refusedReason: 'ineligible'};
- }
- if (getEffectiveSuspiciousFlags(user) === 0) {
- return {...refused, refusedReason: 'not_locked'};
- }
- const guilds = await this.deps.guildRepository.listUserGuilds(user.id);
- const qualifying = guilds.filter((guild) => guildTriggersPhoneGate(guild, config.memberThreshold));
- return {
- available: true,
- leavable: qualifying.filter((guild) => guild.ownerId !== user.id),
- owned: qualifying.filter((guild) => guild.ownerId === user.id),
- gateStatus: status,
- threshold: config.memberThreshold,
- refusedReason: null,
- };
- }
-
- async previewPhoneGateEscape(userId: UserID): Promise<PhoneGateEscapePreview> {
+ async previewPhoneGateEscape(userId: UserID): Promise<boolean> {
const user = await this.deps.userAccountRepository.findUnique(userId);
if (!user) {
throw new UnknownUserError();
}
- const plan = await this.buildPhoneGateEscapePlan(user);
- Logger.debug(
- {
- userId: userId.toString(),
- available: plan.available,
- refusedReason: plan.refusedReason,
- gateStatus: plan.gateStatus,
- qualifyingCount: plan.leavable.length + plan.owned.length,
- },
- 'deferred_phone_gate.escape_previewed',
- );
- return {available: plan.available, guilds: plan.leavable, ownedGuilds: plan.owned};
+ return holdsPromotedDeferral(user);
}
- async executePhoneGateEscape(userId: UserID): Promise<PhoneGateEscapeResult> {
- const startedAt = Date.now();
+ async executePhoneGateEscape(userId: UserID): Promise<User> {
const user = await this.deps.userAccountRepository.findUnique(userId);
if (!user) {
throw new UnknownUserError();
}
- const plan = await this.buildPhoneGateEscapePlan(user);
- const baseContext = {
+ const context = {
userId: userId.toString(),
accountAgeMs: Date.now() - snowflakeToDate(BigInt(user.id)).getTime(),
- gateStatus: plan.gateStatus,
- threshold: plan.threshold,
};
- if (!plan.available) {
- Logger.info({...baseContext, reason: plan.refusedReason}, 'deferred_phone_gate.escape_refused');
+ if (!holdsPromotedDeferral(user)) {
+ Logger.info(context, 'deferred_phone_gate.escape_refused');
throw new PhoneGateEscapeUnavailableError();
}
- const batch = plan.leavable.slice(0, PHONE_GATE_ESCAPE_MAX_GUILDS);
- const remainingGuildCount = plan.leavable.length - batch.length;
- const leftGuildIds: Array<string> = [];
- const skippedGuildIds: Array<string> = [];
- for (const guild of batch) {
- try {
- await this.deps.guildService.members.leaveGuild({userId: user.id, guildId: guild.id});
- leftGuildIds.push(guild.id.toString());
- } catch (error) {
- if (error instanceof UnknownGuildMemberError) {
- skippedGuildIds.push(guild.id.toString());
- continue;
- }
- Logger.warn(
- {
- ...baseContext,
- leftGuildIds,
- skippedGuildIds,
- unattemptedCount: batch.length - leftGuildIds.length - skippedGuildIds.length,
- error,
- },
- 'deferred_phone_gate.escape_failed',
- );
- throw error;
- }
- }
- if (remainingGuildCount > 0) {
- Logger.info(
- {...baseContext, leftGuildIds, skippedGuildIds, remainingGuildCount},
- 'deferred_phone_gate.escape_batch_completed',
- );
- return {user, remainingGuildCount};
- }
const updated = await this.writeRestoredDeferral(userId);
- if ((getEffectiveSuspiciousFlags(updated) & DEFERRABLE_PHONE_FLAGS) !== 0) {
- Logger.warn(
- {...baseContext, flagsAfter: updated.suspiciousActivityFlags ?? 0},
- 'deferred_phone_gate.escape_ineffective',
- );
- }
try {
await this.deps.updatePropagator.dispatchUserUpdate(updated);
} catch (error) {
- Logger.warn({...baseContext, error}, 'deferred_phone_gate.escape_dispatch_failed');
+ Logger.warn({...context, error}, 'deferred_phone_gate.escape_dispatch_failed');
}
Logger.info(
- {
- ...baseContext,
- leftGuildIds,
- skippedGuildIds,
- keptOwnedGuildIds: plan.owned.map((guild) => guild.id.toString()),
- flagsBefore: user.suspiciousActivityFlags ?? 0,
- flagsAfter: updated.suspiciousActivityFlags ?? 0,
- durationMs: Date.now() - startedAt,
- },
+ {...context, flagsBefore: user.suspiciousActivityFlags ?? 0, flagsAfter: updated.suspiciousActivityFlags ?? 0},
'deferred_phone_gate.escaped',
);
- return {user: updated, remainingGuildCount: 0};
+ return updated;
}
private async writeRestoredDeferral(userId: UserID): Promise<User> {
diff --git a/fluxer_api/src/api/user/services/UserAccountRequestService.ts b/fluxer_api/src/api/user/services/UserAccountRequestService.ts
index 4da7156fd..06dab1adf 100644
--- a/fluxer_api/src/api/user/services/UserAccountRequestService.ts
+++ b/fluxer_api/src/api/user/services/UserAccountRequestService.ts
@@ -2,30 +2,16 @@
import * as AuthEmailRevert from '@app/api/auth/AuthEmailRevert';
import {requireEmailVerified} from '@app/api/auth/EmailVerificationUtils';
-import type {IRegistrationRiskEvaluator} from '@app/api/auth/services/IRegistrationRiskEvaluator';
import {requireSudoMode, type SudoVerificationResult} from '@app/api/auth/services/SudoVerificationService';
import {createChannelID, createGuildID, type UserID} from '@app/api/BrandedTypes';
-import {Config} from '@app/api/Config';
import type {UserConnectionRow} from '@app/api/database/types/ConnectionTypes';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import {isBlockedEmailDomain} from '@app/api/infrastructure/activity/SharedLists';
import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import {Logger} from '@app/api/Logger';
import type {RequestCache} from '@app/api/middleware/RequestCacheMiddleware';
import type {AuthSession} from '@app/api/models/AuthSession';
import type {User} from '@app/api/models/User';
-import {stripDisallowedPhoneFlags} from '@app/api/risk/AbusePolicy';
-import {createAccountPolicyContactContext, type IAccountPolicyEvaluator} from '@app/api/risk/AccountPolicyEvaluator';
-import type {IRegistrationEventsRepository} from '@app/api/risk/adapters/VelocityAdapter';
-import type {IRiskHistoryRepository} from '@app/api/risk/HistoricalOutcomeRepository';
-import {derivePlusAddressBase} from '@app/api/risk/PlusAddressUtils';
-import type {IRiskAssessmentRepository} from '@app/api/risk/RiskAssessmentRepository';
-import {deriveLatestRiskContext} from '@app/api/risk/RiskHistoryContext';
-import {
- RecommendedAction,
- type RiskAssessment,
- RiskConfidence,
- RiskDecisionMethod,
- RiskLevel,
-} from '@app/api/risk/RiskTypes';
import type {HonoEnv} from '@app/api/types/HonoEnv';
import type {IUserRepository} from '@app/api/user/IUserRepository';
import type {EmailChangeService} from '@app/api/user/services/EmailChangeService';
@@ -43,14 +29,12 @@ import {
mapUserToPrivateResponse,
mapUserToProfileResponse,
} from '@app/api/user/UserMappers';
-import {lookupGeoip} from '@app/api/utils/IpUtils';
-import {DEFERRED_PHONE_ON_COMMUNITY_JOIN, imposePhoneRequirements} from '@fluxer/constants/src/UserConstants';
+import {extractEmailDomain} from '@app/api/utils/EmailDomainUtils';
import {ValidationErrorCodes} from '@fluxer/constants/src/ValidationErrorCodes';
import {getCurrentTimeZoneOffsetMinutes} from '@fluxer/date_utils/src/TimeZoneUtils';
import {InputValidationError} from '@fluxer/errors/src/domains/core/InputValidationError';
import {UnauthorizedError} from '@fluxer/errors/src/domains/core/UnauthorizedError';
import {AccountSuspiciousActivityError} from '@fluxer/errors/src/domains/user/AccountSuspiciousActivityError';
-import {requireClientIp} from '@fluxer/ip_utils/src/ClientIp';
import type {ConnectionResponse} from '@fluxer/schema/src/domains/connection/ConnectionSchemas';
import type {
EmailChangeApplyRequest,
@@ -103,20 +87,14 @@ function hasDefinedUserUpdatePayload(data: UserUpdatePayload): boolean {
return Object.values(data).some((value) => value !== undefined);
}
-function createPolicyOnlyEmailSetAssessment(): RiskAssessment {
- return {
- suspicious: false,
- level: RiskLevel.Low,
- confidence: RiskConfidence.Low,
- riskScore: 0,
- reasoning: 'email-set policy evaluation',
- recommendedAction: RecommendedAction.Allow,
- method: RiskDecisionMethod.Noop,
- modelUsed: 'account-policy',
- rounds: 0,
- elapsedMs: 0,
- signals: {},
- };
+function profileFieldsChanged(before: User, after: User): boolean {
+ return (
+ before.username !== after.username ||
+ before.globalName !== after.globalName ||
+ before.bio !== after.bio ||
+ before.avatarHash !== after.avatarHash ||
+ before.pronouns !== after.pronouns
+ );
}
interface UserProfileParams {
@@ -135,16 +113,6 @@ export class UserAccountRequestService {
private readonly userChannelService: UserChannelService,
private readonly userRepository: IUserRepository,
private readonly userCacheService: UserCacheService,
- private readonly isEmailDomainSuspicious: (domain: string) => Promise<boolean>,
- private readonly isEmailDomainDisposable: (domain: string) => Promise<boolean>,
- private readonly registrationRiskEvaluator: IRegistrationRiskEvaluator,
- private readonly accountPolicyEvaluator: IAccountPolicyEvaluator,
- private readonly registrationEventsRepository: IRegistrationEventsRepository,
- private readonly riskAssessmentRepository: IRiskAssessmentRepository,
- private readonly riskHistoryRepository: Pick<
- IRiskHistoryRepository,
- 'upsertLatestContext' | 'recordOutcomeForUser'
- >,
) {}
getCurrentUserResponse(params: {
@@ -188,7 +156,7 @@ export class UserAccountRequestService {
authSession: AuthSession;
}): Promise<UserPrivateResponse> {
const {ctx, body, authSession} = params;
- let {user} = params;
+ const {user} = params;
const oldEmail = user.email;
const sanitizedBody = await stripUnauthorizedProfileTimezoneUpdate(user, body);
const {
@@ -236,132 +204,8 @@ export class UserAccountRequestService {
emailFromToken = await this.emailChangeService.getTokenEmail(user.id, emailToken);
userUpdateData = {...userUpdateData, email: emailFromToken};
emailVerifiedViaToken = true;
- const request = ctx.req.raw;
- const userAgent = request.headers.get('user-agent');
- const currentSuspiciousFlags = user.suspiciousActivityFlags ?? 0;
- let nextSuspiciousFlags = currentSuspiciousFlags;
- let emailSetRiskAssessment: RiskAssessment | null = null;
- let emailSetRecommendedAction = RecommendedAction.Allow;
- let emailSetRiskIp: string | null = null;
- const contactContext = createAccountPolicyContactContext(emailFromToken);
- const contactPolicyDecision = this.accountPolicyEvaluator.evaluateContact(contactContext);
- const skipContactFollowupRisk = contactPolicyDecision.hasCapability('followup_risk_exempt');
- const skipStoredFollowupRiskChecks = this.shouldSkipFollowupRiskChecks(user);
- const skipFollowupRiskChecks = skipStoredFollowupRiskChecks || skipContactFollowupRisk;
- const plusTaggedEmailChange = derivePlusAddressBase(emailFromToken) !== null;
- const shouldRunPlusAddressRiskCheck = plusTaggedEmailChange && !user.hasEverPurchased;
- const newDomain = contactContext.domain;
- let contactDomainAdminListed = false;
- let contactDomainDisposable = false;
- let contactDomainBlocked = false;
- let contactDomainStepUpRequired = false;
- if (!skipFollowupRiskChecks && newDomain) {
- const [adminFlagged, isDisposable] = await Promise.all([
- this.isEmailDomainSuspicious(newDomain),
- this.isEmailDomainDisposable(newDomain),
- ]);
- contactDomainAdminListed = adminFlagged;
- contactDomainDisposable = isDisposable;
- contactDomainBlocked = this.accountPolicyEvaluator.isBlockedRegistrationEmailDomain(newDomain);
- contactDomainStepUpRequired = contactDomainBlocked || contactDomainAdminListed || contactDomainDisposable;
- }
- if (
- !skipContactFollowupRisk &&
- ((!skipStoredFollowupRiskChecks && isUnclaimed) || shouldRunPlusAddressRiskCheck)
- ) {
- try {
- emailSetRiskIp = requireClientIp(request, {
- trustClientIpHeader: Config.proxy.trust_client_ip_header,
- clientIpHeaderName: Config.proxy.client_ip_header,
- });
- const riskResult = await this.registrationRiskEvaluator.evaluate({
- email: emailFromToken,
- clientIp: emailSetRiskIp,
- locale: null,
- timezone: null,
- userAgent,
- });
- emailSetRiskAssessment = riskResult.assessment;
- emailSetRecommendedAction = riskResult.recommendedAction;
- } catch (error) {
- Logger.warn({error, userId: user.id}, 'Risk assessment failed during email set');
- throw error;
- }
- }
- const policyAssessment = emailSetRiskAssessment ?? createPolicyOnlyEmailSetAssessment();
- const policyDecision = this.accountPolicyEvaluator.evaluate({
- contact: {
- ...contactContext,
- domainAdminListed: contactDomainAdminListed,
- domainDisposable: contactDomainDisposable,
- domainBlocked: contactDomainBlocked,
- domainStepUpRequired: contactDomainStepUpRequired,
- },
- region: {
- code: null,
- stepUpRequired: false,
- },
- assessment: {
- raw: policyAssessment,
- level: policyAssessment.level,
- action: emailSetRecommendedAction,
- },
- });
- const policyFlagBits = await stripDisallowedPhoneFlags(
- policyDecision.flagBits,
- async () => (await lookupGeoip(request)).countryCode,
- );
- nextSuspiciousFlags = imposePhoneRequirements(nextSuspiciousFlags, policyFlagBits);
- if (nextSuspiciousFlags !== currentSuspiciousFlags) {
- user = await this.userRepository.patchUpsert(
- user.id,
- {suspicious_activity_flags: nextSuspiciousFlags},
- user.toRow(),
- );
- }
- if (emailSetRiskAssessment || nextSuspiciousFlags !== currentSuspiciousFlags) {
- const occurredAt = new Date();
- const resolvedClientIp =
- emailSetRiskIp ??
- requireClientIp(request, {
- trustClientIpHeader: Config.proxy.trust_client_ip_header,
- clientIpHeaderName: Config.proxy.client_ip_header,
- });
- const riskContext = deriveLatestRiskContext({
- userId: user.id.toString(),
- email: emailFromToken,
- clientIp: resolvedClientIp,
- asn: emailSetRiskAssessment?.signals.geoIpAsn?.asn ?? null,
- updatedAt: occurredAt,
- });
- (async () => {
- try {
- await this.riskHistoryRepository.upsertLatestContext(riskContext);
- if (nextSuspiciousFlags !== currentSuspiciousFlags && nextSuspiciousFlags !== 0) {
- await this.riskHistoryRepository.recordOutcomeForUser({
- userId: user.id.toString(),
- occurredAt,
- source: isUnclaimed ? 'claim_risk' : 'email_change_risk',
- outcomeCodes: ['challenged'],
- });
- }
- } catch (error) {
- Logger.warn({error, userId: user.id}, 'Failed to persist claim-time risk history');
- }
- })();
- if (emailSetRiskAssessment) {
- this.riskAssessmentRepository
- .recordAssessment({
- userId: user.id,
- ip: resolvedClientIp,
- email: emailFromToken,
- locale: null,
- assessment: emailSetRiskAssessment,
- })
- .catch((error) => {
- Logger.warn({error, userId: user.id}, 'Failed to persist claim-time risk assessment');
- });
- }
+ if (isBlockedEmailDomain(extractEmailDomain(emailFromToken))) {
+ throw InputValidationError.fromCode('email', ValidationErrorCodes.INVALID_EMAIL_ADDRESS);
}
}
const updatedUser = await this.userAccountService.update({
@@ -379,36 +223,25 @@ export class UserAccountRequestService {
!!emailFromToken &&
!!updatedUser.email &&
(oldEmail == null || oldEmail.toLowerCase() !== updatedUser.email.toLowerCase());
- if (emailActuallyChanged) {
- try {
- const request = ctx.req.raw;
- const resolvedClientIp = requireClientIp(request, {
- trustClientIpHeader: Config.proxy.trust_client_ip_header,
- clientIpHeaderName: Config.proxy.client_ip_header,
- });
- const occurredAt = new Date();
- const riskContext = deriveLatestRiskContext({
- userId: updatedUser.id.toString(),
- email: updatedUser.email,
- clientIp: resolvedClientIp,
- asn: null,
- updatedAt: occurredAt,
- });
- this.registrationEventsRepository
- .recordEvent({
- userId: updatedUser.id.toString(),
- email: updatedUser.email,
- emailDomain: riskContext.emailDomain,
- ip: resolvedClientIp,
- locale: updatedUser.locale ?? null,
- createdAt: occurredAt,
- })
- .catch((error) => {
- Logger.warn({error, userId: updatedUser.id}, 'Failed to record email-set registration event');
- });
- } catch (error) {
- Logger.warn({error, userId: updatedUser.id}, 'Failed to resolve client IP for email-set registration event');
- }
+ if (emailActuallyChanged && updatedUser.email) {
+ await emitActivity('email_changed', updatedUser.id.toString(), {
+ user_id: updatedUser.id.toString(),
+ new_email: updatedUser.email,
+ was_unclaimed: isUnclaimed,
+ has_ever_purchased: updatedUser.hasEverPurchased,
+ suspicious_flags: updatedUser.suspiciousActivityFlags ?? 0,
+ suspicious_flags_before: user.suspiciousActivityFlags ?? 0,
+ });
+ }
+ if (profileFieldsChanged(user, updatedUser)) {
+ await emitActivity('profile_updated', updatedUser.id.toString(), {
+ user_id: updatedUser.id.toString(),
+ username: updatedUser.username,
+ global_name: updatedUser.globalName,
+ bio: updatedUser.bio,
+ avatar_hash: updatedUser.avatarHash,
+ pronouns: updatedUser.pronouns,
+ });
}
if (emailActuallyChanged && oldEmail) {
try {
@@ -559,10 +392,6 @@ export class UserAccountRequestService {
response.pending_bulk_message_deletion = null;
}
- private shouldSkipFollowupRiskChecks(user: User): boolean {
- return user.hasEverPurchased || ((user.suspiciousActivityFlags ?? 0) & ~DEFERRED_PHONE_ON_COMMUNITY_JOIN) === 0;
- }
-
private enforceUserAccess(user: User): void {
const flags = getEffectiveSuspiciousFlags(user);
if (flags !== 0) {
diff --git a/fluxer_api/src/api/user/services/UserAccountSecurityService.ts b/fluxer_api/src/api/user/services/UserAccountSecurityService.ts
index f1d1e4954..769b90ef1 100644
--- a/fluxer_api/src/api/user/services/UserAccountSecurityService.ts
+++ b/fluxer_api/src/api/user/services/UserAccountSecurityService.ts
@@ -4,6 +4,7 @@ import type {ApiContext} from '@app/api/ApiContext';
import * as AuthMfa from '@app/api/auth/AuthMfa';
import * as AuthPassword from '@app/api/auth/AuthPassword';
import * as AuthSession from '@app/api/auth/AuthSession';
+import {assertEmailNotBlocklisted} from '@app/api/auth/EmailBlocklist';
import {deriveSudoMethods, userHasSudoCapability} from '@app/api/auth/services/SudoMethods';
import type {SudoVerificationResult} from '@app/api/auth/services/SudoVerificationService';
import {Config} from '@app/api/Config';
@@ -138,6 +139,7 @@ export class UserAccountSecurityService {
}
if (rawEmail) {
if (normalizedEmail && normalizedEmail !== user.email?.toLowerCase()) {
+ await assertEmailNotBlocklisted(normalizedEmail, 'email');
const existing = await this.deps.userAccountRepository.findByEmail(normalizedEmail);
if (existing && existing.id !== user.id) {
throw InputValidationError.fromCode('email', ValidationErrorCodes.EMAIL_ALREADY_IN_USE);
diff --git a/fluxer_api/src/api/user/services/UserAccountService.ts b/fluxer_api/src/api/user/services/UserAccountService.ts
index 75c19b7c4..ae1c928ed 100644
--- a/fluxer_api/src/api/user/services/UserAccountService.ts
+++ b/fluxer_api/src/api/user/services/UserAccountService.ts
@@ -132,7 +132,6 @@ export class UserAccountService {
apiContext: this.apiContext,
userAccountRepository,
guildRepository,
- guildService,
emailService,
updatePropagator: this.updatePropagator,
kvDeletionQueue,
diff --git a/fluxer_api/src/api/user/services/UserActivityBuffer.ts b/fluxer_api/src/api/user/services/UserActivityBuffer.ts
index 6075c91a6..8944dc6e0 100644
--- a/fluxer_api/src/api/user/services/UserActivityBuffer.ts
+++ b/fluxer_api/src/api/user/services/UserActivityBuffer.ts
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import type {UserID} from '@app/api/BrandedTypes';
-import {upsertOne} from '@app/api/database/CassandraQueryExecution';
+import {fetchMany, upsertOne} from '@app/api/database/CassandraQueryExecution';
import {Db} from '@app/api/database/CassandraTypes';
import {Logger} from '@app/api/Logger';
import {AuthSessions} from '@app/api/Tables';
@@ -15,8 +15,14 @@ const PENDING_AUTH_SESSION_HASH_KEY = 'auth_session_activity:pending';
const AUTH_SESSION_TOUCH_KEY_PREFIX = 'auth_session_activity:touched:';
const WRITE_CONCURRENCY = 64;
const AUTH_SESSION_TOUCH_DEBOUNCE_TTL_SECONDS = seconds('5 minutes');
+const AUTH_SESSION_EXISTENCE_READ_SLICE = 100;
type ActivityWriter = typeof upsertOne;
+const FETCH_AUTH_SESSION_OWNERS_CQL = AuthSessions.selectCql({
+ columns: ['session_id_hash', 'user_id'],
+ where: AuthSessions.where.in('session_id_hash', 'session_id_hashes'),
+});
+
interface UserActivityAccountWriter {
updateLastActiveAt(params: {userId: UserID; lastActiveAt: Date; lastActiveIp?: string}): Promise<void>;
}
@@ -135,6 +141,13 @@ export class UserActivityBuffer {
}
}
+ async forgetAuthSessions(sessionIdHashes: ReadonlyArray<Buffer>): Promise<void> {
+ if (sessionIdHashes.length === 0) return;
+ const encoded = sessionIdHashes.map((sessionIdHash) => this.encodeSessionIdHash(sessionIdHash));
+ await this.kv.hdel(PENDING_AUTH_SESSION_HASH_KEY, ...encoded);
+ await this.kv.del(...encoded.map((value) => `${AUTH_SESSION_TOUCH_KEY_PREFIX}${value}`));
+ }
+
async drainAndFlush(): Promise<
FlushStats & {
users: FlushStats;
@@ -167,14 +180,30 @@ export class UserActivityBuffer {
private async drainAndFlushAuthSessions(): Promise<FlushStats> {
const drained = await this.atomicDrainAuthSessions();
- return flushActivityEntries(
- drained,
+ const live = await this.liveAuthSessionHashes(drained.map(({sessionIdHash}) => sessionIdHash));
+ const writable = drained.filter(({sessionIdHash}) => live.has(this.encodeSessionIdHash(sessionIdHash)));
+ const stats = await flushActivityEntries(
+ writable,
({sessionIdHash, entry}) =>
this.writer(
AuthSessions.patchByPk({session_id_hash: sessionIdHash}, {approx_last_used_at: Db.set(new Date(entry.ts))}),
),
'Failed to flush an auth session activity entry',
);
+ return {...stats, drained: drained.length, skipped: stats.skipped + drained.length - writable.length};
+ }
+
+ private async liveAuthSessionHashes(sessionIdHashes: ReadonlyArray<Buffer>): Promise<Set<string>> {
+ const live = new Set<string>();
+ for (let index = 0; index < sessionIdHashes.length; index += AUTH_SESSION_EXISTENCE_READ_SLICE) {
+ const rows = await fetchMany<{session_id_hash: Buffer; user_id: UserID | null}>(FETCH_AUTH_SESSION_OWNERS_CQL, {
+ session_id_hashes: sessionIdHashes.slice(index, index + AUTH_SESSION_EXISTENCE_READ_SLICE),
+ });
+ for (const row of rows) {
+ if (row.user_id != null) live.add(this.encodeSessionIdHash(row.session_id_hash));
+ }
+ }
+ return live;
}
private async drainPendingHash(key: string): Promise<Array<[string, string]>> {
diff --git a/fluxer_api/src/api/user/services/UserAuthRequestService.ts b/fluxer_api/src/api/user/services/UserAuthRequestService.ts
index 029d36bf9..5ceb112e9 100644
--- a/fluxer_api/src/api/user/services/UserAuthRequestService.ts
+++ b/fluxer_api/src/api/user/services/UserAuthRequestService.ts
@@ -140,7 +140,7 @@ export class UserAuthRequestService {
challenge_code: result.challengeCode,
our_number: result.ourNumber,
expires_at: result.expiresAt.toISOString(),
- reason: result.reason,
+ reason: 'verification_required',
};
}
return {channel: result.channel};
diff --git a/fluxer_api/src/api/user/services/UserChannelService.ts b/fluxer_api/src/api/user/services/UserChannelService.ts
index c3841c84d..633ea6ff6 100644
--- a/fluxer_api/src/api/user/services/UserChannelService.ts
+++ b/fluxer_api/src/api/user/services/UserChannelService.ts
@@ -12,9 +12,11 @@ import {
createMessageResponseDataService,
messageResponseAccessForGuild,
} from '@app/api/channel/services/message/MessageResponseDataService';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
import type {ISnowflakeService} from '@app/api/infrastructure/ISnowflakeService';
import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
+import {Logger} from '@app/api/Logger';
import type {LimitConfigService} from '@app/api/limits/LimitConfigService';
import {resolveLimitSafe} from '@app/api/limits/LimitConfigUtils';
import {createLimitMatchContext} from '@app/api/limits/LimitMatchContextBuilder';
@@ -25,8 +27,7 @@ import type {User} from '@app/api/models/User';
import type {IUserAccountRepository} from '@app/api/user/repositories/IUserAccountRepository';
import type {IUserChannelRepository} from '@app/api/user/repositories/IUserChannelRepository';
import type {IUserRelationshipRepository} from '@app/api/user/repositories/IUserRelationshipRepository';
-import type {DirectMessageSpamMitigationService} from '@app/api/user/services/DirectMessageSpamMitigationService';
-import {createDirectMessageSpamMitigationService} from '@app/api/user/services/DirectMessageSpamMitigationService';
+import {isDirectDeliverySuppressed} from '@app/api/user/UserHelpers';
import type {UserPermissionUtils} from '@app/api/utils/UserPermissionUtils';
import {ChannelTypes, MessageTypes} from '@fluxer/constants/src/ChannelConstants';
import type {LimitKey} from '@fluxer/constants/src/LimitConfigMetadata';
@@ -56,7 +57,6 @@ export class UserChannelService {
private readonly snowflakeService: ISnowflakeService;
private readonly userPermissionUtils: UserPermissionUtils;
private readonly limitConfigService: LimitConfigService;
- private readonly dmSpamMitigationService: DirectMessageSpamMitigationService | null;
constructor(
apiContext: ApiContext,
@@ -105,7 +105,6 @@ export class UserChannelService {
this.channelRepository = channelRepository;
this.userPermissionUtils = userPermissionUtils;
this.limitConfigService = limitConfigService;
- this.dmSpamMitigationService = createDirectMessageSpamMitigationService(apiContext, this.userRepository);
return;
}
const [
@@ -124,7 +123,6 @@ export class UserChannelService {
this.channelRepository = channelRepository;
this.userPermissionUtils = userPermissionUtils;
this.limitConfigService = limitConfigService;
- this.dmSpamMitigationService = null;
}
async getPrivateChannels(userId: UserID): Promise<Array<Channel>> {
@@ -166,7 +164,28 @@ export class UserChannelService {
if (userId === recipientId) {
throw InputValidationError.fromCode('recipient_id', ValidationErrorCodes.CANNOT_DM_YOURSELF);
}
- if (this.dmSpamMitigationService?.shouldSuppressDirectMessageDelivery(callingUser)) {
+ const suppressed = isDirectDeliverySuppressed(callingUser);
+ const channel = await this.openOneToOneDMChannel({userId, recipientId, suppressed, userCacheService, requestCache});
+ if (!callingUser.isSystem) {
+ void this.emitDmOpened({userId, recipientId, channelId: channel.id, delivered: !suppressed});
+ }
+ return channel;
+ }
+
+ private async openOneToOneDMChannel({
+ userId,
+ recipientId,
+ suppressed,
+ userCacheService,
+ requestCache,
+ }: {
+ userId: UserID;
+ recipientId: UserID;
+ suppressed: boolean;
+ userCacheService: UserCacheService;
+ requestCache: RequestCache;
+ }): Promise<Channel> {
+ if (suppressed) {
const targetUser = await this.userRepository.findUnique(recipientId);
if (!targetUser) throw new UnknownUserError();
return await this.createOrOpenLocalOnlyDMChannel({userId, recipientId, userCacheService, requestCache});
@@ -180,6 +199,30 @@ export class UserChannelService {
return await this.createNewDMChannel({userId, recipientId, userCacheService, requestCache});
}
+ private async emitDmOpened(params: {
+ userId: UserID;
+ recipientId: UserID;
+ channelId: ChannelID;
+ delivered: boolean;
+ }): Promise<void> {
+ try {
+ const friendship = await this.userRepository.getRelationship(
+ params.userId,
+ params.recipientId,
+ RelationshipTypes.FRIEND,
+ );
+ await emitActivity('dm_opened', params.userId.toString(), {
+ user_id: params.userId.toString(),
+ recipient_id: params.recipientId.toString(),
+ channel_id: params.channelId.toString(),
+ recipient_is_friend: friendship !== null,
+ delivered: params.delivered,
+ });
+ } catch (error) {
+ Logger.debug({error}, 'DM activity event could not be built');
+ }
+ }
+
async pinDmChannel({userId, channelId}: {userId: UserID; channelId: ChannelID}): Promise<void> {
const channel = await this.channelService.channelData.operations.getChannel({userId, channelId});
if (channel.type !== ChannelTypes.DM && channel.type !== ChannelTypes.GROUP_DM) {
diff --git a/fluxer_api/src/api/user/services/UserDeletionService.ts b/fluxer_api/src/api/user/services/UserDeletionService.ts
index a570beea6..1b4440e51 100644
--- a/fluxer_api/src/api/user/services/UserDeletionService.ts
+++ b/fluxer_api/src/api/user/services/UserDeletionService.ts
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {randomInt} from 'node:crypto';
+import {revokeAllAuthSessions} from '@app/api/auth/AuthSessionRevocation';
import {createMessageID, createUserID, type MessageID, type UserID} from '@app/api/BrandedTypes';
import {Config} from '@app/api/Config';
import {mapChannelToResponse} from '@app/api/channel/ChannelMappers';
@@ -8,6 +9,7 @@ import type {ChannelRepository} from '@app/api/channel/ChannelRepository';
import type {IConnectionRepository} from '@app/api/connection/IConnectionRepository';
import type {FavoriteMemeRepository} from '@app/api/favorite_meme/FavoriteMemeRepository';
import type {GuildRepository} from '@app/api/guild/repositories/GuildRepository';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
import type {IPurgeQueue} from '@app/api/infrastructure/CachePurgeQueue';
import type {DiscriminatorService} from '@app/api/infrastructure/DiscriminatorService';
import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
@@ -439,7 +441,7 @@ export async function processUserDeletion(
userRepository.deleteAllNotes(userId),
userRepository.deleteAllReadStates(userId),
userRepository.deleteAllSavedMessages(userId),
- userRepository.deleteAllAuthSessions(userId),
+ revokeAllAuthSessions({users: userRepository, gateway: gatewayService}, userId),
userRepository.deleteAllMfaBackupCodes(userId),
userRepository.deleteAllWebAuthnCredentials(userId),
userRepository.deleteAllPushSubscriptions(userId),
@@ -478,5 +480,6 @@ export async function processUserDeletion(
await userRepository.removePendingDeletion(userId, pendingDeletionAt);
await userCacheService.setUserPartialResponseFromUser(anonymisedUser);
await userRepository.completeDeletion(anonymisedUser);
+ await emitActivity('account_deleted', userId.toString(), {user_id: userId.toString()}, null, userId.toString());
Logger.debug({userId, deletionReasonCode}, 'User account anonymization completed successfully');
}
diff --git a/fluxer_api/src/api/user/services/UserRelationshipService.ts b/fluxer_api/src/api/user/services/UserRelationshipService.ts
index 324a9eff2..12b4d4ff3 100644
--- a/fluxer_api/src/api/user/services/UserRelationshipService.ts
+++ b/fluxer_api/src/api/user/services/UserRelationshipService.ts
@@ -3,6 +3,7 @@
import type {ApiContext} from '@app/api/ApiContext';
import {requireEmailVerified} from '@app/api/auth/EmailVerificationUtils';
import type {UserID} from '@app/api/BrandedTypes';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
import type {UserCacheService} from '@app/api/infrastructure/UserCacheService';
import type {LimitConfigService} from '@app/api/limits/LimitConfigService';
@@ -15,9 +16,8 @@ import type {User} from '@app/api/models/User';
import type {IUserAccountRepository} from '@app/api/user/repositories/IUserAccountRepository';
import type {IUserRelationshipRepository} from '@app/api/user/repositories/IUserRelationshipRepository';
import type {IUserSettingsRepository} from '@app/api/user/repositories/IUserSettingsRepository';
-import type {DirectMessageSpamMitigationService} from '@app/api/user/services/DirectMessageSpamMitigationService';
-import {createDirectMessageSpamMitigationService} from '@app/api/user/services/DirectMessageSpamMitigationService';
import {getCachedUserPartialResponse} from '@app/api/user/UserCacheHelpers';
+import {isDirectDeliverySuppressed} from '@app/api/user/UserHelpers';
import {mapRelationshipToResponse} from '@app/api/user/UserMappers';
import type {UserPermissionUtils} from '@app/api/utils/UserPermissionUtils';
import type {LimitKey} from '@fluxer/constants/src/LimitConfigMetadata';
@@ -47,10 +47,24 @@ interface UserRelationshipRepository
IUserRelationshipRepository,
IUserSettingsRepository {}
+function emitUserBlocked(userId: UserID, targetId: UserID): void {
+ void emitActivity('user_blocked', targetId.toString(), {
+ blocker_id: userId.toString(),
+ blocked_id: targetId.toString(),
+ });
+}
+
+function emitFriendRequest(userId: UserID, targetId: UserID, delivered: boolean): void {
+ void emitActivity('friend_request', userId.toString(), {
+ user_id: userId.toString(),
+ target_id: targetId.toString(),
+ delivered,
+ });
+}
+
export class UserRelationshipService {
private readonly userRepository: UserRelationshipRepository;
private readonly gatewayService: IGatewayService;
- private readonly dmSpamMitigationService: DirectMessageSpamMitigationService;
constructor(
apiContext: ApiContext,
@@ -60,7 +74,6 @@ export class UserRelationshipService {
const {users, gateway} = apiContext.services;
this.userRepository = users;
this.gatewayService = gateway;
- this.dmSpamMitigationService = createDirectMessageSpamMitigationService(apiContext, this.userRepository);
}
async getRelationship(params: {userId: UserID; targetId: UserID; type: number}): Promise<Relationship | null> {
@@ -129,7 +142,8 @@ export class UserRelationshipService {
if (!requesterUser) {
throw new UnknownUserError();
}
- if (this.dmSpamMitigationService.shouldSuppressDirectMessageDelivery(requesterUser)) {
+ if (isDirectDeliverySuppressed(requesterUser)) {
+ emitFriendRequest(userId, targetId, false);
return await this.createShadowFriendRequest({
requesterUser,
userId,
@@ -169,22 +183,10 @@ export class UserRelationshipService {
return relationship;
}
}
- const spamDecision = await this.dmSpamMitigationService.recordFriendRequestSend({
- requester: requesterUser,
- targetId,
- });
- if (spamDecision.shouldSuppressRecipientDelivery) {
- return await this.createShadowFriendRequest({
- requesterUser,
- userId,
- targetId,
- userCacheService,
- requestCache,
- });
- }
const targetUser = await this.validateFriendRequest({userId, targetId});
await this.validateRelationshipCounts({userId, targetId});
const requestRelationship = await this.createFriendRequest({userId, targetId, userCacheService, requestCache});
+ emitFriendRequest(userId, targetId, true);
const targetIsFriendlyBot =
targetUser.isBot && (targetUser.flags & UserFlags.FRIENDLY_BOT) === UserFlags.FRIENDLY_BOT;
const manualApprovalFlag = UserFlags.FRIENDLY_BOT_MANUAL_APPROVAL;
@@ -341,6 +343,7 @@ export class UserRelationshipService {
userCacheService,
requestCache,
});
+ emitUserBlocked(userId, targetId);
return blockRelationship;
}
diff --git a/fluxer_api/src/api/user/tests/AccountClosureSessions.test.ts b/fluxer_api/src/api/user/tests/AccountClosureSessions.test.ts
new file mode 100644
index 000000000..729f079a6
--- /dev/null
+++ b/fluxer_api/src/api/user/tests/AccountClosureSessions.test.ts
@@ -0,0 +1,249 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {randomBytes} from 'node:crypto';
+import {revokeAllAuthSessions} from '@app/api/auth/AuthSessionRevocation';
+import {createTestAccount, loginAccount, setUserACLs} from '@app/api/auth/tests/AuthTestUtils';
+import {createApplicationID, createUserID, type UserID} from '@app/api/BrandedTypes';
+import {fetchMany} from '@app/api/database/CassandraQueryExecution';
+import type {AuthSessionRow} from '@app/api/database/types/AuthTypes';
+import {getGatewayService} from '@app/api/middleware/ServiceRegistry';
+import {getUserActivityBuffer, getUserRepository} from '@app/api/middleware/ServiceSingletons';
+import {OAuth2TokenRepository} from '@app/api/oauth/repositories/OAuth2TokenRepository';
+import {AuthSessions} from '@app/api/Tables';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {InMemoryCassandraQueryExecutor} from '@app/api/test/InMemoryCassandraQueryExecutor';
+import {HTTP_STATUS} from '@app/api/test/TestConstants';
+import {createBuilder} from '@app/api/test/TestRequestBuilder';
+import {AuthSessionRepository} from '@app/api/user/repositories/auth/AuthSessionRepository';
+import {DeletionReasons} from '@fluxer/constants/src/Core';
+import {UserFlags} from '@fluxer/constants/src/UserConstants';
+import {TestEmailService} from '@pkgs/email/src/TestEmailService';
+import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest';
+
+const FETCH_SESSION_ROW_CQL = AuthSessions.selectCql({where: AuthSessions.where.eq('session_id_hash')});
+
+function sessionRow(userId: UserID): AuthSessionRow {
+ const now = new Date();
+ return {
+ user_id: userId,
+ session_id_hash: randomBytes(32),
+ created_at: now,
+ approx_last_used_at: now,
+ client_ip: '203.0.113.20',
+ client_user_agent: null,
+ client_os: null,
+ client_country: null,
+ version: 1,
+ };
+}
+
+async function readSessionRows(sessionIdHash: Buffer): Promise<Array<Record<string, unknown>>> {
+ return fetchMany<Record<string, unknown>>(FETCH_SESSION_ROW_CQL, {session_id_hash: sessionIdHash});
+}
+
+async function markDeleted(userId: UserID): Promise<void> {
+ const users = getUserRepository();
+ const user = (await users.findUnique(userId))!;
+ await users.patchUpsert(userId, {flags: user.flags | UserFlags.DELETED}, user.toRow());
+}
+
+describe('Account closure and credentials', () => {
+ let harness: ApiTestHarness;
+ beforeEach(async () => {
+ harness = await createApiTestHarness();
+ });
+ afterEach(async () => {
+ vi.restoreAllMocks();
+ await harness?.shutdown();
+ });
+
+ test('revoking every session of a user with 250 sessions uses bounded batches', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ const sessions = new AuthSessionRepository();
+ for (let index = 0; index < 250; index++) {
+ await sessions.createAuthSession(sessionRow(userId));
+ }
+ const batchSpy = vi.spyOn(InMemoryCassandraQueryExecutor.prototype, 'executeBatch');
+ const revoked = await revokeAllAuthSessions({users: getUserRepository(), gateway: getGatewayService()}, userId);
+ expect(revoked).toBe(251);
+ expect(Math.max(...batchSpy.mock.calls.map(([queries]) => queries.length))).toBeLessThanOrEqual(60);
+ expect(await sessions.listAuthSessions(userId)).toHaveLength(0);
+ expect(await sessions.listAuthSessionTombstones(userId)).toHaveLength(251);
+ await createBuilder(harness, account.token).get('/users/@me').expect(HTTP_STATUS.UNAUTHORIZED).execute();
+ });
+
+ test('a session of a user with the DELETED flag is refused and revoked', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ await markDeleted(userId);
+ await createBuilder(harness, account.token).get('/users/@me').expect(HTTP_STATUS.UNAUTHORIZED).execute();
+ await vi.waitFor(async () => {
+ expect(await new AuthSessionRepository().listAuthSessions(userId)).toHaveLength(0);
+ });
+ });
+
+ test('a session of a user whose deletion has started is refused', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ const users = getUserRepository();
+ const user = (await users.findUnique(userId))!;
+ const pendingDeletionAt = new Date();
+ await users.updateDeletionSchedule(user, {
+ flags: user.flags | UserFlags.SELF_DELETED,
+ pending_deletion_at: pendingDeletionAt,
+ });
+ expect(await users.startDeletion(userId, pendingDeletionAt)).not.toBeNull();
+ await createBuilder(harness, account.token).get('/users/@me').expect(HTTP_STATUS.UNAUTHORIZED).execute();
+ });
+
+ test('gateway identify rejects a session of a closed account', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ await createBuilder(harness, '')
+ .post('/test/rpc-session-init')
+ .body({type: 'session', token: account.token, version: 1, ip: '127.0.0.1'})
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ await markDeleted(userId);
+ const response = await harness.requestJson({
+ path: '/test/rpc-session-init',
+ method: 'POST',
+ body: {type: 'session', token: account.token, version: 1, ip: '127.0.0.1'},
+ });
+ expect(response.status).toBe(HTTP_STATUS.UNAUTHORIZED);
+ });
+
+ test('a session of a temporarily banned user is refused on every request and at identify', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ const other = await createTestAccount(harness);
+ const users = getUserRepository();
+ const user = (await users.findUnique(userId))!;
+ await users.patchUpsert(
+ userId,
+ {flags: user.flags | UserFlags.DISABLED, temp_banned_until: new Date(Date.now() + 3_600_000)},
+ user.toRow(),
+ );
+ await createBuilder(harness, account.token).get('/users/@me').expect(HTTP_STATUS.UNAUTHORIZED).execute();
+ const identify = await harness.requestJson({
+ path: '/test/rpc-session-init',
+ method: 'POST',
+ body: {type: 'session', token: other.token, version: 1, ip: '127.0.0.1'},
+ });
+ expect(identify.status).toBe(HTTP_STATUS.OK);
+ const otherUser = (await users.findUnique(createUserID(BigInt(other.userId))))!;
+ await users.patchUpsert(
+ otherUser.id,
+ {flags: otherUser.flags | UserFlags.DISABLED, temp_banned_until: new Date(Date.now() + 3_600_000)},
+ otherUser.toRow(),
+ );
+ const refused = await harness.requestJson({
+ path: '/test/rpc-session-init',
+ method: 'POST',
+ body: {type: 'session', token: other.token, version: 1, ip: '127.0.0.1'},
+ });
+ expect(refused.status).toBe(HTTP_STATUS.UNAUTHORIZED);
+ });
+
+ test('a session outlives a temporary ban that has already ended', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ const users = getUserRepository();
+ const user = (await users.findUnique(userId))!;
+ await users.patchUpsert(
+ userId,
+ {flags: user.flags | UserFlags.DISABLED, temp_banned_until: new Date(Date.now() - 60_000)},
+ user.toRow(),
+ );
+ await createBuilder(harness, account.token).get('/users/@me').expect(HTTP_STATUS.OK).execute();
+ });
+
+ test('a disabled account can still sign in again by logging in', async () => {
+ const account = await createTestAccount(harness);
+ await createBuilder(harness, account.token)
+ .post('/users/@me/disable')
+ .body({password: account.password})
+ .expect(HTTP_STATUS.NO_CONTENT)
+ .execute();
+ const login = await loginAccount(harness, account);
+ await createBuilder(harness, login.token).get('/users/@me').expect(HTTP_STATUS.OK).execute();
+ });
+
+ test('the activity flush after a revoke does not recreate the session row', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ const sessions = new AuthSessionRepository();
+ const row = sessionRow(userId);
+ await sessions.createAuthSession(row);
+ const buffer = getUserActivityBuffer();
+ expect(await buffer.recordAuthSessionActivity(row.session_id_hash, new Date())).toBe(true);
+ await sessions.deleteAuthSessions(userId, [row.session_id_hash]);
+ const encoded = row.session_id_hash.toString('base64url');
+ expect((await harness.kvProvider.hgetall('auth_session_activity:pending'))[encoded]).toBeUndefined();
+ await harness.kvProvider.hset('auth_session_activity:pending', encoded, JSON.stringify({ts: Date.now()}));
+ await buffer.drainAndFlush();
+ expect(await readSessionRows(row.session_id_hash)).toHaveLength(0);
+ });
+
+ test('the activity flush still records use of a live session', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ const sessions = new AuthSessionRepository();
+ const row = {...sessionRow(userId), approx_last_used_at: new Date(Date.now() - 86_400_000)};
+ await sessions.createAuthSession(row);
+ const usedAt = new Date();
+ await getUserActivityBuffer().recordAuthSessionActivity(row.session_id_hash, usedAt);
+ await getUserActivityBuffer().drainAndFlush();
+ const [stored] = await sessions
+ .listAuthSessions(userId)
+ .then((list) => list.filter((session) => session.sessionIdHash.equals(row.session_id_hash)));
+ expect(stored?.approximateLastUsedAt.getTime()).toBe(usedAt.getTime());
+ });
+
+ test('scheduling a deletion revokes every session and OAuth token', async () => {
+ const admin = await createTestAccount(harness);
+ await setUserACLs(harness, admin, ['admin:authenticate', 'user:delete']);
+ const target = await createTestAccount(harness);
+ const userId = createUserID(BigInt(target.userId));
+ const tokens = new OAuth2TokenRepository();
+ const applicationId = createApplicationID(1234567890123456789n);
+ for (let index = 0; index < 40; index++) {
+ await tokens.createAccessToken({
+ token_: `access-${index}-${target.userId}`,
+ application_id: applicationId,
+ user_id: userId,
+ scope: new Set(['identify']),
+ created_at: new Date(),
+ });
+ await tokens.createRefreshToken({
+ token_: `refresh-${index}-${target.userId}`,
+ application_id: applicationId,
+ user_id: userId,
+ scope: new Set(['identify']),
+ created_at: new Date(),
+ });
+ }
+ await createBuilder(harness, admin.token)
+ .put(`/admin/users/${target.userId}/deletion`)
+ .body({reason_code: DeletionReasons.SPAM, days_until_deletion: 60})
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ expect(await new AuthSessionRepository().listAuthSessions(userId)).toHaveLength(0);
+ expect(await tokens.getAccessToken(`access-0-${target.userId}`)).toBeNull();
+ expect(await tokens.listRefreshTokensForUser(userId)).toHaveLength(0);
+ });
+
+ test('self deletion revokes sessions even when the confirmation email fails', async () => {
+ const account = await createTestAccount(harness);
+ vi.spyOn(TestEmailService.prototype, 'sendSelfDeletionScheduledEmail').mockRejectedValue(new Error('mail down'));
+ const response = await harness.requestJson({
+ path: '/users/@me/delete',
+ method: 'POST',
+ body: {password: account.password},
+ headers: {Authorization: account.token},
+ });
+ expect(response.status).toBeGreaterThanOrEqual(400);
+ expect(await new AuthSessionRepository().listAuthSessions(createUserID(BigInt(account.userId)))).toHaveLength(0);
+ });
+});
diff --git a/fluxer_api/src/api/user/tests/AccountDeleteLargeFootprint.test.ts b/fluxer_api/src/api/user/tests/AccountDeleteLargeFootprint.test.ts
new file mode 100644
index 000000000..d0401c78d
--- /dev/null
+++ b/fluxer_api/src/api/user/tests/AccountDeleteLargeFootprint.test.ts
@@ -0,0 +1,97 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createTestAccount} from '@app/api/auth/tests/AuthTestUtils';
+import {createGuildID, createUserID, type UserID} from '@app/api/BrandedTypes';
+import {fetchMany} from '@app/api/database/CassandraQueryExecution';
+import {GuildModerationRepository} from '@app/api/guild/repositories/GuildModerationRepository';
+import {Notes, RelationshipsByTarget} from '@app/api/Tables';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {InMemoryCassandraQueryExecutor} from '@app/api/test/InMemoryCassandraQueryExecutor';
+import {createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
+import {UserRelationshipRepository} from '@app/api/user/repositories/UserRelationshipRepository';
+import {deleteAccount, setPendingDeletionAt, waitForDeletionCompletion} from '@app/api/user/tests/UserTestUtils';
+import {RelationshipTypes} from '@fluxer/constants/src/UserConstants';
+import {afterEach, beforeEach, describe, expect, test, vi} from 'vitest';
+
+const RELATIONSHIPS_EACH_WAY = 320;
+const GUILD_BANS = 150;
+const NOTES_ABOUT_USER = 120;
+const FIRST_OTHER_ID = 1_300_000_000_000_000_000n;
+
+function otherUserId(index: number): UserID {
+ return createUserID(FIRST_OTHER_ID + BigInt(index));
+}
+
+describe('Deleting an account with a large footprint', () => {
+ let harness: ApiTestHarness;
+ beforeEach(async () => {
+ harness = await createApiTestHarness();
+ });
+ afterEach(async () => {
+ vi.restoreAllMocks();
+ await harness?.shutdown();
+ });
+
+ test('relationships, guild bans and notes are removed in bounded batches', async () => {
+ const account = await createTestAccount(harness);
+ const userId = createUserID(BigInt(account.userId));
+ const relationships = new UserRelationshipRepository();
+ const moderation = new GuildModerationRepository();
+ for (let index = 0; index < RELATIONSHIPS_EACH_WAY; index++) {
+ const other = otherUserId(index);
+ for (const [source, target] of [
+ [userId, other],
+ [other, userId],
+ ] as const) {
+ await relationships.upsertRelationship({
+ source_user_id: source,
+ target_user_id: target,
+ type: RelationshipTypes.FRIEND,
+ nickname: null,
+ since: new Date(),
+ share_voice_activity: null,
+ version: 1,
+ });
+ }
+ }
+ for (let index = 0; index < GUILD_BANS; index++) {
+ await moderation.upsertBan({
+ guild_id: createGuildID(FIRST_OTHER_ID + BigInt(index)),
+ user_id: userId,
+ moderator_id: otherUserId(index),
+ banned_at: new Date(),
+ expires_at: null,
+ reason: null,
+ ip: null,
+ email: account.email,
+ });
+ }
+ for (let index = 0; index < NOTES_ABOUT_USER; index++) {
+ await relationships.upsertUserNote(otherUserId(index), userId, `note ${index}`);
+ }
+ await deleteAccount(harness, account.token, account.password);
+ await setPendingDeletionAt(harness, account.userId, new Date(Date.now() - 60_000));
+ const batchSpy = vi.spyOn(InMemoryCassandraQueryExecutor.prototype, 'executeBatch');
+ const result = await createBuilderWithoutAuth<{errors?: Array<{error: string}>}>(harness)
+ .post('/test/worker/process-pending-deletions')
+ .execute();
+ expect(result.errors ?? []).toEqual([]);
+ await waitForDeletionCompletion(harness, account.userId);
+ expect(Math.max(...batchSpy.mock.calls.map(([queries]) => queries.length))).toBeLessThanOrEqual(60);
+ expect(await relationships.listRelationships(userId)).toHaveLength(0);
+ const pointingAtUser = await fetchMany(
+ RelationshipsByTarget.selectCql({where: RelationshipsByTarget.where.eq('target_user_id')}),
+ {target_user_id: userId},
+ );
+ expect(pointingAtUser).toHaveLength(0);
+ expect(await relationships.listRelationships(otherUserId(0))).toHaveLength(0);
+ for (const index of [0, GUILD_BANS - 1]) {
+ expect(await moderation.getBan(createGuildID(FIRST_OTHER_ID + BigInt(index)), userId)).toBeNull();
+ }
+ const remainingNotes = await fetchMany<{target_user_id: bigint}>(
+ Notes.selectCql({where: Notes.where.eq('source_user_id')}),
+ {source_user_id: otherUserId(0)},
+ );
+ expect(remainingNotes.filter((note) => note.target_user_id === BigInt(userId))).toHaveLength(0);
+ }, 120_000);
+});
diff --git a/fluxer_api/src/api/user/tests/DirectMessageSpamShadow.test.ts b/fluxer_api/src/api/user/tests/DirectMessageSpamShadow.test.ts
deleted file mode 100644
index 6c9def93a..000000000
--- a/fluxer_api/src/api/user/tests/DirectMessageSpamShadow.test.ts
+++ /dev/null
@@ -1,73 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {createTestAccount} from '@app/api/auth/tests/AuthTestUtils';
-import {createDmChannel, sendChannelMessage} from '@app/api/channel/tests/ChannelTestUtils';
-import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
-import {HTTP_STATUS} from '@app/api/test/TestConstants';
-import {createBuilder} from '@app/api/test/TestRequestBuilder';
-import {listRelationships, sendFriendRequest} from '@app/api/user/tests/RelationshipTestUtils';
-import {RelationshipTypes, UserFlags} from '@fluxer/constants/src/UserConstants';
-import type {ChannelResponse} from '@fluxer/schema/src/domains/channel/ChannelSchemas';
-import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
-
-async function setUserFlags(harness: ApiTestHarness, userId: string, flags: bigint): Promise<void> {
- await createBuilder(harness, '')
- .patch(`/test/users/${userId}/flags`)
- .body({flags: flags.toString()})
- .expect(HTTP_STATUS.OK)
- .execute();
-}
-
-describe('Direct message spammer shadow behavior', () => {
- let harness: ApiTestHarness;
- beforeAll(async () => {
- harness = await createApiTestHarness();
- });
- beforeEach(async () => {
- await harness.reset();
- });
- afterAll(async () => {
- await harness?.shutdown();
- });
-
- it('opens and sends one-to-one DMs only for the flagged sender', async () => {
- const sender = await createTestAccount(harness);
- const target = await createTestAccount(harness);
- await setUserFlags(harness, sender.userId, UserFlags.SPAMMER | UserFlags.HAS_SESSION_STARTED);
- const dm = await createDmChannel(harness, sender.token, target.userId);
- const senderChannels = await createBuilder<Array<ChannelResponse>>(harness, sender.token)
- .get('/users/@me/channels')
- .execute();
- expect(senderChannels.some((channel) => channel.id === dm.id)).toBe(true);
- let targetChannels = await createBuilder<Array<ChannelResponse>>(harness, target.token)
- .get('/users/@me/channels')
- .execute();
- expect(targetChannels.some((channel) => channel.id === dm.id)).toBe(false);
- await sendChannelMessage(harness, sender.token, dm.id, 'local only');
- targetChannels = await createBuilder<Array<ChannelResponse>>(harness, target.token)
- .get('/users/@me/channels')
- .execute();
- expect(targetChannels.some((channel) => channel.id === dm.id)).toBe(false);
- await createBuilder(harness, target.token)
- .get(`/channels/${dm.id}/messages`)
- .expect(HTTP_STATUS.NOT_FOUND, 'UNKNOWN_CHANNEL')
- .execute();
- });
-
- it('creates only a local outgoing friend request for flagged senders', async () => {
- const sender = await createTestAccount(harness);
- const target = await createTestAccount(harness);
- await setUserFlags(harness, sender.userId, UserFlags.SPAMMER | UserFlags.HAS_SESSION_STARTED);
- const {json: relationship} = await sendFriendRequest(harness, sender.token, target.userId);
- expect(relationship).toMatchObject({
- id: target.userId,
- type: RelationshipTypes.OUTGOING_REQUEST,
- });
- const {json: senderRelationships} = await listRelationships(harness, sender.token);
- expect(senderRelationships).toContainEqual(
- expect.objectContaining({id: target.userId, type: RelationshipTypes.OUTGOING_REQUEST}),
- );
- const {json: targetRelationships} = await listRelationships(harness, target.token);
- expect(targetRelationships.some((rel) => rel.id === sender.userId)).toBe(false);
- });
-});
diff --git a/fluxer_api/src/api/user/tests/InactivityDeletion.test.ts b/fluxer_api/src/api/user/tests/InactivityDeletion.test.ts
index ebe38f153..84bb669fe 100644
--- a/fluxer_api/src/api/user/tests/InactivityDeletion.test.ts
+++ b/fluxer_api/src/api/user/tests/InactivityDeletion.test.ts
@@ -1,10 +1,11 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import {createTestAccount} from '@app/api/auth/tests/AuthTestUtils';
+import {createTestAccount, loginAccount} from '@app/api/auth/tests/AuthTestUtils';
import {createUserID} from '@app/api/BrandedTypes';
import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
import type {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
-import {createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
+import {HTTP_STATUS} from '@app/api/test/TestConstants';
+import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
import {UserRepository} from '@app/api/user/repositories/UserRepository';
import {expectDataExists} from '@app/api/user/tests/UserTestUtils';
import {DeletionReasons} from '@fluxer/constants/src/Core';
@@ -107,6 +108,25 @@ describe('Inactivity Deletion', () => {
const user = await new UserRepository().findUniqueAssert(createUserID(BigInt(account.userId)));
expect(user.deletionReasonCode).toBe(DeletionReasons.INACTIVITY);
});
+ test('scheduling an inactivity deletion signs the account out and signing in again cancels it', async () => {
+ const account = await createTestAccount(harness);
+ const threeYearsAgo = new Date(Date.now() - 3 * 365 * 24 * 60 * 60 * 1000);
+ await setUserActivity(harness, account.userId, threeYearsAgo);
+ await harness.kvProvider.setex(
+ `inactivity_warning_sent:${account.userId}`,
+ 35 * 24 * 60 * 60,
+ String(Date.now() - 31 * 24 * 60 * 60 * 1000),
+ );
+ const result = await processInactivityDeletions(harness);
+ expect(result.deletions_scheduled).toBe(1);
+ await createBuilder(harness, account.token).get('/users/@me').expect(HTTP_STATUS.UNAUTHORIZED).execute();
+ const login = await loginAccount(harness, account);
+ await createBuilder(harness, login.token).get('/users/@me').expect(HTTP_STATUS.OK).execute();
+ const dataStatus = await expectDataExists(harness, account.userId);
+ expect(dataStatus.hasSelfDeletedFlag).toBe(false);
+ expect(dataStatus.pendingDeletionAt).toBeNull();
+ expect(await harness.kvProvider.zcard('deletion_queue')).toBe(0);
+ });
test('warning email should be idempotent', async () => {
const account = await createTestAccount(harness);
const threeYearsAgo = new Date(Date.now() - 3 * 365 * 24 * 60 * 60 * 1000);
diff --git a/fluxer_api/src/api/user/tests/PhoneGateEscape.test.ts b/fluxer_api/src/api/user/tests/PhoneGateEscape.test.ts
new file mode 100644
index 000000000..54e46df1a
--- /dev/null
+++ b/fluxer_api/src/api/user/tests/PhoneGateEscape.test.ts
@@ -0,0 +1,147 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createAuthHarness, createTestAccount, type TestAccount} from '@app/api/auth/tests/AuthTestUtils';
+import {createUserID} from '@app/api/BrandedTypes';
+import {GuildRepository} from '@app/api/guild/repositories/GuildRepository';
+import {acceptInvite, createChannelInvite, createGuild} from '@app/api/message/tests/MessageTestUtils';
+import type {ApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {NoopGatewayService} from '@app/api/test/NoopGatewayService';
+import {createBuilder, createBuilderWithoutAuth} from '@app/api/test/TestRequestBuilder';
+import {UserRepository} from '@app/api/user/repositories/UserRepository';
+import {
+ DEFERRED_PHONE_ON_COMMUNITY_JOIN,
+ PHONE_GATE_PROMOTED_FROM_DEFERRAL,
+ SuspiciousActivityFlags,
+} from '@fluxer/constants/src/UserConstants';
+import {afterAll, beforeAll, beforeEach, describe, expect, it, vi} from 'vitest';
+
+const ESCAPE_PATH = '/users/@me/required-actions/phone-gate-escape';
+const PROMOTED = SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | PHONE_GATE_PROMOTED_FROM_DEFERRAL;
+
+interface EscapePreviewResponse {
+ available: boolean;
+ guilds: Array<{id: string; name: string}>;
+ owned_guilds: Array<{id: string; name: string}>;
+}
+
+interface PrivateUser {
+ required_actions: Array<string> | null;
+}
+
+describe('Phone gate escape', () => {
+ let harness: ApiTestHarness;
+ beforeAll(async () => {
+ harness = await createAuthHarness();
+ });
+ beforeEach(async () => {
+ await harness.reset();
+ });
+ afterAll(async () => {
+ await harness?.shutdown();
+ });
+
+ async function setFlags(account: TestAccount, flags: number): Promise<void> {
+ await createBuilderWithoutAuth(harness)
+ .post(`/test/users/${account.userId}/security-flags`)
+ .body({suspicious_activity_flags: flags})
+ .execute();
+ }
+
+ async function readFlags(account: TestAccount): Promise<number> {
+ const user = await new UserRepository().findUnique(createUserID(BigInt(account.userId)));
+ return user?.suspiciousActivityFlags ?? 0;
+ }
+
+ async function guildIds(account: TestAccount): Promise<Array<string>> {
+ const guilds = await new GuildRepository().listUserGuilds(createUserID(BigInt(account.userId)));
+ return guilds.map((guild) => guild.id.toString()).sort();
+ }
+
+ async function joinedAccount(): Promise<{account: TestAccount; guildIds: Array<string>}> {
+ const owner = await createTestAccount(harness);
+ const account = await createTestAccount(harness);
+ const joined = await createGuild(harness, owner.token, 'Joined');
+ const invite = await createChannelInvite(harness, owner.token, joined.system_channel_id!);
+ await acceptInvite(harness, account.token, invite.code);
+ const owned = await createGuild(harness, account.token, 'Owned');
+ return {account, guildIds: [joined.id, owned.id].sort()};
+ }
+
+ function preview(account: TestAccount) {
+ return createBuilder<EscapePreviewResponse>(harness, account.token).get(ESCAPE_PATH).expect(200).execute();
+ }
+
+ function execute(account: TestAccount) {
+ return createBuilder<PrivateUser>(harness, account.token).post(ESCAPE_PATH).body({}).expect(200).execute();
+ }
+
+ function refused(account: TestAccount) {
+ return createBuilder(harness, account.token)
+ .post(ESCAPE_PATH)
+ .body({})
+ .expect(400, 'PHONE_GATE_ESCAPE_UNAVAILABLE')
+ .execute();
+ }
+
+ it('lifts a promoted requirement without leaving any guild', async () => {
+ const {account, guildIds: before} = await joinedAccount();
+ await setFlags(account, PROMOTED);
+ await createBuilder(harness, account.token)
+ .get('/users/@me/guilds')
+ .expect(403, 'ACCOUNT_SUSPICIOUS_ACTIVITY')
+ .execute();
+
+ expect(await preview(account)).toEqual({available: true, guilds: [], owned_guilds: []});
+
+ const dispatch = vi.spyOn(NoopGatewayService.prototype, 'dispatchPresence');
+ try {
+ const updated = await execute(account);
+ expect(updated.required_actions ?? []).toEqual([]);
+ const userUpdates = dispatch.mock.calls.filter(
+ ([params]) => params.event === 'USER_UPDATE' && params.userId.toString() === account.userId,
+ );
+ expect(userUpdates).toHaveLength(1);
+ } finally {
+ dispatch.mockRestore();
+ }
+
+ expect(await guildIds(account)).toEqual(before);
+ const flags = await readFlags(account);
+ expect(flags & DEFERRED_PHONE_ON_COMMUNITY_JOIN).not.toBe(0);
+ expect(flags & PHONE_GATE_PROMOTED_FROM_DEFERRAL).toBe(0);
+ expect(flags & SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE).not.toBe(0);
+ await createBuilder(harness, account.token).get('/users/@me/guilds').expect(200).execute();
+ });
+
+ it('closes itself after a successful escape', async () => {
+ const account = await createTestAccount(harness);
+ await setFlags(account, PROMOTED);
+ await execute(account);
+ expect(await preview(account)).toEqual({available: false, guilds: [], owned_guilds: []});
+ await refused(account);
+ });
+
+ it('leaves a remaining email requirement in place', async () => {
+ const account = await createTestAccount(harness);
+ await setFlags(account, PROMOTED | SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL);
+ const updated = await execute(account);
+ expect(updated.required_actions).toEqual(['REQUIRE_REVERIFIED_EMAIL']);
+ });
+
+ it('refuses a requirement that was never deferred', async () => {
+ const account = await createTestAccount(harness);
+ await setFlags(account, SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE);
+ expect((await preview(account)).available).toBe(false);
+ await refused(account);
+ expect(await readFlags(account)).toBe(SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE);
+ });
+
+ it('refuses a promoted account that also owes inbound verification', async () => {
+ const account = await createTestAccount(harness);
+ const flags = PROMOTED | SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION;
+ await setFlags(account, flags);
+ expect((await preview(account)).available).toBe(false);
+ await refused(account);
+ expect(await readFlags(account)).toBe(flags);
+ });
+});
diff --git a/fluxer_api/src/api/user/tests/SuspiciousFlagsCompareAndSet.test.ts b/fluxer_api/src/api/user/tests/SuspiciousFlagsCompareAndSet.test.ts
new file mode 100644
index 000000000..482444b61
--- /dev/null
+++ b/fluxer_api/src/api/user/tests/SuspiciousFlagsCompareAndSet.test.ts
@@ -0,0 +1,41 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createUniqueEmail, createUniqueUsername, registerUser} from '@app/api/auth/tests/AuthTestUtils';
+import {createUserID} from '@app/api/BrandedTypes';
+import {getUserRepository} from '@app/api/middleware/ServiceSingletons';
+import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHarness';
+import {TEST_CREDENTIALS} from '@app/api/test/TestConstants';
+import {afterAll, beforeAll, beforeEach, describe, expect, test} from 'vitest';
+
+describe('suspicious flags compare and set', () => {
+ let harness: ApiTestHarness;
+ beforeAll(async () => {
+ harness = await createApiTestHarness();
+ });
+ beforeEach(async () => {
+ await harness.reset();
+ });
+ afterAll(async () => {
+ await harness?.shutdown();
+ });
+
+ test('applies to a new account whose flags were never written, and refuses a stale read', async () => {
+ const {user_id} = await registerUser(harness, {
+ email: createUniqueEmail('cas'),
+ username: createUniqueUsername('cas'),
+ global_name: 'Cas',
+ password: TEST_CREDENTIALS.STRONG_PASSWORD,
+ date_of_birth: '2000-01-01',
+ consent: true,
+ });
+ const users = getUserRepository();
+ const id = createUserID(BigInt(user_id));
+ const fresh = (await users.findUnique(id))!;
+ expect(fresh.suspiciousActivityFlags).toBe(0);
+ const updated = await users.compareAndSetSuspiciousFlags(fresh, 1);
+ expect(updated?.suspiciousActivityFlags).toBe(1);
+ expect((await users.findUnique(id))!.suspiciousActivityFlags).toBe(1);
+ expect(await users.compareAndSetSuspiciousFlags(fresh, 2)).toBeNull();
+ expect((await users.findUnique(id))!.suspiciousActivityFlags).toBe(1);
+ });
+});
diff --git a/fluxer_api/src/api/user/tests/UserRelationshipStateTransitions.test.ts b/fluxer_api/src/api/user/tests/UserRelationshipStateTransitions.test.ts
index 378a312d2..21a3e80e5 100644
--- a/fluxer_api/src/api/user/tests/UserRelationshipStateTransitions.test.ts
+++ b/fluxer_api/src/api/user/tests/UserRelationshipStateTransitions.test.ts
@@ -228,7 +228,7 @@ describe('UserRelationshipStateTransitions', () => {
await markUserDeleted(harness, alice.userId);
await createBuilder(harness, alice.token)
.post(`/users/@me/relationships/${bob.userId}`)
- .expect(HTTP_STATUS.BAD_REQUEST, 'FRIEND_REQUEST_BLOCKED')
+ .expect(HTTP_STATUS.UNAUTHORIZED)
.execute();
});
test('can accept a friend request from a user scheduled for deletion', async () => {
@@ -337,7 +337,7 @@ describe('UserRelationshipStateTransitions', () => {
await createBuilder(harness, bob.token)
.put(`/users/@me/relationships/${alice.userId}`)
.body({})
- .expect(HTTP_STATUS.BAD_REQUEST, 'FRIEND_REQUEST_BLOCKED')
+ .expect(HTTP_STATUS.UNAUTHORIZED)
.execute();
});
});
diff --git a/fluxer_api/src/api/utils/ExternalResponseLimits.ts b/fluxer_api/src/api/utils/ExternalResponseLimits.ts
index 2f618ca4b..5a6d8df2a 100644
--- a/fluxer_api/src/api/utils/ExternalResponseLimits.ts
+++ b/fluxer_api/src/api/utils/ExternalResponseLimits.ts
@@ -19,10 +19,8 @@ export const EXTERNAL_RESPONSE_LIMITS = {
wikipediaSummaryBytes: 256 * 1024,
oEmbedBytes: 256 * 1024,
pwnedPasswordsBytes: 1024 * 1024,
- rdapBytes: 512 * 1024,
externalTemplateBytes: 512 * 1024,
ncmecResponseBytes: 64 * 1024,
fileBlocklistBytes: 25 * 1024 * 1024,
urlBlocklistBytes: 25 * 1024 * 1024,
- disposableEmailBytes: 10 * 1024 * 1024,
} as const;
diff --git a/fluxer_api/src/api/utils/InviteUtils.ts b/fluxer_api/src/api/utils/InviteUtils.ts
index 26960b45f..836f951e9 100644
--- a/fluxer_api/src/api/utils/InviteUtils.ts
+++ b/fluxer_api/src/api/utils/InviteUtils.ts
@@ -42,3 +42,16 @@ export function findInvite(content: string | null): string | null {
}
return null;
}
+
+export function findInvites(content: string | null, limit: number): Array<string> {
+ if (!content) return [];
+ const pattern = getInvitePattern();
+ pattern.lastIndex = 0;
+ const codes = new Set<string>();
+ for (const match of content.matchAll(pattern)) {
+ const code = match[1] || match[2];
+ if (code) codes.add(code);
+ if (codes.size >= limit) break;
+ }
+ return [...codes];
+}
diff --git a/fluxer_api/src/api/utils/RandomUtils.ts b/fluxer_api/src/api/utils/RandomUtils.ts
index 5379b44cb..e84d21404 100644
--- a/fluxer_api/src/api/utils/RandomUtils.ts
+++ b/fluxer_api/src/api/utils/RandomUtils.ts
@@ -4,7 +4,6 @@ import assert from 'node:assert/strict';
import crypto from 'node:crypto';
const RANDOM_STRING_ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
-const RANDOM_DIGIT_ALPHABET = '0123456789';
function randomFromAlphabet(length: number, alphabet: string): string {
assert(Number.isSafeInteger(length) && length >= 0, 'Random string length must be a nonnegative safe integer');
@@ -26,10 +25,6 @@ function randomFromAlphabet(length: number, alphabet: string): string {
return result;
}
-export function randomNumericCode(length: number): string {
- return randomFromAlphabet(length, RANDOM_DIGIT_ALPHABET);
-}
-
export function randomString(length: number): string {
return randomFromAlphabet(length, RANDOM_STRING_ALPHABET);
}
diff --git a/fluxer_api/src/api/webhook/SmsWebhookForwarder.ts b/fluxer_api/src/api/webhook/SmsWebhookForwarder.ts
new file mode 100644
index 000000000..360c1e7dd
--- /dev/null
+++ b/fluxer_api/src/api/webhook/SmsWebhookForwarder.ts
@@ -0,0 +1,57 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {
+ HEADER,
+ type InboundSms,
+ PHONE_INBOUND_SUBJECT,
+ PHONE_RPC_VERSION,
+} from '@app/api/infrastructure/activity/Contract.generated';
+import {Logger} from '@app/api/Logger';
+import {RateLimitMiddleware} from '@app/api/middleware/RateLimitMiddleware';
+import {RateLimitConfigs} from '@app/api/RateLimitConfig';
+import type {HonoApp} from '@app/api/types/HonoEnv';
+import type {JetStreamClient} from '@nats-io/jetstream';
+
+const PUBLISH_TIMEOUT_MS = 2000;
+const EMPTY_TWIML = '<?xml version="1.0" encoding="UTF-8"?><Response/>';
+export const SMS_WEBHOOK_MAX_BODY_BYTES = 8192;
+export const SMS_INBOUND_TTL = String(24 * 60 * 60);
+const TWILIO_SIGNATURE = /^[A-Za-z0-9+/]{27}=$/;
+const MESSAGE_SID = /^(SM|MM)[0-9a-f]{32}$/;
+
+export function installSmsWebhookForwarder(
+ routes: HonoApp,
+ jetStream: () => Pick<JetStreamClient, 'publish'> | null,
+): void {
+ routes.post('/webhooks/twilio/sms', RateLimitMiddleware(RateLimitConfigs.WEBHOOK_TWILIO_SMS), async (ctx) => {
+ const declared = Number(ctx.req.header('content-length') ?? '0');
+ if (declared > SMS_WEBHOOK_MAX_BODY_BYTES) return ctx.text('too large', 413);
+ const rawBody = await ctx.req.text();
+ if (Buffer.byteLength(rawBody) > SMS_WEBHOOK_MAX_BODY_BYTES) return ctx.text('too large', 413);
+ const signature = ctx.req.header(HEADER.twilioSignature) ?? '';
+ const msgID = new URLSearchParams(rawBody).get('MessageSid') ?? '';
+ if (!TWILIO_SIGNATURE.test(signature) || !MESSAGE_SID.test(msgID)) return ctx.text('forbidden', 403);
+ const js = jetStream();
+ if (!js) {
+ Logger.warn('Inbound SMS webhook could not be forwarded, JetStream is not connected');
+ return ctx.text('unavailable', 500);
+ }
+ const message: InboundSms = {
+ v: PHONE_RPC_VERSION,
+ received_at_ms: Date.now(),
+ signature,
+ body: rawBody,
+ };
+ try {
+ await js.publish(PHONE_INBOUND_SUBJECT, JSON.stringify(message), {
+ msgID,
+ ttl: SMS_INBOUND_TTL,
+ timeout: PUBLISH_TIMEOUT_MS,
+ });
+ } catch (error) {
+ Logger.warn({err: error}, 'Inbound SMS webhook publish failed');
+ return ctx.text('unavailable', 500);
+ }
+ return ctx.text(EMPTY_TWIML, 200, {'Content-Type': 'text/xml'});
+ });
+}
diff --git a/fluxer_api/src/api/webhook/SweegoWebhookService.ts b/fluxer_api/src/api/webhook/SweegoWebhookService.ts
index 93ca64a99..ce81dcc32 100644
--- a/fluxer_api/src/api/webhook/SweegoWebhookService.ts
+++ b/fluxer_api/src/api/webhook/SweegoWebhookService.ts
@@ -4,11 +4,12 @@ import crypto from 'node:crypto';
import type {UserID} from '@app/api/BrandedTypes';
import type {GatewayDispatchEvent} from '@app/api/constants/Gateway';
import type {UserRow} from '@app/api/database/types/UserTypes';
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
import {Logger} from '@app/api/Logger';
import type {User} from '@app/api/models/User';
import {mapUserToPrivateResponse} from '@app/api/user/UserMappers';
+import {extractEmailDomain} from '@app/api/utils/EmailDomainUtils';
import {isJsonRecord, parseJsonWithGuard} from '@app/api/utils/JsonBoundaryUtils';
-import {SuspiciousActivityFlags} from '@fluxer/constants/src/UserConstants';
interface ISweegoUserRepository {
findByEmail(email: string): Promise<User | null>;
@@ -152,25 +153,25 @@ export class SweegoWebhookService {
Logger.warn({recipient: event.recipient}, 'User not found for bounced email');
return;
}
+ await emitActivity('email_bounced', user.id.toString(), {
+ user_id: user.id.toString(),
+ kind: event.event_type === 'complaint' ? 'complaint' : 'hard',
+ provider_event_id: event.event_id ?? `${event.event_type}:${event.recipient}`,
+ email_domain: extractEmailDomain(event.recipient) ?? '',
+ });
if (user.emailBounced) {
Logger.debug({userId: user.id, recipient: event.recipient}, 'Email already marked as bounced');
return;
}
- const currentFlags = user.suspiciousActivityFlags || 0;
- const newFlags = currentFlags | SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL;
const updatedUser = await this.userRepository.patchUpsert(
user.id,
{
email_bounced: true,
email_verified: false,
- suspicious_activity_flags: newFlags,
},
user.toRow(),
);
- Logger.info(
- {userId: user.id, recipient: event.recipient, details: event.details},
- 'User email marked as bounced and requires reverification',
- );
+ Logger.info({userId: user.id, recipient: event.recipient, details: event.details}, 'User email marked as bounced');
if (updatedUser) {
await this.gatewayService.dispatchPresence({
userId: updatedUser.id,
diff --git a/fluxer_api/src/api/webhook/tests/SmsWebhookForwarder.test.ts b/fluxer_api/src/api/webhook/tests/SmsWebhookForwarder.test.ts
new file mode 100644
index 000000000..7b504e6b6
--- /dev/null
+++ b/fluxer_api/src/api/webhook/tests/SmsWebhookForwarder.test.ts
@@ -0,0 +1,51 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {PHONE_INBOUND_SUBJECT} from '@app/api/infrastructure/activity/Contract.generated';
+import type {HonoApp} from '@app/api/types/HonoEnv';
+import {
+ installSmsWebhookForwarder,
+ SMS_INBOUND_TTL,
+ SMS_WEBHOOK_MAX_BODY_BYTES,
+} from '@app/api/webhook/SmsWebhookForwarder';
+import {Hono} from 'hono';
+import {describe, expect, it} from 'vitest';
+
+const SIGNATURE = `${'a'.repeat(27)}=`;
+const SID = `SM${'0'.repeat(32)}`;
+
+function rig() {
+ const published: Array<{subject: string; options: Record<string, unknown>}> = [];
+ const app = new Hono();
+ installSmsWebhookForwarder(app as unknown as HonoApp, () => ({
+ publish: async (subject: string, _data: unknown, options?: Record<string, unknown>) => {
+ published.push({subject, options: options ?? {}});
+ return {} as never;
+ },
+ }));
+ const post = (body: string, signature = SIGNATURE) =>
+ app.request('/webhooks/twilio/sms', {
+ method: 'POST',
+ headers: {'content-type': 'application/x-www-form-urlencoded', 'x-twilio-signature': signature},
+ body,
+ });
+ return {published, post};
+}
+
+describe('sms webhook forwarder', () => {
+ it('forwards a well-formed webhook with its MessageSid and a short ttl', async () => {
+ const {published, post} = rig();
+ const res = await post(`MessageSid=${SID}&From=%2B15555550123&Body=123456`);
+ expect(res.status).toBe(200);
+ expect(published).toEqual([
+ {subject: PHONE_INBOUND_SUBJECT, options: expect.objectContaining({msgID: SID, ttl: SMS_INBOUND_TTL})},
+ ]);
+ });
+
+ it('refuses unsigned, malformed and oversized posts before touching the stream', async () => {
+ const {published, post} = rig();
+ expect((await post(`MessageSid=${SID}&Body=1`, '')).status).toBe(403);
+ expect((await post('MessageSid=random&Body=1')).status).toBe(403);
+ expect((await post(`MessageSid=${SID}&Body=${'x'.repeat(SMS_WEBHOOK_MAX_BODY_BYTES)}`)).status).toBe(413);
+ expect(published).toEqual([]);
+ });
+});
diff --git a/fluxer_api/src/api/worker/AccountActionConsumer.ts b/fluxer_api/src/api/worker/AccountActionConsumer.ts
new file mode 100644
index 000000000..9ce63011e
--- /dev/null
+++ b/fluxer_api/src/api/worker/AccountActionConsumer.ts
@@ -0,0 +1,158 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {emitActivity} from '@app/api/infrastructure/activity/ActivityEvents';
+import {workerMeta} from '@app/api/infrastructure/activity/ActivityMeta';
+import {
+ ACTION_PARTITIONS,
+ ACTIONS_STREAM,
+ type ActionEnvelope,
+ type ActionOutcome,
+ CONTRACT_VERSION,
+ effectsConsumer,
+ MAX_ACTION_ATTEMPTS,
+} from '@app/api/infrastructure/activity/Contract.generated';
+import {Logger} from '@app/api/Logger';
+import {
+ type AccountStateDeps,
+ applyPhoneVerified,
+ applySpammer,
+ applySuspiciousFlags,
+ applyTempBanIp,
+ outcomeOf,
+} from '@app/api/user/services/AccountStateApplier';
+import {AckPolicy, type ConsumerMessages, type JetStreamClient, type JsMsg} from '@nats-io/jetstream';
+
+export interface AccountActionDeps {
+ js: Pick<JetStreamClient, 'consumers'>;
+ state: AccountStateDeps;
+ publishOutcome?: (key: string, outcome: ActionOutcome) => Promise<void>;
+ now?: () => number;
+ retryDelayMs?: number;
+}
+
+const RETRY_DELAY_MS = 5000;
+const MAX_NAK_DELAY_MS = 30_000;
+
+interface ConsumerState {
+ stopped: boolean;
+ loops: Array<ConsumerMessages>;
+ tasks: Array<Promise<void>>;
+}
+
+let running: ConsumerState | null = null;
+
+export function decodeActionEnvelope(data: Uint8Array | string): ActionEnvelope | null {
+ try {
+ const value = JSON.parse(typeof data === 'string' ? data : new TextDecoder().decode(data)) as unknown;
+ if (
+ typeof value === 'object' &&
+ value !== null &&
+ typeof (value as ActionEnvelope).id === 'string' &&
+ typeof (value as ActionEnvelope).key === 'string' &&
+ typeof (value as ActionEnvelope).type === 'string' &&
+ typeof (value as ActionEnvelope).v === 'number' &&
+ typeof (value as ActionEnvelope).expires_at_ms === 'number'
+ ) {
+ return value as ActionEnvelope;
+ }
+ } catch {
+ return null;
+ }
+ return null;
+}
+
+export function applyAction(deps: AccountActionDeps, env: ActionEnvelope): Promise<ActionOutcome> {
+ if (env.v !== CONTRACT_VERSION) return Promise.resolve(outcomeOf(env, 'unsupported'));
+ if (env.expires_at_ms <= (deps.now?.() ?? Date.now())) return Promise.resolve(outcomeOf(env, 'expired'));
+ switch (env.type) {
+ case 'set_suspicious_flags':
+ return applySuspiciousFlags(deps.state, env);
+ case 'set_spammer':
+ return applySpammer(deps.state, env);
+ case 'phone_verified':
+ return applyPhoneVerified(deps.state, env);
+ case 'temp_ban_ip':
+ return applyTempBanIp(deps.state, env);
+ default:
+ return Promise.resolve(outcomeOf(env as ActionEnvelope, 'unsupported'));
+ }
+}
+
+async function publishOutcome(deps: AccountActionDeps, key: string, outcome: ActionOutcome): Promise<void> {
+ if (deps.publishOutcome) {
+ await deps.publishOutcome(key, outcome);
+ return;
+ }
+ await emitActivity('action_outcome', key, outcome, workerMeta(), outcome.action_id);
+}
+
+export async function handleActionMessage(deps: AccountActionDeps, msg: JsMsg): Promise<void> {
+ const env = decodeActionEnvelope(msg.data);
+ if (!env) {
+ msg.term('undecodable action envelope');
+ return;
+ }
+ let outcome: ActionOutcome;
+ try {
+ outcome = await applyAction(deps, env);
+ } catch (error) {
+ if (msg.info.deliveryCount < MAX_ACTION_ATTEMPTS) {
+ Logger.warn({err: error, actionId: env.id, attempt: msg.info.deliveryCount}, 'Account action apply failed');
+ msg.nak(Math.min(MAX_NAK_DELAY_MS, 1000 * msg.info.deliveryCount));
+ return;
+ }
+ Logger.error({err: error, actionId: env.id}, 'Account action failed after all attempts');
+ outcome = outcomeOf(env, 'failed', null, String(error).slice(0, 500));
+ }
+ await publishOutcome(deps, env.key, outcome);
+ await msg.ackAck();
+}
+
+async function runActionPartition(deps: AccountActionDeps, partition: number, state: ConsumerState): Promise<void> {
+ const retryDelayMs = deps.retryDelayMs ?? RETRY_DELAY_MS;
+ while (!state.stopped) {
+ try {
+ const consumer = await deps.js.consumers.get(ACTIONS_STREAM, effectsConsumer(partition));
+ const info = await consumer.info(true);
+ if (info.config.ack_policy !== AckPolicy.Explicit) {
+ throw new Error(`Consumer ${effectsConsumer(partition)} must use explicit acks`);
+ }
+ const messages = await consumer.consume({max_messages: 1});
+ state.loops.push(messages);
+ if (state.stopped) {
+ await messages.close();
+ return;
+ }
+ for await (const msg of messages) {
+ try {
+ await handleActionMessage(deps, msg);
+ } catch (error) {
+ Logger.warn({err: error, partition}, 'Account action outcome could not be recorded');
+ msg.nak(retryDelayMs);
+ }
+ }
+ } catch (error) {
+ if (state.stopped) return;
+ Logger.debug({err: error, partition}, 'Account action consumer unavailable, retrying');
+ }
+ if (!state.stopped) await new Promise((resolve) => setTimeout(resolve, retryDelayMs).unref?.());
+ }
+}
+
+export function startAccountActionConsumer(deps: AccountActionDeps): void {
+ if (running) return;
+ const state: ConsumerState = {stopped: false, loops: [], tasks: []};
+ running = state;
+ for (let p = 0; p < ACTION_PARTITIONS; p++) {
+ state.tasks.push(runActionPartition(deps, p, state));
+ }
+}
+
+export async function stopAccountActionConsumer(): Promise<void> {
+ const state = running;
+ if (!state) return;
+ running = null;
+ state.stopped = true;
+ await Promise.allSettled(state.loops.map((messages) => messages.close()));
+ await Promise.allSettled(state.tasks);
+}
diff --git a/fluxer_api/src/api/worker/BlocklistFeedStartup.ts b/fluxer_api/src/api/worker/BlocklistFeedStartup.ts
index 150d271a9..0b74a52e4 100644
--- a/fluxer_api/src/api/worker/BlocklistFeedStartup.ts
+++ b/fluxer_api/src/api/worker/BlocklistFeedStartup.ts
@@ -10,11 +10,7 @@ import {ms} from 'itty-time';
const INITIAL_SYNC_KEY = 'sync:email_domains:initialized';
const PURGE_KEY = 'sync:blocklist_feeds:purged';
const CLAIM_TTL_SECONDS = ms('6 hours') / 1000;
-const FEED_TASKS = [
- 'syncDisposableEmailDomains',
- 'syncUrlBlocklists',
- 'syncFileShaBlocklists',
-] as const satisfies ReadonlyArray<WorkerTaskName>;
+const FEED_TASKS = ['syncUrlBlocklists', 'syncFileShaBlocklists'] as const satisfies ReadonlyArray<WorkerTaskName>;
export async function queueBlocklistFeedStartupJobs(
kvClient: Pick<IKVProvider, 'setnx' | 'del'>,
@@ -22,10 +18,7 @@ export async function queueBlocklistFeedStartupJobs(
enabled: boolean,
): Promise<void> {
if (enabled) {
- if (await kvClient.setnx(INITIAL_SYNC_KEY, '1', CLAIM_TTL_SECONDS)) {
- Logger.info('Triggering initial disposable email domain sync');
- await queueJobs(workerService, ['syncDisposableEmailDomains']);
- }
+ await kvClient.setnx(INITIAL_SYNC_KEY, '1', CLAIM_TTL_SECONDS);
return;
}
const wasEnabled = (await kvClient.del(INITIAL_SYNC_KEY)) > 0;
diff --git a/fluxer_api/src/api/worker/WorkerLaneConfig.ts b/fluxer_api/src/api/worker/WorkerLaneConfig.ts
index 27a21e9f4..81af7be99 100644
--- a/fluxer_api/src/api/worker/WorkerLaneConfig.ts
+++ b/fluxer_api/src/api/worker/WorkerLaneConfig.ts
@@ -56,6 +56,7 @@ const LANE_CONFIG = {
'bulkAddGuildMembers',
'bulkBanFileShas',
'bulkDeleteMessagesForUsers',
+ 'drainActivitySpool',
] as const,
retiredTasks: ['sendScheduledMessage'],
concurrency: 8,
@@ -79,7 +80,6 @@ const LANE_CONFIG = {
'prunePostgresKvTtl',
'refreshSearchIndex',
'syncDiscoveryIndex',
- 'syncDisposableEmailDomains',
'syncUrlBlocklists',
'syncFileShaBlocklists',
'flushUserActivityBuffer',
diff --git a/fluxer_api/src/api/worker/WorkerMain.ts b/fluxer_api/src/api/worker/WorkerMain.ts
index c3ab77272..615b2b35e 100644
--- a/fluxer_api/src/api/worker/WorkerMain.ts
+++ b/fluxer_api/src/api/worker/WorkerMain.ts
@@ -1,8 +1,16 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
import {Config} from '@app/api/Config';
+import {createApiContext} from '@app/api/CreateApiContext';
import {setDatabaseQueryExecutor} from '@app/api/database/CassandraQueryExecution';
import {ensurePostgresKvSchema, PostgresKvQueryExecutor} from '@app/api/database/PostgresKvQueryExecutor';
+import {
+ jetStreamActivityPublisher,
+ shutdownActivityEvents,
+ startActivityEvents,
+} from '@app/api/infrastructure/activity/ActivityEvents';
+import {setActivityProcessChannel} from '@app/api/infrastructure/activity/ActivityMeta';
+import {startSharedListWatch, stopSharedListWatch} from '@app/api/infrastructure/activity/SharedLists';
import type {ISnowflakeService} from '@app/api/infrastructure/ISnowflakeService';
import {shutdownStorageChangeFeed} from '@app/api/infrastructure/StorageServiceFactory';
import type {InstanceConfigRepository} from '@app/api/instance/InstanceConfigRepository';
@@ -17,12 +25,15 @@ import {
shutdownVoiceResources,
} from '@app/api/middleware/ServiceRegistry';
import {
+ getAdminRepository,
getCacheService,
getInstanceConfigRepository,
getLimitConfigService,
} from '@app/api/middleware/ServiceSingletons';
import {initializeSearch, shutdownSearch} from '@app/api/SearchFactory';
+import {accountStateDepsFromContext} from '@app/api/user/services/AccountStateApplier';
import {awaitAll} from '@app/api/utils/ConcurrencyUtils';
+import {startAccountActionConsumer, stopAccountActionConsumer} from '@app/api/worker/AccountActionConsumer';
import {queueBlocklistFeedStartupJobs} from '@app/api/worker/BlocklistFeedStartup';
import {CronScheduler} from '@app/api/worker/CronScheduler';
import {JetStreamWorkerQueue, JOBS_STREAM_MAX_AGE_MS} from '@app/api/worker/JetStreamWorkerQueue';
@@ -70,11 +81,11 @@ function registerCronJobs(cron: CronScheduler, jobsStreamMaxAgeMs: number): void
cron.upsert('prunePostgresKvTtl', 'prunePostgresKvTtl', {}, '0 */5 * * * *', {ledger: false});
cron.upsert('syncDiscoveryIndex', 'syncDiscoveryIndex', {}, '0 */15 * * * *', {ledger: false});
if (Config.blocklistFeeds.enabled) {
- cron.upsert('syncDisposableEmailDomains', 'syncDisposableEmailDomains', {}, '0 0 */6 * * *', {ledger: true});
cron.upsert('syncUrlBlocklists', 'syncUrlBlocklists', {}, '0 0 */6 * * *', {ledger: true});
cron.upsert('syncFileShaBlocklists', 'syncFileShaBlocklists', {}, '0 0 */12 * * *', {ledger: true});
}
cron.upsert('flushUserActivityBuffer', 'flushUserActivityBuffer', {}, '*/10 * * * * *', {ledger: false});
+ cron.upsert('drainActivitySpool', 'drainActivitySpool', {}, '*/5 * * * * *', {ledger: false});
Logger.info(
{
blocklistFeeds: Config.blocklistFeeds.enabled,
@@ -113,6 +124,7 @@ export async function startWorkerMain(): Promise<void> {
const voiceShutdown = cleanupStep('voice resources', shutdownVoiceResources);
await cleanupStep('heartbeat', () => heartbeat.stop());
await cleanupStep('cron', () => cron?.stop());
+ await cleanupStep('account actions', stopAccountActionConsumer);
await cleanupStep('runners', async () => {
await awaitAll(
runners.map((runner) => runner.stop()),
@@ -121,6 +133,8 @@ export async function startWorkerMain(): Promise<void> {
});
await voiceShutdown;
await cleanupStep('storage change feed', shutdownStorageChangeFeed);
+ await cleanupStep('shared lists', stopSharedListWatch);
+ await cleanupStep('activity events', () => shutdownActivityEvents());
await cleanupStep('jetstream', async () => {
await jsConnectionManager?.drain();
jsConnectionManager = null;
@@ -246,6 +260,21 @@ export async function startWorkerMain(): Promise<void> {
dependencies = await initializeWorkerDependencies(snowflakeService);
setWorkerDependencies(dependencies);
await queueBlocklistFeedStartupJobs(dependencies.kvClient, workerService, Config.blocklistFeeds.enabled);
+ setActivityProcessChannel('worker');
+ await startActivityEvents({
+ publisher: jetStreamActivityPublisher(jsConnectionManager.getJetStreamClient()),
+ kv: dependencies.kvClient,
+ jsm: await jsConnectionManager.getJetStreamManager(),
+ spoolWhileMissing: !Config.instance.selfHosted,
+ });
+ startSharedListWatch(jsConnectionManager.getJetStreamClient());
+ if (activeWorkerLanes.some((lane) => lane.name === 'lifecycle')) {
+ startAccountActionConsumer({
+ js: jsConnectionManager.getJetStreamClient(),
+ state: accountStateDepsFromContext(createApiContext(), getAdminRepository()),
+ });
+ Logger.info('Account action consumer started');
+ }
cron = new CronScheduler(workerService, Logger, dependencies.kvClient, heartbeat);
registerCronJobs(cron, queue.getJobsStreamMaxAgeMs());
for (const lane of activeWorkerLanes) {
diff --git a/fluxer_api/src/api/worker/WorkerTaskRegistry.ts b/fluxer_api/src/api/worker/WorkerTaskRegistry.ts
index 50390f8be..64fb95630 100644
--- a/fluxer_api/src/api/worker/WorkerTaskRegistry.ts
+++ b/fluxer_api/src/api/worker/WorkerTaskRegistry.ts
@@ -13,6 +13,7 @@ import bulkDeleteSelfMessagesImmediate from '@app/api/worker/tasks/BulkDeleteSel
import bulkDeleteUserMessages from '@app/api/worker/tasks/BulkDeleteUserMessages';
import bulkDeleteUserMessagesScoped from '@app/api/worker/tasks/BulkDeleteUserMessagesScoped';
import deleteUserMessagesInGuildByTime from '@app/api/worker/tasks/DeleteUserMessagesInGuildByTime';
+import drainActivitySpool from '@app/api/worker/tasks/DrainActivitySpool';
import expireAttachments from '@app/api/worker/tasks/ExpireAttachments';
import expireStaleJobs from '@app/api/worker/tasks/ExpireStaleJobs';
import extractEmbeds from '@app/api/worker/tasks/ExtractEmbeds';
@@ -37,7 +38,6 @@ import reconcileUserPayments from '@app/api/worker/tasks/ReconcileUserPayments';
import refreshSearchIndex from '@app/api/worker/tasks/RefreshSearchIndex';
import {sendSystemDm} from '@app/api/worker/tasks/SendSystemDm';
import syncDiscoveryIndex from '@app/api/worker/tasks/SyncDiscoveryIndex';
-import syncDisposableEmailDomains from '@app/api/worker/tasks/SyncDisposableEmailDomains';
import syncFileShaBlocklists from '@app/api/worker/tasks/SyncFileShaBlocklists';
import syncUrlBlocklists from '@app/api/worker/tasks/SyncUrlBlocklists';
import userProcessPendingDeletion from '@app/api/worker/tasks/UserProcessPendingDeletion';
@@ -59,6 +59,7 @@ export const workerTasks: Record<WorkerTaskName, WorkerTaskHandler> = {
bulkUpdateSuspiciousActivityFlags: bulkUpdateSuspiciousActivityFlags,
bulkUpdateUserFlags: bulkUpdateUserFlags,
deleteUserMessagesInGuildByTime,
+ drainActivitySpool,
expireAttachments,
expireStaleJobs,
extractEmbeds,
@@ -84,7 +85,6 @@ export const workerTasks: Record<WorkerTaskName, WorkerTaskHandler> = {
syncFileShaBlocklists,
syncUrlBlocklists,
syncDiscoveryIndex,
- syncDisposableEmailDomains,
flushUserActivityBuffer,
userProcessPendingDeletion,
userProcessPendingDeletions,
diff --git a/fluxer_api/src/api/worker/tasks/DrainActivitySpool.ts b/fluxer_api/src/api/worker/tasks/DrainActivitySpool.ts
new file mode 100644
index 000000000..13a6e1e60
--- /dev/null
+++ b/fluxer_api/src/api/worker/tasks/DrainActivitySpool.ts
@@ -0,0 +1,37 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {randomUUID} from 'node:crypto';
+import {drainActivitySpoolNow} from '@app/api/infrastructure/activity/ActivityEvents';
+import {getWorkerDependencies} from '@app/api/worker/WorkerContext';
+import type {WorkerTaskHandler} from '@pkgs/worker/src/contracts/WorkerTask';
+
+const DRAIN_LOCK_KEY = 'activity:spool:drain';
+const DRAIN_LOCK_TTL_SECONDS = 30;
+
+const drainActivitySpool: WorkerTaskHandler = async (_payload, helpers) => {
+ const {kvClient} = getWorkerDependencies();
+ const token = randomUUID();
+ if (!(await kvClient.acquireLock(DRAIN_LOCK_KEY, token, DRAIN_LOCK_TTL_SECONDS))) return;
+ try {
+ const result = await drainActivitySpoolNow({
+ keepLock: () => kvClient.extendLock(DRAIN_LOCK_KEY, token, DRAIN_LOCK_TTL_SECONDS),
+ });
+ if (!result) return;
+ if (result.published + result.expired + result.failed > 0 || result.error) {
+ helpers.logger.info(
+ {
+ published: result.published,
+ expired: result.expired,
+ failed: result.failed,
+ remaining: result.remaining,
+ err: result.error ?? undefined,
+ },
+ 'Drained activity spool',
+ );
+ }
+ } finally {
+ await kvClient.releaseLock(DRAIN_LOCK_KEY, token);
+ }
+};
+
+export default drainActivitySpool;
diff --git a/fluxer_api/src/api/worker/tasks/ProcessInactivityDeletions.ts b/fluxer_api/src/api/worker/tasks/ProcessInactivityDeletions.ts
index 9126235c1..a8705c163 100644
--- a/fluxer_api/src/api/worker/tasks/ProcessInactivityDeletions.ts
+++ b/fluxer_api/src/api/worker/tasks/ProcessInactivityDeletions.ts
@@ -1,7 +1,10 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {revokeAllAuthSessions} from '@app/api/auth/AuthSessionRevocation';
import type {UserID} from '@app/api/BrandedTypes';
import {Config} from '@app/api/Config';
+import {SYSTEM_USER_ID} from '@app/api/constants/Core';
+import type {IGatewayService} from '@app/api/infrastructure/IGatewayService';
import type {KVAccountDeletionQueueService} from '@app/api/infrastructure/KVAccountDeletionQueueService';
import type {KVActivityTracker} from '@app/api/infrastructure/KVActivityTracker';
import {Logger} from '@app/api/Logger';
@@ -31,6 +34,7 @@ interface InactivityCheckResult {
async function scheduleDeletion(
userRepository: UserRepository,
deletionQueueService: KVAccountDeletionQueueService,
+ gatewayService: IGatewayService,
user: User,
userId: UserID,
): Promise<void> {
@@ -40,6 +44,8 @@ async function scheduleDeletion(
flags: user.flags | UserFlags.SELF_DELETED,
pending_deletion_at: pendingDeletionAt,
deletion_reason_code: DeletionReasons.INACTIVITY,
+ deletion_scheduled_by: SYSTEM_USER_ID,
+ deletion_scheduled_at: new Date(),
});
await reschedulePendingDeletion({
userId,
@@ -49,12 +55,14 @@ async function scheduleDeletion(
userRepository,
deletionQueue: deletionQueueService,
});
+ await revokeAllAuthSessions({users: userRepository, gateway: gatewayService}, userId);
Logger.debug({userId, pendingDeletionAt, reason: 'INACTIVITY'}, 'Scheduled inactive user for deletion');
}
interface ProcessUserDeps {
userRepository: UserRepository;
deletionQueueService: KVAccountDeletionQueueService;
+ gatewayService: IGatewayService;
emailService: IEmailService;
isEmailEnabled: () => Promise<boolean>;
activityTracker: KVActivityTracker;
@@ -82,6 +90,7 @@ async function processUser(
const {
userRepository,
deletionQueueService,
+ gatewayService,
emailService,
isEmailEnabled,
activityTracker,
@@ -118,7 +127,7 @@ async function processUser(
const hasGracePeriodExpired = await deletionEligibilityService.hasWarningGracePeriodExpired(userId);
if (hasGracePeriodExpired) {
Logger.debug({userId}, 'Warning grace period expired, scheduling deletion');
- await scheduleDeletion(userRepository, deletionQueueService, user, userId);
+ await scheduleDeletion(userRepository, deletionQueueService, gatewayService, user, userId);
result.deletionsScheduled++;
} else {
Logger.debug({userId}, 'Warning grace period still active, skipping (idempotency check)');
@@ -155,6 +164,7 @@ interface ProcessInactivityDeletionsDeps {
kvClient: IKVProvider;
userRepository: UserRepository;
deletionQueueService: KVAccountDeletionQueueService;
+ gatewayService: IGatewayService;
emailService: IEmailService;
isEmailEnabled: () => Promise<boolean>;
activityTracker: KVActivityTracker;
@@ -167,6 +177,7 @@ export async function processInactivityDeletionsCore(
const {
userRepository,
deletionQueueService,
+ gatewayService,
emailService,
isEmailEnabled,
activityTracker,
@@ -186,6 +197,7 @@ export async function processInactivityDeletionsCore(
const userDeps: ProcessUserDeps = {
userRepository,
deletionQueueService,
+ gatewayService,
emailService,
isEmailEnabled,
activityTracker,
@@ -233,6 +245,7 @@ const processInactivityDeletions: WorkerTaskHandler = async (_payload, helpers)
kvClient,
userRepository,
deletionQueueService,
+ gatewayService,
emailService,
instanceConfigRepository,
activityTracker,
@@ -242,6 +255,7 @@ const processInactivityDeletions: WorkerTaskHandler = async (_payload, helpers)
kvClient,
userRepository,
deletionQueueService,
+ gatewayService,
emailService,
isEmailEnabled: () => instanceConfigRepository.isEmailEnabled(),
activityTracker,
diff --git a/fluxer_api/src/api/worker/tasks/SyncDisposableEmailDomains.ts b/fluxer_api/src/api/worker/tasks/SyncDisposableEmailDomains.ts
deleted file mode 100644
index 72237c8e4..000000000
--- a/fluxer_api/src/api/worker/tasks/SyncDisposableEmailDomains.ts
+++ /dev/null
@@ -1,208 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import {domainToASCII} from 'node:url';
-import {Config} from '@app/api/Config';
-import {isAccountPolicyContactDomainReputationExempt} from '@app/api/risk/AccountPolicyService';
-import {EXTERNAL_RESPONSE_LIMITS} from '@app/api/utils/ExternalResponseLimits';
-import * as FetchUtils from '@app/api/utils/FetchUtils';
-import {getWorkerDependencies} from '@app/api/worker/WorkerContext';
-import {JobCancelledError, type WorkerTaskHandler, type WorkerTaskHelpers} from '@pkgs/worker/src/contracts/WorkerTask';
-
-const SOURCES = [
- 'https://raw.githubusercontent.com/doodad-labs/disposable-email-domains/main/data/domains.txt',
- 'https://raw.githubusercontent.com/disposable-email-domains/disposable-email-domains/main/disposable_email_blocklist.conf',
- 'https://raw.githubusercontent.com/disposable/disposable-email-domains/master/domains.txt',
- 'https://raw.githubusercontent.com/micke/valid_email2/main/config/disposable_email_domains.txt',
- 'https://raw.githubusercontent.com/amieiro/disposable-email-domains/master/denyDomains.txt',
- 'https://raw.githubusercontent.com/ivolo/disposable-email-domains/master/index.json',
- 'https://raw.githubusercontent.com/7c/fakefilter/main/txt/data.txt',
- 'https://raw.githubusercontent.com/FGRibreau/mailchecker/master/list.txt',
- 'https://raw.githubusercontent.com/wesbos/burner-email-providers/master/emails.txt',
- 'https://raw.githubusercontent.com/unkn0w/disposable-email-domain-list/main/domains.txt',
- 'https://raw.githubusercontent.com/vrittech/disposable-email/main/disposable_domains.txt',
- 'https://raw.githubusercontent.com/martenson/disposable-email-domains/master/disposable_email_blocklist.conf',
-];
-const WRITE_PROGRESS_INTERVAL = 500;
-const DOMAIN_REGEX = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)+$/;
-
-interface SourceFetchResult {
- contentType: string;
- responseText: string;
-}
-
-interface SourceCollectResult {
- accepted: number;
- raw: number;
-}
-
-async function fetchSource(url: string): Promise<SourceFetchResult> {
- const res = await fetch(url, {signal: AbortSignal.timeout(60000)});
- if (!res.ok) {
- FetchUtils.discardResponseBody(res.body, res.status);
- throw new Error(`HTTP ${res.status} fetching ${url}`);
- }
- const contentType = res.headers.get('content-type') ?? '';
- const responseText = await FetchUtils.streamToStringWithLimit(res.body, {
- maxBytes: EXTERNAL_RESPONSE_LIMITS.disposableEmailBytes,
- headers: res.headers,
- url: res.url,
- description: 'Disposable email domain feed',
- });
- return {contentType, responseText};
-}
-
-function collectDomain(raw: string, freshSet: Set<string>): boolean {
- const domain = normaliseDomain(raw);
- if (!domain) return false;
- if (isAccountPolicyContactDomainReputationExempt(domain)) return false;
- if (freshSet.has(domain)) return false;
- freshSet.add(domain);
- return true;
-}
-
-function forEachTextLine(text: string, callback: (line: string) => void): number {
- let raw = 0;
- let start = 0;
- for (let i = 0; i <= text.length; i++) {
- const isEnd = i === text.length;
- if (!isEnd && text.charCodeAt(i) !== 10) continue;
- const line = text.slice(start, i).trim();
- start = i + 1;
- if (!line || line.startsWith('#')) continue;
- raw++;
- callback(line);
- }
- return raw;
-}
-
-function collectTextDomains(text: string, freshSet: Set<string>): SourceCollectResult {
- let accepted = 0;
- const raw = forEachTextLine(text, (line) => {
- if (collectDomain(line, freshSet)) accepted++;
- });
- return {accepted, raw};
-}
-
-function collectJsonDomains(text: string, freshSet: Set<string>): SourceCollectResult {
- const json: unknown = JSON.parse(text);
- if (!Array.isArray(json)) {
- return {accepted: 0, raw: 0};
- }
- let raw = 0;
- let accepted = 0;
- for (const value of json) {
- if (typeof value !== 'string') continue;
- const trimmed = value.trim();
- if (!trimmed) continue;
- raw++;
- if (collectDomain(trimmed, freshSet)) accepted++;
- }
- return {accepted, raw};
-}
-
-async function collectSourceDomains(url: string, freshSet: Set<string>): Promise<SourceCollectResult> {
- const {contentType, responseText} = await fetchSource(url);
- if (contentType.includes('application/json') || url.endsWith('.json')) {
- return collectJsonDomains(responseText, freshSet);
- }
- return collectTextDomains(responseText, freshSet);
-}
-
-function normaliseDomain(raw: string): string | null {
- let domain = raw.trim().toLowerCase();
- if (!domain) return null;
- if (domain.startsWith('*.')) domain = domain.slice(2);
- if (domain.startsWith('.')) domain = domain.slice(1);
- if (!domain || domain.length > 253) return null;
- if (/[\s@/\\]/.test(domain)) return null;
- const ascii = domainToASCII(domain);
- if (!ascii) return null;
- if (!DOMAIN_REGEX.test(ascii)) return null;
- return ascii;
-}
-
-async function loadCurrentDisposableEmailDomains(): Promise<Set<string>> {
- const {adminRepository} = getWorkerDependencies();
- return new Set(await adminRepository.listDisposableEmailDomains());
-}
-
-async function throwIfCancelled(helpers: WorkerTaskHelpers): Promise<void> {
- if (await helpers.shouldCancel()) {
- throw new JobCancelledError();
- }
-}
-
-async function fetchFeedDomains(helpers: WorkerTaskHelpers): Promise<Set<string>> {
- const freshSet = new Set<string>();
- const perSourceCounts: Record<string, number> = {};
- const perSourceRawCounts: Record<string, number> = {};
- let successCount = 0;
- for (const url of SOURCES) {
- try {
- const result = await collectSourceDomains(url, freshSet);
- successCount++;
- perSourceCounts[url] = result.accepted;
- perSourceRawCounts[url] = result.raw;
- } catch (error) {
- helpers.logger.warn({url, error}, 'Failed to fetch disposable email source');
- perSourceCounts[url] = 0;
- perSourceRawCounts[url] = 0;
- }
- await throwIfCancelled(helpers);
- }
- if (successCount === 0) {
- throw new Error('All disposable email sources failed; skipping sync (no delta applied)');
- }
- helpers.logger.info(
- {
- count: freshSet.size,
- successfulSources: successCount,
- perSource: perSourceCounts,
- perSourceRaw: perSourceRawCounts,
- },
- 'Fetched disposable email domains from all sources',
- );
- return freshSet;
-}
-
-const syncDisposableEmailDomains: WorkerTaskHandler = async (_payload, helpers) => {
- helpers.logger.info('Starting disposable email domain sync');
- await helpers.setContextLink('/suspicious-email-domains');
- const {adminRepository} = getWorkerDependencies();
- const freshSet = Config.blocklistFeeds.enabled ? await fetchFeedDomains(helpers) : new Set<string>();
- const currentSet = await loadCurrentDisposableEmailDomains();
- let addCount = 0;
- for (const domain of freshSet) {
- if (!currentSet.has(domain)) addCount++;
- }
- let removeCount = 0;
- for (const domain of currentSet) {
- if (!freshSet.has(domain)) removeCount++;
- }
- const totalOps = addCount + removeCount;
- let added = 0;
- let removed = 0;
- await helpers.reportProgress(0, totalOps, `Applying ${addCount} adds and ${removeCount} removes`);
- for (const domain of freshSet) {
- if (currentSet.has(domain)) continue;
- await adminRepository.addDisposableEmailDomain(domain);
- added++;
- if (added % WRITE_PROGRESS_INTERVAL === 0) {
- await helpers.reportProgress(added + removed, totalOps, null);
- await throwIfCancelled(helpers);
- }
- }
- for (const domain of currentSet) {
- if (freshSet.has(domain)) continue;
- await adminRepository.removeDisposableEmailDomain(domain);
- removed++;
- if (removed % WRITE_PROGRESS_INTERVAL === 0) {
- await helpers.reportProgress(added + removed, totalOps, null);
- await throwIfCancelled(helpers);
- }
- }
- await helpers.reportProgress(totalOps, totalOps, `+${added} added, -${removed} removed`);
- helpers.logger.info({added, removed, total: freshSet.size}, 'Disposable email domain sync complete');
-};
-
-export default syncDisposableEmailDomains;
diff --git a/fluxer_api/src/api/worker/tasks/SyncUrlBlocklists.ts b/fluxer_api/src/api/worker/tasks/SyncUrlBlocklists.ts
index 1a9e9a11f..fb0b375a5 100644
--- a/fluxer_api/src/api/worker/tasks/SyncUrlBlocklists.ts
+++ b/fluxer_api/src/api/worker/tasks/SyncUrlBlocklists.ts
@@ -1,8 +1,8 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
+import {BLOCKLIST_S3_KEYS, deleteBlocklistS3Object, writeLinesToS3} from '@app/api/blocklist/BlocklistS3';
import {Config} from '@app/api/Config';
import {BANNED_URLS_REFRESH_CHANNEL} from '@app/api/constants/ContentModeration';
-import {deleteRiskS3Object, RISK_S3_KEYS, writeLinesToS3} from '@app/api/risk/RiskBlocklistS3';
import {EXTERNAL_RESPONSE_LIMITS} from '@app/api/utils/ExternalResponseLimits';
import * as FetchUtils from '@app/api/utils/FetchUtils';
import {canonicalizeUrl} from '@app/api/utils/UrlNormalizer';
@@ -71,7 +71,7 @@ const syncUrlBlocklists: WorkerTaskHandler = async (_payload, helpers) => {
const {storageService, kvClient} = getWorkerDependencies();
if (!Config.blocklistFeeds.enabled) {
try {
- await deleteRiskS3Object(storageService, RISK_S3_KEYS.feedUrls);
+ await deleteBlocklistS3Object(storageService, BLOCKLIST_S3_KEYS.feedUrls);
} catch (error) {
if (!(error instanceof Error && MISSING_FEED_FILE_ERRORS.has(error.name))) {
helpers.logger.warn({error}, 'Failed to delete the URL blocklist feed file');
@@ -105,7 +105,7 @@ const syncUrlBlocklists: WorkerTaskHandler = async (_payload, helpers) => {
helpers.logger.warn('All feeds returned zero URLs — skipping S3 write to avoid wiping blocklist');
return;
}
- const count = await writeLinesToS3(storageService, RISK_S3_KEYS.feedUrls, canonicalSet);
+ const count = await writeLinesToS3(storageService, BLOCKLIST_S3_KEYS.feedUrls, canonicalSet);
await kvClient.publish(BANNED_URLS_REFRESH_CHANNEL, 'refresh');
helpers.logger.info({urls: count}, 'URL blocklist sync complete — wrote feed file to S3');
};
diff --git a/fluxer_api/src/api/worker/tasks/admin_bulk/AdminBulkServices.ts b/fluxer_api/src/api/worker/tasks/admin_bulk/AdminBulkServices.ts
index 7d0a29c42..e5c586b49 100644
--- a/fluxer_api/src/api/worker/tasks/admin_bulk/AdminBulkServices.ts
+++ b/fluxer_api/src/api/worker/tasks/admin_bulk/AdminBulkServices.ts
@@ -5,12 +5,7 @@ import {AdminBanManagementService} from '@app/api/admin/services/AdminBanManagem
import {AdminGuildService} from '@app/api/admin/services/AdminGuildService';
import {AdminUserService} from '@app/api/admin/services/AdminUserService';
import {createApiContext} from '@app/api/CreateApiContext';
-import {
- getHistoricalOutcomeRepository,
- getIpInfoService,
- getReportServiceInstance,
- getSuspiciousIpRepository,
-} from '@app/api/middleware/ServiceMiddleware';
+import {getIpInfoService, getReportServiceInstance} from '@app/api/middleware/ServiceMiddleware';
import {
getDiscriminatorService,
getEntityAssetService,
@@ -34,7 +29,6 @@ export function createAdminBulkServices(deps: WorkerDependencies): AdminBulkServ
adminRepository: deps.adminRepository,
auditService,
ipInfoService: getIpInfoService(),
- suspiciousIpRepository: getSuspiciousIpRepository(),
});
const userService = new AdminUserService({
apiContext,
@@ -48,7 +42,6 @@ export function createAdminBulkServices(deps: WorkerDependencies): AdminBulkServ
kvDeletionQueue: deps.deletionQueueService,
bulkMessageDeletionQueue: deps.bulkMessageDeletionQueueService,
stripe: deps.stripe,
- riskHistoryRepository: getHistoricalOutcomeRepository(),
reportService: getReportServiceInstance(),
});
const guildService = new AdminGuildService({
diff --git a/fluxer_api/src/api/worker/tests/AccountActionConsumer.test.ts b/fluxer_api/src/api/worker/tests/AccountActionConsumer.test.ts
new file mode 100644
index 000000000..a37636b07
--- /dev/null
+++ b/fluxer_api/src/api/worker/tests/AccountActionConsumer.test.ts
@@ -0,0 +1,465 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+import {createUserID, type UserID} from '@app/api/BrandedTypes';
+import type {UserRow} from '@app/api/database/types/UserTypes';
+import {EMPTY_USER_ROW} from '@app/api/database/types/UserTypes';
+import {
+ ACTIONS_STREAM,
+ type ActionEnvelope,
+ type ActionOutcome,
+ effectsConsumer,
+} from '@app/api/infrastructure/activity/Contract.generated';
+import {User} from '@app/api/models/User';
+import type {AccountStateDeps} from '@app/api/user/services/AccountStateApplier';
+import {
+ type AccountActionDeps,
+ applyAction,
+ handleActionMessage,
+ startAccountActionConsumer,
+ stopAccountActionConsumer,
+} from '@app/api/worker/AccountActionConsumer';
+import {SuspiciousActivityFlags, UserFlags} from '@fluxer/constants/src/UserConstants';
+import {AckPolicy, DeliverPolicy, type JsMsg, jetstream, jetstreamManager} from '@nats-io/jetstream';
+import {connect} from '@nats-io/transport-node';
+import {afterAll, beforeAll, beforeEach, describe, expect, it} from 'vitest';
+
+const USER_ID = '1174109840998400001';
+const NOW = 1_759_000_000_000;
+const NATS_URL = process.env.FLUXER_TEST_ACTIVITY_NATS_URL;
+
+function envelope<T extends ActionEnvelope['type']>(
+ body: Omit<Extract<ActionEnvelope, {type: T}>, 'v' | 'id' | 'key' | 'issued_at_ms' | 'expires_at_ms'> &
+ Partial<ActionEnvelope>,
+): Extract<ActionEnvelope, {type: T}> {
+ return {
+ v: 1,
+ id: 'a:07:4242:0',
+ key: USER_ID,
+ issued_at_ms: NOW,
+ expires_at_ms: NOW + 60_000,
+ ...body,
+ } as Extract<ActionEnvelope, {type: T}>;
+}
+
+class FakeUsers {
+ readonly rows = new Map<string, UserRow>();
+ casFailures = 0;
+
+ put(overrides: Partial<UserRow> = {}): void {
+ const row: UserRow = {...EMPTY_USER_ROW, user_id: createUserID(BigInt(USER_ID)), flags: 0n, ...overrides};
+ this.rows.set(row.user_id.toString(), row);
+ }
+
+ current(): User {
+ return new User(this.rows.get(USER_ID)!);
+ }
+
+ async findUnique(userId: UserID): Promise<User | null> {
+ const row = this.rows.get(userId.toString());
+ return row ? new User(row) : null;
+ }
+
+ async patchUpsert(userId: UserID, patch: Partial<UserRow>): Promise<User> {
+ const row = {...this.rows.get(userId.toString())!, ...patch};
+ this.rows.set(userId.toString(), row);
+ return new User(row);
+ }
+
+ async compareAndSetSuspiciousFlags(user: User, flags: number): Promise<User | null> {
+ const row = this.rows.get(user.id.toString())!;
+ if (this.casFailures > 0) {
+ this.casFailures--;
+ return null;
+ }
+ if ((row.suspicious_activity_flags ?? 0) !== user.suspiciousActivityFlags) return null;
+ const next = {...row, suspicious_activity_flags: flags};
+ this.rows.set(user.id.toString(), next);
+ return new User(next);
+ }
+}
+
+interface Harness {
+ users: FakeUsers;
+ presence: Array<unknown>;
+ contactLogs: Array<unknown>;
+ bans: Array<{ip: string; ttl: number}>;
+ refreshes: number;
+ deps: AccountActionDeps;
+}
+
+function harness(): Harness {
+ const users = new FakeUsers();
+ const h: Harness = {users, presence: [], contactLogs: [], bans: [], refreshes: 0, deps: null as never};
+ const state: AccountStateDeps = {
+ users: users as unknown as AccountStateDeps['users'],
+ dispatch: {
+ userUpdated: async (user) => {
+ h.presence.push(user.id);
+ },
+ memberProfilesUpdated: async () => {},
+ },
+ contactChangeLog: {
+ recordDiff: async (params) => {
+ h.contactLogs.push(params);
+ },
+ },
+ ipBans: {
+ isIpBanned: async () => false,
+ banIpTemp: async (ip: string, ttl: number) => {
+ h.bans.push({ip, ttl});
+ },
+ },
+ cache: {
+ publish: async () => {
+ h.refreshes++;
+ },
+ } as unknown as AccountStateDeps['cache'],
+ now: () => NOW,
+ };
+ h.deps = {js: {} as AccountActionDeps['js'], state, now: () => NOW};
+ return h;
+}
+
+describe('account action apply', () => {
+ let h: Harness;
+ beforeEach(() => {
+ h = harness();
+ h.users.put();
+ });
+
+ it('sets requested suspicious bits and reports what it observed', async () => {
+ const outcome = await applyAction(
+ h.deps,
+ envelope<'set_suspicious_flags'>({
+ type: 'set_suspicious_flags',
+ user_id: USER_ID,
+ set: 1,
+ clear: 0,
+ if_current: 0,
+ }),
+ );
+ expect(outcome).toEqual({
+ action_id: 'a:07:4242:0',
+ action_type: 'set_suspicious_flags',
+ status: 'applied',
+ detail: null,
+ observed: {flags: '0', suspicious_flags: 1, has_verified_phone: false, deleted: false},
+ });
+ expect(h.users.current().suspiciousActivityFlags).toBe(1);
+ expect(h.presence).toHaveLength(1);
+ });
+
+ it('is a noop when the bits already hold, so a redelivery changes nothing', async () => {
+ const action = envelope<'set_suspicious_flags'>({
+ type: 'set_suspicious_flags',
+ user_id: USER_ID,
+ set: 1,
+ clear: 0,
+ if_current: null,
+ });
+ await applyAction(h.deps, action);
+ const second = await applyAction(h.deps, action);
+ expect(second.status).toBe('noop');
+ expect(h.presence).toHaveLength(1);
+ });
+
+ it('refuses a stale precondition and leaves the flags alone', async () => {
+ h.users.put({suspicious_activity_flags: SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL});
+ const outcome = await applyAction(
+ h.deps,
+ envelope<'set_suspicious_flags'>({
+ type: 'set_suspicious_flags',
+ user_id: USER_ID,
+ set: 1,
+ clear: 0,
+ if_current: 0,
+ }),
+ );
+ expect(outcome.status).toBe('conflict');
+ expect(outcome.observed?.suspicious_flags).toBe(SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL);
+ expect(h.users.current().suspiciousActivityFlags).toBe(SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL);
+ });
+
+ it('rereads and retries when the compare and set loses a race', async () => {
+ h.users.casFailures = 2;
+ const outcome = await applyAction(
+ h.deps,
+ envelope<'set_suspicious_flags'>({
+ type: 'set_suspicious_flags',
+ user_id: USER_ID,
+ set: 1,
+ clear: 0,
+ if_current: null,
+ }),
+ );
+ expect(outcome.status).toBe('applied');
+ });
+
+ it('treats missing, deleted and bot accounts as ineligible', async () => {
+ h.users.rows.clear();
+ const missing = await applyAction(
+ h.deps,
+ envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true}),
+ );
+ expect(missing).toMatchObject({status: 'ineligible', observed: null});
+ h.users.put({bot: true});
+ const bot = await applyAction(h.deps, envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true}));
+ expect(bot.status).toBe('ineligible');
+ h.users.put({flags: UserFlags.DELETED});
+ const deleted = await applyAction(
+ h.deps,
+ envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true}),
+ );
+ expect(deleted).toMatchObject({status: 'ineligible', observed: {deleted: true}});
+ });
+
+ it('sets and clears the SPAMMER flag idempotently', async () => {
+ const on = envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true});
+ expect((await applyAction(h.deps, on)).status).toBe('applied');
+ expect(h.users.current().flags & UserFlags.SPAMMER).toBe(UserFlags.SPAMMER);
+ expect((await applyAction(h.deps, on)).status).toBe('noop');
+ const off = envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: false});
+ expect((await applyAction(h.deps, off)).status).toBe('applied');
+ expect(h.users.current().flags & UserFlags.SPAMMER).toBe(0n);
+ });
+
+ it('attaches a verified phone once and logs the contact change once', async () => {
+ h.users.put({
+ flags: UserFlags.SPAMMER,
+ suspicious_activity_flags:
+ SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL,
+ });
+ const action = envelope<'phone_verified'>({
+ type: 'phone_verified',
+ user_id: USER_ID,
+ method: 'outbound',
+ clear_suspicious: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE,
+ });
+ expect((await applyAction(h.deps, action)).status).toBe('applied');
+ const user = h.users.current();
+ expect(user.hasVerifiedPhone).toBe(true);
+ expect(user.suspiciousActivityFlags).toBe(SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL);
+ expect(user.flags & UserFlags.SPAMMER).toBe(UserFlags.SPAMMER);
+ expect((await applyAction(h.deps, action)).status).toBe('noop');
+ expect(h.contactLogs).toHaveLength(1);
+ });
+
+ it('ignores unknown envelope fields', async () => {
+ h.users.put({
+ flags: UserFlags.HAS_SESSION_STARTED,
+ suspicious_activity_flags: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE,
+ });
+ const action = {
+ ...envelope<'phone_verified'>({
+ type: 'phone_verified',
+ user_id: USER_ID,
+ method: 'outbound',
+ clear_suspicious: SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE,
+ }),
+ unknown_field: true,
+ };
+ expect((await applyAction(h.deps, action)).status).toBe('applied');
+ const user = h.users.current();
+ expect(user.hasVerifiedPhone).toBe(true);
+ expect(user.suspiciousActivityFlags).toBe(0);
+ expect(user.flags).toBe(UserFlags.HAS_SESSION_STARTED);
+ });
+
+ it('bans a public address until the requested time and refreshes the ban caches', async () => {
+ const outcome = await applyAction(
+ h.deps,
+ envelope<'temp_ban_ip'>({type: 'temp_ban_ip', ip: '93.184.216.34', until_ms: NOW + 3_600_000}),
+ );
+ expect(outcome.status).toBe('applied');
+ expect(h.bans).toEqual([{ip: '93.184.216.34', ttl: 3600}]);
+ expect(h.refreshes).toBe(1);
+ });
+
+ it('bans an IPv6 client by its /64 same-IP key or by its address', async () => {
+ const byKey = await applyAction(
+ h.deps,
+ envelope<'temp_ban_ip'>({type: 'temp_ban_ip', ip: '2001:4860:1:2::/64', until_ms: NOW + 3_600_000}),
+ );
+ expect(byKey.status).toBe('applied');
+ const loose = await applyAction(
+ h.deps,
+ envelope<'temp_ban_ip'>({type: 'temp_ban_ip', ip: '2001:4860:1:2::/48', until_ms: NOW + 3_600_000}),
+ );
+ expect(loose.status).toBe('exempt');
+ expect(h.bans).toEqual([{ip: '2001:4860:1:2::/64', ttl: 3600}]);
+ });
+
+ it('never bans a private address and skips bans about to end', async () => {
+ const privateIp = await applyAction(
+ h.deps,
+ envelope<'temp_ban_ip'>({type: 'temp_ban_ip', ip: '10.0.0.1', until_ms: NOW + 3_600_000}),
+ );
+ expect(privateIp.status).toBe('exempt');
+ const ending = await applyAction(
+ h.deps,
+ envelope<'temp_ban_ip'>({type: 'temp_ban_ip', ip: '93.184.216.34', until_ms: NOW + 30_000}),
+ );
+ expect(ending.status).toBe('noop');
+ expect(h.bans).toEqual([]);
+ });
+
+ it('answers expired actions and unknown shapes without touching the account', async () => {
+ const expired = await applyAction(
+ h.deps,
+ envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true, expires_at_ms: NOW}),
+ );
+ expect(expired.status).toBe('expired');
+ const future = await applyAction(h.deps, {
+ ...envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true}),
+ v: 2,
+ });
+ expect(future.status).toBe('unsupported');
+ const unknown = await applyAction(h.deps, {
+ ...envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true}),
+ type: 'future_type',
+ } as unknown as ActionEnvelope);
+ expect(unknown).toMatchObject({status: 'unsupported', action_type: 'future_type'});
+ expect(h.users.current().flags).toBe(0n);
+ });
+});
+
+interface FakeMsgState {
+ acked: number;
+ naks: Array<number | undefined>;
+ terms: number;
+}
+
+function fakeMsg(data: string, deliveryCount: number): {msg: JsMsg; state: FakeMsgState} {
+ const state: FakeMsgState = {acked: 0, naks: [], terms: 0};
+ const msg = {
+ data: new TextEncoder().encode(data),
+ info: {deliveryCount},
+ ackAck: async () => {
+ state.acked++;
+ return true;
+ },
+ nak: (delay?: number) => {
+ state.naks.push(delay);
+ },
+ term: () => {
+ state.terms++;
+ },
+ } as unknown as JsMsg;
+ return {msg, state};
+}
+
+describe('account action messages', () => {
+ it('publishes the outcome before acknowledging, and terminates undecodable envelopes', async () => {
+ const h = harness();
+ h.users.put();
+ const outcomes: Array<ActionOutcome> = [];
+ h.deps.publishOutcome = async (_key, outcome) => {
+ outcomes.push(outcome);
+ };
+ const good = fakeMsg(JSON.stringify(envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true})), 1);
+ await handleActionMessage(h.deps, good.msg);
+ expect(outcomes.map((outcome) => outcome.status)).toEqual(['applied']);
+ expect(good.state.acked).toBe(1);
+ const bad = fakeMsg('{not json', 1);
+ await handleActionMessage(h.deps, bad.msg);
+ expect(bad.state.terms).toBe(1);
+ expect(outcomes).toHaveLength(1);
+ });
+
+ it('retries a failing apply with backoff and reports failed after the last attempt', async () => {
+ const h = harness();
+ h.users.put();
+ h.users.findUnique = async () => {
+ throw new Error('datastore unavailable');
+ };
+ const outcomes: Array<ActionOutcome> = [];
+ h.deps.publishOutcome = async (_key, outcome) => {
+ outcomes.push(outcome);
+ };
+ const data = JSON.stringify(envelope<'set_spammer'>({type: 'set_spammer', user_id: USER_ID, on: true}));
+ const early = fakeMsg(data, 3);
+ await handleActionMessage(h.deps, early.msg);
+ expect(early.state.naks).toEqual([3000]);
+ expect(outcomes).toEqual([]);
+ const last = fakeMsg(data, 10);
+ await handleActionMessage(h.deps, last.msg);
+ expect(outcomes).toMatchObject([{status: 'failed', detail: 'Error: datastore unavailable'}]);
+ expect(last.state.acked).toBe(1);
+ });
+});
+
+describe.skipIf(!NATS_URL)('account action consumer against JetStream', () => {
+ let nc: Awaited<ReturnType<typeof connect>>;
+ beforeAll(async () => {
+ nc = await connect({servers: NATS_URL, token: process.env.FLUXER_TEST_ACTIVITY_NATS_TOKEN});
+ const jsm = await jetstreamManager(nc);
+ await jsm.streams.delete(ACTIONS_STREAM).catch(() => undefined);
+ await jsm.streams.add({name: ACTIONS_STREAM, subjects: ['act.*']});
+ for (const partition of [0, 7]) {
+ await jsm.consumers.add(ACTIONS_STREAM, {
+ durable_name: effectsConsumer(partition),
+ filter_subject: `act.${String(partition).padStart(2, '0')}`,
+ ack_policy: AckPolicy.Explicit,
+ max_ack_pending: 1,
+ deliver_policy: DeliverPolicy.All,
+ });
+ }
+ });
+ afterAll(async () => {
+ await stopAccountActionConsumer();
+ await nc?.close();
+ });
+
+ it('applies each action in order and acknowledges it after the outcome', async () => {
+ const h = harness();
+ h.users.put();
+ h.deps.now = Date.now;
+ const outcomes: Array<ActionOutcome> = [];
+ h.deps.publishOutcome = async (_key, outcome) => {
+ outcomes.push(outcome);
+ };
+ h.deps.js = jetstream(nc);
+ h.deps.retryDelayMs = 200;
+ const js = jetstream(nc);
+ const expires = Date.now() + 60_000;
+ await js.publish(
+ 'act.07',
+ JSON.stringify(
+ envelope<'set_spammer'>({
+ type: 'set_spammer',
+ id: 'a:07:1:0',
+ user_id: USER_ID,
+ on: true,
+ expires_at_ms: expires,
+ }),
+ ),
+ {msgID: 'a:07:1:0'},
+ );
+ await js.publish(
+ 'act.07',
+ JSON.stringify(
+ envelope<'set_spammer'>({
+ type: 'set_spammer',
+ id: 'a:07:2:0',
+ user_id: USER_ID,
+ on: false,
+ expires_at_ms: expires,
+ }),
+ ),
+ {msgID: 'a:07:2:0'},
+ );
+ startAccountActionConsumer(h.deps);
+ const deadline = Date.now() + 10_000;
+ while (outcomes.length < 2 && Date.now() < deadline) {
+ await new Promise((resolve) => setTimeout(resolve, 50));
+ }
+ expect(outcomes.map((outcome) => [outcome.action_id, outcome.status])).toEqual([
+ ['a:07:1:0', 'applied'],
+ ['a:07:2:0', 'applied'],
+ ]);
+ expect(h.users.current().flags & UserFlags.SPAMMER).toBe(0n);
+ const info = await (await jetstreamManager(nc)).consumers.info(ACTIONS_STREAM, effectsConsumer(7));
+ expect(info.num_ack_pending).toBe(0);
+ expect(info.num_pending).toBe(0);
+ });
+});
diff --git a/fluxer_api/src/api/worker/tests/BlocklistFeedStartup.test.ts b/fluxer_api/src/api/worker/tests/BlocklistFeedStartup.test.ts
index e04475fec..147932fd9 100644
--- a/fluxer_api/src/api/worker/tests/BlocklistFeedStartup.test.ts
+++ b/fluxer_api/src/api/worker/tests/BlocklistFeedStartup.test.ts
@@ -8,7 +8,7 @@ import type {WorkerJobPayload} from '@pkgs/worker/src/contracts/WorkerTypes';
import {describe, expect, it, vi} from 'vitest';
const INITIAL_SYNC_KEY = 'sync:email_domains:initialized';
-const FEED_TASKS = ['syncDisposableEmailDomains', 'syncUrlBlocklists', 'syncFileShaBlocklists'];
+const FEED_TASKS = ['syncUrlBlocklists', 'syncFileShaBlocklists'];
function createWorkerService() {
return {addJob: vi.fn(async (_task: WorkerTaskName, _payload: WorkerJobPayload) => 1n)};
@@ -19,27 +19,17 @@ function queuedTasks(workerService: ReturnType<typeof createWorkerService>): Arr
}
describe('queueBlocklistFeedStartupJobs', () => {
- it('with feeds on, a fresh start queues only the disposable sync and claims it for six hours', async () => {
+ it('with feeds on, a start queues nothing and marks the feeds as enabled for six hours', async () => {
const kv = new MockKVProvider();
const workerService = createWorkerService();
await queueBlocklistFeedStartupJobs(kv, workerService, true);
- expect(workerService.addJob.mock.calls).toEqual([['syncDisposableEmailDomains', {}]]);
+ expect(workerService.addJob).not.toHaveBeenCalled();
expect(kv.setnxSpy.mock.calls).toEqual([[INITIAL_SYNC_KEY, '1', 21600]]);
expect(kv.delSpy).not.toHaveBeenCalled();
});
- it('with feeds on, a start inside the claim queues nothing', async () => {
- const kv = new MockKVProvider();
- const workerService = createWorkerService();
-
- await queueBlocklistFeedStartupJobs(kv, workerService, true);
- await queueBlocklistFeedStartupJobs(kv, workerService, true);
-
- expect(queuedTasks(workerService)).toEqual(['syncDisposableEmailDomains']);
- });
-
it('with feeds off, the first start queues all three feed tasks and a second start queues none', async () => {
const kv = new MockKVProvider();
const workerService = createWorkerService();
@@ -59,11 +49,11 @@ describe('queueBlocklistFeedStartupJobs', () => {
await queueBlocklistFeedStartupJobs(kv, workerService, true);
await queueBlocklistFeedStartupJobs(kv, workerService, false);
- expect(queuedTasks(workerService)).toEqual([...FEED_TASKS, 'syncDisposableEmailDomains', ...FEED_TASKS]);
+ expect(queuedTasks(workerService)).toEqual([...FEED_TASKS, ...FEED_TASKS]);
expect(await kv.exists(INITIAL_SYNC_KEY)).toBe(0);
});
- it('a legacy initial sync key without expiry is cleared, so re-enabling runs the initial sync', async () => {
+ it('a legacy enabled marker without expiry is cleared when feeds are off', async () => {
const kv = new MockKVProvider();
await kv.set(INITIAL_SYNC_KEY, '1');
expect(await kv.ttl(INITIAL_SYNC_KEY)).toBe(-1);
@@ -71,9 +61,8 @@ describe('queueBlocklistFeedStartupJobs', () => {
await queueBlocklistFeedStartupJobs(kv, createWorkerService(), false);
expect(await kv.exists(INITIAL_SYNC_KEY)).toBe(0);
- const workerService = createWorkerService();
- await queueBlocklistFeedStartupJobs(kv, workerService, true);
- expect(queuedTasks(workerService)).toEqual(['syncDisposableEmailDomains']);
+ await queueBlocklistFeedStartupJobs(kv, createWorkerService(), true);
+ expect(await kv.ttl(INITIAL_SYNC_KEY)).toBe(21600);
});
it('a full jobs stream drops the job without failing startup', async () => {
diff --git a/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabled.test.ts b/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabled.test.ts
index e1e5d717d..ea86fafbd 100644
--- a/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabled.test.ts
+++ b/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabled.test.ts
@@ -14,7 +14,6 @@ import {type ApiTestHarness, createApiTestHarness} from '@app/api/test/ApiTestHa
import type {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
import {NoopLogger} from '@app/api/test/mocks/NoopLogger';
import {canonicalizeUrl} from '@app/api/utils/UrlNormalizer';
-import syncDisposableEmailDomains from '@app/api/worker/tasks/SyncDisposableEmailDomains';
import syncFileShaBlocklists from '@app/api/worker/tasks/SyncFileShaBlocklists';
import syncUrlBlocklists from '@app/api/worker/tasks/SyncUrlBlocklists';
import {clearWorkerDependencies, setWorkerDependenciesForTest} from '@app/api/worker/WorkerContext';
@@ -99,31 +98,6 @@ describe('blocklist feeds turned off', () => {
return (harness.kvProvider as MockKVProvider).publishSpy.mock.calls;
}
- it('removes every stored disposable domain without fetching a feed', async () => {
- const adminRepository = getAdminRepository();
- for (const domain of ['mailinator.com', 'guerrillamail.com', 'tempmail.dev']) {
- await adminRepository.addDisposableEmailDomain(domain);
- }
- Config.blocklistFeeds.enabled = false;
- const reportProgress = vi.fn(async () => {});
-
- await syncDisposableEmailDomains({}, createHelpers({reportProgress}));
-
- expect(await adminRepository.listDisposableEmailDomains()).toEqual([]);
- expect(fetchSpy).not.toHaveBeenCalled();
- expect(reportProgress).toHaveBeenLastCalledWith(3, 3, '+0 added, -3 removed');
- });
-
- it('reports a stored domain as disposable only while feeds are on', async () => {
- const adminRepository = getAdminRepository();
- await adminRepository.addDisposableEmailDomain('mailinator.com');
-
- Config.blocklistFeeds.enabled = true;
- expect(await adminRepository.isEmailDomainDisposable('mailinator.com')).toBe(true);
- Config.blocklistFeeds.enabled = false;
- expect(await adminRepository.isEmailDomainDisposable('mailinator.com')).toBe(false);
- });
-
it('removes MalwareBazaar feed rows and keeps every other file-SHA ban', async () => {
await seedFileShas();
Config.blocklistFeeds.enabled = false;
diff --git a/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabledPostgres.test.ts b/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabledPostgres.test.ts
index ad15a721d..957e75f72 100644
--- a/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabledPostgres.test.ts
+++ b/fluxer_api/src/api/worker/tests/BlocklistFeedsDisabledPostgres.test.ts
@@ -13,7 +13,6 @@ import {InMemoryCassandraQueryExecutor} from '@app/api/test/InMemoryCassandraQue
import {MockKVProvider} from '@app/api/test/mocks/MockKVProvider';
import {MockStorageService} from '@app/api/test/mocks/MockStorageService';
import {NoopLogger} from '@app/api/test/mocks/NoopLogger';
-import syncDisposableEmailDomains from '@app/api/worker/tasks/SyncDisposableEmailDomains';
import syncFileShaBlocklists from '@app/api/worker/tasks/SyncFileShaBlocklists';
import {
clearWorkerDependencies,
@@ -153,24 +152,6 @@ describe.skipIf(!dockerAvailable)('blocklist feeds turned off against postgres',
spawnSync('docker', ['rm', '-f', CONTAINER], {stdio: 'ignore'});
});
- it('removes every disposable_email_domains row from the KV table', async () => {
- const repository = new AdminRepository();
- for (let i = 0; i < 1200; i++) {
- await repository.addDisposableEmailDomain(`disposable-${i}.example`);
- }
- const seeded = await raw.query<{count: number}>(
- `SELECT count(*)::int AS count FROM ${KV_TABLE} WHERE table_name = 'disposable_email_domains'`,
- );
- expect(seeded.rows[0]?.count).toBe(1200);
-
- await syncDisposableEmailDomains({}, createHelpers());
-
- const remaining = await raw.query<{count: number}>(
- `SELECT count(*)::int AS count FROM ${KV_TABLE} WHERE table_name = 'disposable_email_domains'`,
- );
- expect(remaining.rows[0]?.count).toBe(0);
- });
-
it('keeps file-SHA rows with added_by set and removes feed rows stored with a JSON null added_by', async () => {
const repository = new AdminRepository();
await repository.banFileSha(fileShaRow(FEED_SHA, ContentBlocklistCategory.MALWARE_BAZAAR, null));
diff --git a/fluxer_api/src/api/worker/tests/BulkScheduleUserDeletion.test.ts b/fluxer_api/src/api/worker/tests/BulkScheduleUserDeletion.test.ts
index 1429ab4af..3ef406469 100644
--- a/fluxer_api/src/api/worker/tests/BulkScheduleUserDeletion.test.ts
+++ b/fluxer_api/src/api/worker/tests/BulkScheduleUserDeletion.test.ts
@@ -212,4 +212,24 @@ describe('bulkScheduleUserDeletion', () => {
const perUserLogs = await listAuditLogs('schedule_deletion');
expect(perUserLogs.filter((log) => log.targetId === BigInt(target.userId))).toHaveLength(1);
});
+ test('leaves a deletion another admin already scheduled in place and reports the user as not scheduled', async () => {
+ const scheduler = await createTestAccount(harness);
+ await setUserACLs(harness, scheduler, ['admin:authenticate', 'user:delete']);
+ const admin = await createTestAccount(harness);
+ await setUserACLs(harness, admin, ['admin:authenticate', 'bulk:delete:users']);
+ const scheduled = await createTestAccount(harness);
+ const fresh = await createTestAccount(harness);
+ await createBuilder(harness, scheduler.token)
+ .put(`/admin/users/${scheduled.userId}/deletion`)
+ .body({reason_code: DeletionReasons.SPAM, days_until_deletion: 90})
+ .expect(HTTP_STATUS.OK)
+ .execute();
+ const before = await getUserRepository().findUnique(createUserID(BigInt(scheduled.userId)));
+ const result = await runBulkJob([scheduled.userId, fresh.userId], admin.userId);
+ expect(result.successful_count).toBe(1);
+ expect(result.failed).toEqual([{id: scheduled.userId, error: 'A deletion is already scheduled for this account'}]);
+ const after = await getUserRepository().findUnique(createUserID(BigInt(scheduled.userId)));
+ expect(after?.pendingDeletionAt?.getTime()).toBe(before?.pendingDeletionAt?.getTime());
+ expect(after?.deletionScheduledBy?.toString()).toBe(scheduler.userId);
+ });
});
diff --git a/fluxer_api/src/api/worker/tests/BulkUpdateSuspiciousActivityFlagsTask.test.ts b/fluxer_api/src/api/worker/tests/BulkUpdateSuspiciousActivityFlagsTask.test.ts
index 141f71ee0..0ff2ebedb 100644
--- a/fluxer_api/src/api/worker/tests/BulkUpdateSuspiciousActivityFlagsTask.test.ts
+++ b/fluxer_api/src/api/worker/tests/BulkUpdateSuspiciousActivityFlagsTask.test.ts
@@ -3,7 +3,6 @@
import {AdminRepository} from '@app/api/admin/AdminRepository';
import {createTestAccount, type TestAccount} from '@app/api/auth/tests/AuthTestUtils';
import {createUserID} from '@app/api/BrandedTypes';
-import {getHistoricalOutcomeRepository} from '@app/api/middleware/ServiceMiddleware';
import {getGatewayService, getSnowflakeService} from '@app/api/middleware/ServiceRegistry';
import {
createUserCacheService,
@@ -39,7 +38,6 @@ interface BulkJobResult {
const ADMIN_USER_ID = 4000000000000000000n;
const JOB_ID = 7200000000000000000n;
const MISSING_USER_ID = 4200000000000000002n;
-const RISK_CONTEXT_IP = '203.0.113.77';
function createHelpers(): WorkerTaskHelpers {
return {
@@ -97,17 +95,9 @@ describe('bulkUpdateSuspiciousActivityFlags task', () => {
return user!.suspiciousActivityFlags ?? 0;
}
- test('writes a per-user audit row with the admin reason, records the risk outcome, and reports failures', async () => {
+ test('writes a per-user audit row with the admin reason and reports failures', async () => {
const account = await createTestAccount(harness);
await setSuspiciousFlags(account, 0);
- await getHistoricalOutcomeRepository().upsertLatestContext({
- userId: account.userId,
- ip: RISK_CONTEXT_IP,
- subnet: null,
- emailDomain: null,
- asn: null,
- updatedAt: new Date(),
- });
const result = (await bulkUpdateSuspiciousActivityFlags(
{
@@ -143,11 +133,6 @@ describe('bulkUpdateSuspiciousActivityFlags task', () => {
expect(summaryLogs[0]!.metadata.has('remove_flags')).toBe(false);
expect(summaryLogs[0]!.metadata.get('successful')).toBe('1');
expect(summaryLogs[0]!.metadata.get('failed')).toBe('1');
-
- const outcomes = await getHistoricalOutcomeRepository().listByIp(RISK_CONTEXT_IP, new Date(0), 50);
- expect(outcomes.map((outcome) => [outcome.outcomeCode, outcome.source])).toEqual([
- ['challenged', 'admin_update_suspicious_activity_flags'],
- ]);
});
test('removing a phone requirement clears the deferral bookkeeping bits', async () => {
diff --git a/fluxer_api/src/api/worker/tests/WorkerLaneConfig.test.ts b/fluxer_api/src/api/worker/tests/WorkerLaneConfig.test.ts
index 986ca1324..0b838b219 100644
--- a/fluxer_api/src/api/worker/tests/WorkerLaneConfig.test.ts
+++ b/fluxer_api/src/api/worker/tests/WorkerLaneConfig.test.ts
@@ -61,16 +61,20 @@ describe('WorkerLaneConfig', () => {
expect(embedLane[0]!.name).toBe('unfurl');
expect(embedLane[0]!.taskTypes).toEqual(['extractEmbeds']);
});
- it('keeps the retired scheduled message subject on the lifecycle lane only', () => {
+ it('keeps each retired subject on the lane that used to run it', () => {
const lanes = resolveWorkerLanes({
mode: 'all_lanes',
laneConcurrencyOverrides: {},
});
- const lifecycleLane = lanes.find((lane) => lane.name === 'lifecycle');
- expect(lifecycleLane?.retiredTaskTypes).toEqual(['sendScheduledMessage']);
- expect(lifecycleLane?.taskTypes).not.toContain('sendScheduledMessage');
- for (const lane of lanes.filter((lane) => lane.name !== 'lifecycle')) {
- expect(lane.retiredTaskTypes).toEqual([]);
+ const retired = Object.fromEntries(lanes.map((lane) => [lane.name, lane.retiredTaskTypes]));
+ expect(retired).toEqual({
+ realtime: [],
+ unfurl: [],
+ lifecycle: ['sendScheduledMessage'],
+ batch: [],
+ });
+ for (const lane of lanes) {
+ for (const task of lane.retiredTaskTypes) expect(lane.taskTypes).not.toContain(task);
}
});
it('never claims a retired subject from a single_task lane', () => {
diff --git a/fluxer_api/vitest.config.ts b/fluxer_api/vitest.config.ts
index d501c7f9e..a20a8da87 100644
--- a/fluxer_api/vitest.config.ts
+++ b/fluxer_api/vitest.config.ts
@@ -24,14 +24,12 @@ const configuredMaxConcurrency = parseParallelInteger(process.env.API_TEST_MAX_C
const MODULE_REGISTRY_TEST_FILES = [
'src/api/gif/GifRequestCountry.test.ts',
- 'src/api/risk/__tests__/AccountPolicyService.test.ts',
'src/api/stripe/tests/StripeCheckoutCountryEnforcement.test.ts',
'src/api/stripe/tests/StripeNordicCurrencies.test.ts',
];
const INSTANCE_POLICY_TEST_FILES = [
'src/api/admin/tests/InstanceConfigPendingRegistrationApproval.test.ts',
- 'src/api/auth/tests/DeferredPhoneGate.test.ts',
'src/api/instance/tests/SingleCommunityService.test.ts',
];
diff --git a/fluxer_app/src/features/app/config/I18nDisplayConstants.ts b/fluxer_app/src/features/app/config/I18nDisplayConstants.ts
index f7663e8e0..99ed3e8b4 100644
--- a/fluxer_app/src/features/app/config/I18nDisplayConstants.ts
+++ b/fluxer_app/src/features/app/config/I18nDisplayConstants.ts
@@ -89,7 +89,5 @@ export const BANNER_ASPECT_RATIO_LABEL = '17:6';
export const WIDE_IMAGE_ASPECT_RATIO_LABEL = '16:9';
export const MFA_CODE_DIGIT_COUNT = 6;
export const FLUXER_TAG_DIGIT_COUNT = 4;
-export const PHONE_VERIFICATION_LIMIT = 2;
-export const PHONE_VERIFICATION_WINDOW_DAYS = 30;
export const ADULT_CONTENT_MINIMUM_AGE = 18;
export const UNLIMITED_USER_LIMIT = 0;
diff --git a/fluxer_app/src/features/auth/components/modals/RequiredActionModal.tsx b/fluxer_app/src/features/auth/components/modals/RequiredActionModal.tsx
index 647be347d..9ee02f8eb 100644
--- a/fluxer_app/src/features/auth/components/modals/RequiredActionModal.tsx
+++ b/fluxer_app/src/features/auth/components/modals/RequiredActionModal.tsx
@@ -170,15 +170,6 @@ function isPhoneView(kind: RequiredActionViewKind): boolean {
);
}
-function isPhoneInboundView(kind: RequiredActionViewKind): boolean {
- return (
- kind === 'phone-inbound-start' ||
- kind === 'phone-inbound-prepare' ||
- kind === 'phone-inbound-send' ||
- kind === 'phone-inbound-wait'
- );
-}
-
function getIntroDescription(flow: RequiredActionFlow | null, isEmailBounced: boolean): MessageDescriptor {
if (isEmailBounced) return STEP_INTRO_BOUNCED_EMAIL_DESCRIPTION_DESCRIPTOR;
if (flow?.mode === 'email_and_phone') return STEP_INTRO_EMAIL_AND_PHONE_DESCRIPTION_DESCRIPTOR;
@@ -288,18 +279,6 @@ const RequiredActionModal: React.FC<{mock?: boolean}> = observer(({mock = false}
return previous ? current.slice(0, -1) : current;
});
}, []);
- const goToPhoneCodeFromInbound = useCallback(() => {
- setCarouselDirection(1);
- setActionError(null);
- setHistory((current) => {
- const retainedHistory = current.filter((entry) => !isPhoneInboundView(entry.kind));
- if (retainedHistory.at(-1)?.kind === 'phone-number') {
- return retainedHistory;
- }
- return [...retainedHistory, {kind: 'phone-number'}];
- });
- setView({kind: 'phone-code'});
- }, []);
const switchToPhonePath = useCallback(() => {
setSelectedVerificationType('phone');
}, []);
@@ -462,7 +441,6 @@ const RequiredActionModal: React.FC<{mock?: boolean}> = observer(({mock = false}
? {
code: phoneVerification.screen.code,
ourNumber: phoneVerification.screen.ourNumber,
- reason: phoneVerification.screen.reason,
}
: null;
const renderView = (): React.ReactNode => {
@@ -831,11 +809,9 @@ const RequiredActionModal: React.FC<{mock?: boolean}> = observer(({mock = false}
/>
<Button
onClick={() =>
- void runPhoneAction(phoneVerification.onRefreshInboundChallenge, 'general').then((result) => {
- if (result === 'inbound-challenge') {
+ void runPhoneAction(phoneVerification.onRefreshInboundChallenge, 'general').then((refreshed) => {
+ if (refreshed) {
goBackToFallback({kind: 'phone-inbound-send'});
- } else if (result === 'phone-code') {
- goToPhoneCodeFromInbound();
}
})
}
diff --git a/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts b/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts
index 4290d2d70..f090cfc43 100644
--- a/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts
+++ b/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts
@@ -315,9 +315,9 @@ export const ESCAPE_CONFIRM_TITLE_WITH_GUILDS_DESCRIPTOR = msg({
});
export const ESCAPE_CONFIRM_OUTCOME_DESCRIPTOR = msg({
message:
- 'Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back.',
+ 'Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later.',
comment:
- 'First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.',
+ 'First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.',
});
export const ESCAPE_CONFIRM_LEAVE_DESCRIPTOR = msg({
message: 'You will leave {guildNames}. Nothing you posted is deleted, and you can join again later.',
@@ -420,8 +420,8 @@ export const PHONE_NUMBER_DESCRIPTION_DESCRIPTOR = msg({
});
export const PHONE_PRIVACY_DESCRIPTOR = msg({
message:
- 'Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days.',
- comment: 'Required-action modal privacy note for phone verification. limit and duration are inserted by code.',
+ 'Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time.',
+ comment: 'Required-action modal privacy note for phone verification.',
});
export const ENTER_PHONE_CODE_TITLE_DESCRIPTOR = msg({
message: 'Enter the SMS code',
@@ -439,10 +439,6 @@ export const INBOUND_PHONE_START_DESCRIPTION_DESCRIPTOR = msg({
message: 'For this check, you send us a text message instead of receiving one from us.',
comment: 'Required-action modal body for starting an inbound phone verification challenge.',
});
-export const INBOUND_PHONE_EXPENSIVE_REASON_DESCRIPTOR = msg({
- message: 'Sending an SMS to this number is expensive, so we need you to text us instead.',
- comment: 'Required-action modal explanation for an inbound phone verification challenge due to SMS cost.',
-});
export const INBOUND_PHONE_DEFAULT_REASON_DESCRIPTOR = msg({
message: 'This number needs text-in verification instead of an SMS from us.',
comment: 'Required-action modal explanation for an inbound phone verification challenge.',
@@ -570,13 +566,12 @@ export const PHONE_NOT_IN_SERVICE_DESCRIPTOR = msg({
export const PHONE_NOT_MOBILE_DESCRIPTOR = msg({
message:
"This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong.",
- comment:
- 'Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.',
+ comment: 'Required-action form error when the number is not a mobile line. Do not name the line type.',
});
export const PHONE_NEEDS_REVIEW_DESCRIPTOR = msg({
message: "We couldn't verify this number automatically. Contact support and a person will review your account.",
comment:
- 'Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.',
+ 'Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.',
});
export const CAPTCHA_REQUIRED_DESCRIPTOR = msg({
message: 'A browser check is required before phone verification. Try again from the sign-in page or contact support.',
diff --git a/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionPhone.tsx b/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionPhone.tsx
index 9b3f450d4..59dc53b6b 100644
--- a/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionPhone.tsx
+++ b/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionPhone.tsx
@@ -1,10 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import {
- MFA_CODE_DIGIT_COUNT,
- PHONE_VERIFICATION_LIMIT,
- PHONE_VERIFICATION_WINDOW_DAYS,
-} from '@app/features/app/config/I18nDisplayConstants';
+import {MFA_CODE_DIGIT_COUNT} from '@app/features/app/config/I18nDisplayConstants';
import styles from '@app/features/auth/components/modals/RequiredActionModal.module.css';
import {
COUNTRY_DESCRIPTOR,
@@ -14,7 +10,6 @@ import {
INBOUND_PHONE_CODE_LABEL_DESCRIPTOR,
INBOUND_PHONE_DEFAULT_REASON_DESCRIPTOR,
INBOUND_PHONE_DESTINATION_LABEL_DESCRIPTOR,
- INBOUND_PHONE_EXPENSIVE_REASON_DESCRIPTOR,
INBOUND_PHONE_PREPARE_DESCRIPTION_DESCRIPTOR,
INBOUND_PHONE_PREPARE_TITLE_DESCRIPTOR,
INBOUND_PHONE_SEND_DESCRIPTION_DESCRIPTOR,
@@ -44,7 +39,6 @@ import {
type CodeFormInputs,
normalizeVerificationCode,
type PhoneFormInputs,
- type PhoneInboundChallengeReason,
type PhoneScreen,
type SubmitCallback,
} from '@app/features/auth/components/modals/required_action/RequiredActionTypes';
@@ -65,7 +59,6 @@ import {
getE164PhoneNumber,
getPhoneNumberPlaceholder,
} from '@app/media/data/CountryCodes';
-import type {I18n} from '@lingui/core';
import {useLingui} from '@lingui/react/macro';
import type React from 'react';
import {useCallback, useEffect, useMemo, useState} from 'react';
@@ -145,12 +138,6 @@ const renderCountryValue = (option: CountrySelectOption | null) => {
);
};
-function getInboundReasonText(i18n: I18n, reason: PhoneInboundChallengeReason | null): string {
- return reason === 'expensive_destination'
- ? i18n._(INBOUND_PHONE_EXPENSIVE_REASON_DESCRIPTOR)
- : i18n._(INBOUND_PHONE_DEFAULT_REASON_DESCRIPTOR);
-}
-
interface InboundPhoneStartStepProps {
requiresInboundPhone: boolean;
}
@@ -179,7 +166,7 @@ export const InboundPhoneInstructionStep: React.FC<InboundPhoneInstructionStepPr
<StepShell
title={i18n._(INBOUND_PHONE_PREPARE_TITLE_DESCRIPTOR)}
description={i18n._(INBOUND_PHONE_PREPARE_DESCRIPTION_DESCRIPTOR)}
- notice={getInboundReasonText(i18n, challenge.reason)}
+ notice={i18n._(INBOUND_PHONE_DEFAULT_REASON_DESCRIPTOR)}
data-flx="auth.required-action.required-action-phone.inbound-phone-instruction-step.step-shell"
/>
);
@@ -249,10 +236,7 @@ export const PhoneNumberStep: React.FC<PhoneNumberFormProps> = ({
<StepShell
title={i18n._(PHONE_NUMBER_TITLE_DESCRIPTOR)}
description={i18n._(PHONE_NUMBER_DESCRIPTION_DESCRIPTOR)}
- notice={i18n._(PHONE_PRIVACY_DESCRIPTOR, {
- limit: PHONE_VERIFICATION_LIMIT,
- duration: PHONE_VERIFICATION_WINDOW_DAYS,
- })}
+ notice={i18n._(PHONE_PRIVACY_DESCRIPTOR)}
data-flx="auth.required-action.required-action-phone.phone-number-step.step-shell"
>
<div
@@ -346,7 +330,7 @@ export interface PhoneVerificationController {
onCodeFormSubmit: SubmitCallback;
onCountryChange: (country: CountryCode) => void;
onPhoneInput: (event: React.ChangeEvent<HTMLInputElement>) => void;
- onRefreshInboundChallenge: () => Promise<'inbound-challenge' | 'phone-code' | null>;
+ onRefreshInboundChallenge: () => Promise<boolean>;
onBackToPhone: () => void;
}
@@ -397,12 +381,7 @@ export const usePhoneVerification = ({
setIsStartingInbound(true);
try {
const challenge = await UserCommands.startInboundPhoneChallenge();
- setScreen({
- kind: 'phone-inbound-challenge',
- code: challenge.challenge_code,
- ourNumber: challenge.our_number,
- reason: null,
- });
+ setScreen({kind: 'phone-inbound-challenge', code: challenge.challenge_code, ourNumber: challenge.our_number});
} finally {
setIsStartingInbound(false);
}
@@ -423,7 +402,6 @@ export const usePhoneVerification = ({
kind: 'phone-inbound-challenge',
code: verification.challenge_code,
ourNumber: verification.our_number,
- reason: verification.reason,
});
return;
}
@@ -445,42 +423,17 @@ export const usePhoneVerification = ({
},
[getCurrentE164PhoneNumber, returnToPhoneStepWithError, i18n],
);
- const onRefreshInboundChallenge = useCallback(async (): Promise<'inbound-challenge' | 'phone-code' | null> => {
- if (screen.kind !== 'phone-inbound-challenge') return null;
- const currentReason = screen.reason;
+ const onRefreshInboundChallenge = useCallback(async (): Promise<boolean> => {
+ if (screen.kind !== 'phone-inbound-challenge') return false;
setIsStartingInbound(true);
try {
- if (currentReason === 'expensive_destination') {
- const e164Phone = getCurrentE164PhoneNumber();
- if (!e164Phone) {
- returnToPhoneStepWithError();
- return null;
- }
- const verification = await UserCommands.sendPhoneVerification(e164Phone);
- if (verification.channel === 'inbound_challenge') {
- setScreen({
- kind: 'phone-inbound-challenge',
- code: verification.challenge_code,
- ourNumber: verification.our_number,
- reason: verification.reason,
- });
- return 'inbound-challenge';
- }
- setScreen({kind: 'phone-code', recipient: e164Phone});
- return 'phone-code';
- }
const challenge = await UserCommands.startInboundPhoneChallenge();
- setScreen({
- kind: 'phone-inbound-challenge',
- code: challenge.challenge_code,
- ourNumber: challenge.our_number,
- reason: null,
- });
- return 'inbound-challenge';
+ setScreen({kind: 'phone-inbound-challenge', code: challenge.challenge_code, ourNumber: challenge.our_number});
+ return true;
} finally {
setIsStartingInbound(false);
}
- }, [getCurrentE164PhoneNumber, screen, returnToPhoneStepWithError]);
+ }, [screen]);
const {handleSubmit: onPhoneFormSubmit, isSubmitting: isPhoneSubmitting} = useRequiredActionFormSubmit(
phoneForm,
onStartInbound,
diff --git a/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionTypes.ts b/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionTypes.ts
index 5c5789459..7fb52725c 100644
--- a/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionTypes.ts
+++ b/fluxer_app/src/features/auth/components/modals/required_action/RequiredActionTypes.ts
@@ -22,18 +22,9 @@ export interface VerificationTab {
label: string;
}
-export type PhoneInboundChallengeReason =
- | 'voip'
- | 'canadian'
- | 'unknown_line_type'
- | 'expensive_destination'
- | 'account_forced'
- | 'behavioural_risk';
-
export interface ActiveInboundChallenge {
code: string;
ourNumber: string;
- reason: PhoneInboundChallengeReason | null;
}
export type EmailScreen =
@@ -46,7 +37,7 @@ export type PhoneScreen =
| {kind: 'phone-number'}
| {kind: 'phone-code'; recipient: string}
| {kind: 'phone-inbound-start'}
- | {kind: 'phone-inbound-challenge'; code: string; ourNumber: string; reason: PhoneInboundChallengeReason | null};
+ | {kind: 'phone-inbound-challenge'; code: string; ourNumber: string};
export const EMAIL_SCREEN_ORDER: ReadonlyArray<EmailScreen['kind']> = [
'email-instructions',
diff --git a/fluxer_app/src/features/i18n/locales/ar/messages.po b/fluxer_app/src/features/i18n/locales/ar/messages.po
index 8194cbaa5..86e734996 100644
--- a/fluxer_app/src/features/i18n/locales/ar/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ar/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 أيام"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "يلزم إجراء فحص للمتصفح قبل التحقق من رقم الهاتف. حاول مرة أخرى من صفحة تسجيل الدخول أو اتصل بالدعم."
@@ -5240,8 +5240,8 @@ msgstr "غير متواجد حاليًا"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "رجوع"
@@ -6451,7 +6451,7 @@ msgstr "لا يمكن تحميل الملفات هنا"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "سمة الفحم"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "مؤقت العد التنازلي"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "البلد"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "البريد الإلكتروني غير متاح"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "تحديث البريد الإلكتروني غير متاح حاليًا. حاول مرة أخرى لاحقًا أو اتصل بالدعم."
@@ -13999,7 +13999,7 @@ msgstr "أدخل عنوان URL أو رمز قالب {theOtherPlatform} صالح
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "أدخل عنوان بريد إلكتروني صالحًا."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "أدخل رابط رسالة صالحًا."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "أدخل رقم هاتف جوال صالحًا."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "أدخل رقم هاتف صالحًا"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "أدخل الرمز المكون من {digitCount} أرقام الذي تم إرساله إلى {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "أدخل الرمز المكون من {MFA_CODE_DIGIT_COUNT} أرقام الذي تم إرساله إلى {0}."
@@ -16137,7 +16137,7 @@ msgstr "احصل على {premiumProductName} لتخصيص علامتك أو ال
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "الحصول على رمز جديد"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "افتح متصفحك، سجّل الدخول، ثم أدخل الرمز أدناه لربط حسابك."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "افتح رسائلك"
@@ -24047,12 +24047,12 @@ msgstr "افتح رسائلك"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "افتح تطبيق {PRODUCT_NAME} القديم واختر \"ربط جهاز جديد\"، ثم أدخل الرمز أدناه."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "افتح تطبيق الرسائل على هاتفك وأنشئ رسالة نصية جديدة."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "افتح تطبيق الرسائل على هاتفك وابدأ رسالة نصية جديدة."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "خدمة التحقق من أرقام الهواتف لدينا متوقفة حاليًا. المشكلة من جانبنا وليست في رقمك. انتظر بضع دقائق ثم جرّب الرقم نفسه مرة أخرى."
@@ -24810,21 +24810,21 @@ msgstr "الهاتف"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "رقم الهاتف"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "رقم الهاتف مطلوب"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "تم التحقق من رقم الهاتف"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "خطوة الهاتف"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "التحقق من الهاتف غير متاح لهذا الحساب. استخدم طريقة أخرى أو اتصل بالدعم."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "إعادات النشر: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "اطلب رمزًا جديدًا أولاً."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "البحث عن مجتمعات"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "البحث عن البلدان..."
@@ -29559,17 +29559,17 @@ msgstr "إرسال رسائل تحويل النص إلى كلام باستخدا
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "أرسل الرمز <0>{0}</0> إلى <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "أرسل الرمز إلى رقم الهاتف أدناه."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "أرسل هذا الرمز"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "هل تريد إعادة هذه الرسالة المثبتة إلى الماضي؟"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "إرسال إلى"
@@ -29606,16 +29606,11 @@ msgstr "إرسال رسالة صوتية"
msgid "Send:"
msgstr "الإرسال:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "إرسال رسالة نصية قصيرة إلى هذا الرقم مكلف، لذا نحتاج منك أن ترسل لنا رسالة نصية بدلاً من ذلك."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "إرسال رسالة نصية قصيرة إلى رقم الهاتف هذا مكلف للغاية بالنسبة إلى {PRODUCT_NAME}، لذلك نحتاج منك أن ترسل لنا رسالة نصية قصيرة بدلًا من ذلك. نعلم أن هذا ليس مثاليًا. يمكنك أيضًا أن تطلب من مسؤولي هذا المثيل رفع هذا الشرط عن حسابك."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "إرسال رسالة نصية قصيرة إلى رقم الهاتف هذا مكلف للغاية بالنسبة إلى {PRODUCT_NAME}، لذلك نحتاج منك أن ترسل لنا رسالة نصية قصيرة بدلًا من ذلك. نعلم أن هذا ليس مثاليًا. يمكنك أيضًا التواصل مع <0>{SUPPORT_EMAIL}</0> لنرفع هذا الشرط عن حسابك."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "فيديو أكثر سلاسة"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "التحقق عبر الرسائل النصية غير متاح حاليًا. حاول مرة أخرى لاحقًا أو تواصل مع فريق الدعم."
@@ -31397,7 +31392,7 @@ msgstr "حدث خطأ ما. يُرجى المحاولة مرة أخرى لاحق
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "حدث خطأ ما. يُرجى المحاولة مرة أخرى."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "عناصر تحكم الموظفين"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "قد تُطبَّق رسوم الرسائل النصية المعتادة لدى شركة الاتصالات."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "شكرًا لمساعدتك في الحفاظ على أمان {productName}. سنراجع بلاغك في أقرب وقت ممكن."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "هذا الرمز غير صحيح. تحقق منه وحاول مرة أخرى."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "انتهت صلاحية هذا الرمز. اطلب رمزًا جديدًا."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "لا يبدو هذا رابطًا صالحًا."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "هذا البريد الإلكتروني مستخدم بالفعل."
@@ -34118,8 +34113,8 @@ msgstr "هذا هو آخر مفتاح مرور لديك، ومفاتيح الم
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "هذا هو آخر مفتاح مرور لديك. بمجرد حذفه، لن تتمكن من استخدام مفتاح مرور كعامل ثانٍ."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "هذا ليس رقم هاتف محمول، لذا لا يمكنه استقبال رسائلنا النصية. جرب رقم هاتف محمول، أو اتصل بالدعم إذا كنت تعتقد أن هذا خطأ."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "سيظهر هذا الاسم المستعار في هذا المجتمع فقط"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "يجب التحقق من هذا الرقم بإرسال رسالة نصية إلينا بدلًا من ذلك. ارجع وابدأ التحقق من الهاتف مرة أخرى للحصول على الرمز والرقم الذي سترسل إليه الرسالة."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "يتطلب هذا الرقم التحقق بإرسال رسالة نصية منك إلينا بدلًا من أن نرسل إليك رسالة SMS."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "عطّل المشرفون السمع لدى هذا المشارك"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "لا يمكن استخدام رقم الهاتف هذا. جرّب رقم هاتف محمول آخر أو اتصل بالدعم."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "لقد تم استخدام رقم الهاتف هذا بالفعل. جرّب رقمًا آخر أو اتصل بالدعم."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "انتهت صلاحية جلسة التحقق هذه. ارجع إلى {productName} وابدأ عملية الدفع مرة أخرى."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "انتهت صلاحية جلسة التحقق هذه. ابدأ من جديد."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "سيؤدي هذا إلى الوثوق بجميع الروابط الخارجية وتجاوز التحذير لكل نطاق. سيتم استبدال نطاقاتك الموثوقة الحالية. هذا أقل أمانًا."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "سيتم تحديث هذه النافذة تلقائيًا بعد استلام رسالتك."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "تحويل درجات ألوان صور HDR إلى النطاق القياسي لتقليل ذروة السطوع."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "محاولات كثيرة جدًا. انتظر قليلًا، ثم حاول مرة أخرى."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "استخدم بريدًا إلكترونيًا يمكنك الوصول إليه. سنرسل إليه رمزًا."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "استخدم بريدًا إلكترونيًا مختلفًا عن بريدك الحالي."
@@ -37318,17 +37313,17 @@ msgstr "تأكيد هويتك"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "التحقق من الهاتف"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "التحقق من رقم الهاتف"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "نموذج التحقق من رقم الهاتف"
@@ -38192,7 +38187,7 @@ msgstr "رفع الصوت"
msgid "Wait a moment before deleting more messages."
msgstr "انتظر لحظة قبل حذف المزيد من الرسائل."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "انتظر لحظة. ستُغلَق هذه النافذة تلقائيًا بمجرد استلام رسالتك."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "الانتظار بين الرسائل. يمكن للأعضاء الذين لديهم إذن \"{bypassSlowmodePermissionLabel}\" تجاوز ذلك."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "انتظر هنا"
@@ -38368,13 +38363,13 @@ msgstr "تعذّر علينا قراءة هذه السمة. قد تكون تال
msgid "We couldn't remove that account. Try again."
msgstr "تعذّر علينا إزالة هذا الحساب. يُرجى المحاولة مرة أخرى."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "لم نتمكن من التحقق من هذا الرقم تلقائيًا. تواصل مع الدعم وسيراجع أحد أفراد الفريق حسابك."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "لا نرسل رسائل التحقق النصية إلى هذا البلد. جرب رقم هاتف محمول من بلد آخر، أو اتصل بالدعم."
@@ -38469,9 +38464,9 @@ msgstr "سنرسل رمز تحقق إلى بريدك الإلكتروني قبل
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "سنرسل رمز تحقق إلى بريدك الإلكتروني قبل أن تتمكن من عرض رموزك الاحتياطية."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "سنرسل رمزًا عبر رسالة نصية قصيرة عند توفره. رقمك غير مرتبط بحسابك. نحتفظ بعلامة مشفرة فقط، بدون معرف مستخدم، للسماح بـ {PHONE_VERIFICATION_LIMIT} عملية تحقق كحد أقصى خلال {PHONE_VERIFICATION_WINDOW_DAYS} يومًا تقريبًا."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "سنرسل رمز SMS عند توفره. رقمك غير مرتبط بحسابك. نحتفظ فقط بعلامة مشفرة، بدون معرف مستخدم، لفترة محدودة."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "انتهت صلاحية جلسة {productName} الخاصة بك. سجّ
msgid "Your account"
msgstr "حسابك"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "يعود حسابك إلى طبيعته فورًا ولن تحتاج إلى رقم هاتف الآن. هذا ليس إعفاءً دائمًا. قد يؤدي الانضمام إلى مجتمع كبير أو عام إلى إعادة هذا الفحص."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "يعود حسابك إلى طبيعته فورًا ولن تحتاج إلى رقم هاتف الآن. هذا ليس إعفاءً دائمًا، وقد نطلب هذا التحقق مرة أخرى لاحقًا."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "بطاقتك مؤهلة. سيتم توجيهك إلى صفحة الدفع الآن."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "تفيد شركة الاتصالات لديك بأن هذا الرقم خارج الخدمة. تحقق منه وحاول مرة أخرى، أو اتصل بالدعم إذا كان صحيحًا."
@@ -40216,10 +40211,10 @@ msgstr "بريدك الإلكتروني الجديد"
msgid "Your new nickname, or leave blank to reset it."
msgstr "اسمك المستعار الجديد، أو اتركه فارغًا لإعادة تعيينه."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "رقمك غير مرتبط بحسابك. نحتفظ بعلامة مشفرة فقط، بدون معرف مستخدم، لما يصل إلى {limit} عملية تحقق في حوالي {duration} يومًا."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "رقمك غير مرتبط بحسابك. نحتفظ بعلامة مشفرة فقط، بدون معرف مستخدم، لفترة محدودة."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/bg/messages.po b/fluxer_app/src/features/i18n/locales/bg/messages.po
index 9537bcbd3..0926ec4b2 100644
--- a/fluxer_app/src/features/i18n/locales/bg/messages.po
+++ b/fluxer_app/src/features/i18n/locales/bg/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 дни"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Необходима е проверка на браузъра, преди да потвърдиш телефона си. Опитай отново от страницата за вход или се свържи с екипа за поддръжка."
@@ -5240,8 +5240,8 @@ msgstr "В момента ме няма"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Назад"
@@ -6451,7 +6451,7 @@ msgstr "Тук не можеш да качваш файлове"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Въгленова тема"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Таймер за обратно броене"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Държава"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Имейлът не е наличен"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Актуализирането на имейла е недостъпно в момента. Опитай отново по-късно или се свържи с поддръжката."
@@ -13999,7 +13999,7 @@ msgstr "Въведи валиден URL адрес или код на шабло
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Въведи валиден имейл адрес."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Въведи валиден линк към съобщение."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Въведи валиден мобилен телефонен номер."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Въведи валиден телефонен номер"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Въведи {digitCount}-цифрения код, изпратен на {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Въведи {MFA_CODE_DIGIT_COUNT}-цифрения код, изпратен на {0}."
@@ -16137,7 +16137,7 @@ msgstr "Вземи {premiumProductName}, за да персонализираш
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Получаване на нов код"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Отвори браузъра си, влез в акаунта си, след което въведи кода по-долу, за да свържеш акаунта си."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Отвори съобщенията си"
@@ -24047,12 +24047,12 @@ msgstr "Отвори съобщенията си"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Отвори старото си приложение {PRODUCT_NAME} и избери „Свържи ново устройство“, след което въведи кода по-долу."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Отвори приложението за съобщения на телефона си и създай ново текстово съобщение."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Отвори приложението за съобщения на телефона си и започни ново текстово съобщение."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Проверката ни на телефонни номера в момента не работи. Вината е наша, а не на твоя номер. Изчакай няколко минути и опитай отново със същия номер."
@@ -24810,21 +24810,21 @@ msgstr "Телефон"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Телефонен номер"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Изисква се телефонен номер"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Телефонният номер е потвърден"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Стъпка „Телефон“"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Потвърждаването по телефон не е налично за този акаунт. Използвай друг метод или се свържи с поддръжката."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Повторни публикации: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Първо заяви нов код."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Търсене на общности"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Търсене на държави..."
@@ -29559,17 +29559,17 @@ msgstr "Изпращай съобщения с текст към говор чр
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Изпрати кода <0>{0}</0> на <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Изпрати кода на телефонния номер по-долу."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Изпрати този код"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Да върнем ли това закачено съобщение назад във времето?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Изпращане до"
@@ -29606,16 +29606,11 @@ msgstr "Изпращане на гласово съобщение"
msgid "Send:"
msgstr "Изпращане:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Изпращането на SMS до този номер е скъпо, затова вместо това ти трябва да ни изпратиш съобщение."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Изпращането на SMS до този телефонен номер е твърде скъпо за {PRODUCT_NAME}, затова вместо това ти трябва да ни изпратиш SMS. Знаем, че това не е идеално. Можеш също да помолиш администраторите на тази инстанция да премахнат това изискване от акаунта ти."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Изпращането на SMS до този телефонен номер е твърде скъпо за {PRODUCT_NAME}, затова вместо това ти трябва да ни изпратиш SMS. Знаем, че това не е идеално. Можеш също да се свържеш с <0>{SUPPORT_EMAIL}</0>, за да премахнем това изискване от акаунта ти."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "По-плавно видео"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Потвърждението по SMS не е достъпно в момента. Опитай отново по-късно или се свържи с поддръжката."
@@ -31397,7 +31392,7 @@ msgstr "Нещо се обърка. Опитай отново по-късно."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Нещо се обърка. Опитай отново."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Контроли за персонала"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Възможно е да се прилагат стандартни такси за съобщения от твоя оператор."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Благодарим ти, че помагаш за безопасността на {productName}. Ще прегледаме сигнала ти възможно най-скоро."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Този код не проработи. Провери го и опитай отново."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Този код е изтекъл. Заяви нов код."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Това не изглежда като валиден URL адрес."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Този имейл вече се използва."
@@ -34118,8 +34113,8 @@ msgstr "Това е последният ти ключ за достъп, а к
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Това е последният ти ключ за достъп. След като го изтриеш, няма да можеш да използваш ключ за достъп като втори фактор."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Това не е мобилен номер и не може да получава нашите SMS съобщения. Опитай с мобилен номер или се свържи с поддръжката, ако смяташ, че това е грешка."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Този прякор ще се вижда само в тази общност"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Този номер се потвърждава, като ни изпратиш SMS. Върни се и започни потвърждението на телефона отново, за да получиш кода и номера, на който да пишеш."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Този номер изисква потвърждение чрез SMS от теб, а не SMS от нас."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Звукът на този участник е изключен от модератори"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Този телефонен номер не може да бъде използван. Опитай друг мобилен номер или се свържи с поддръжката."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Този телефонен номер вече е използван. Опитай друг номер или се свържи с поддръжката."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Сесията за потвърждение изтече. Върни се в {productName} и започни плащането отново."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Тази сесия за потвърждение изтече. Започни отначало."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Това ще направи всички външни линкове доверени и ще пропуска предупреждението за всеки домейн. Съществуващите ти доверени домейни ще бъдат заменени. Това е по-малко сигурно."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Този прозорец се актуализира автоматично, след като получим съобщението ти."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Преобразуване на HDR изображения в стандартен диапазон, намалявайки пиковата яркост."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Твърде много опити. Изчакай малко и опитай отново."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Използвай имейл, до който имаш достъп. Ще изпратим код на него."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Използвай имейл, различен от текущия."
@@ -37318,17 +37313,17 @@ msgstr "Потвърди самоличността си"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Потвърди телефона"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Потвърди телефонния номер"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Формуляр за потвърждаване на телефонен номер"
@@ -38192,7 +38187,7 @@ msgstr "Увеличаване на звука"
msgid "Wait a moment before deleting more messages."
msgstr "Изчакай малко, преди да изтриеш още съобщения."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Изчакай малко. Този прозорец ще се затвори автоматично, щом получим съобщението ти."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Изчакване между съобщенията. Членовете с „{bypassSlowmodePermissionLabel}“ могат да го заобиколят."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Изчакай тук"
@@ -38368,13 +38363,13 @@ msgstr "Не успяхме да прочетем тази тема. Може д
msgid "We couldn't remove that account. Try again."
msgstr "Не успяхме да премахнем този акаунт. Опитай отново."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Не успяхме да потвърдим този номер автоматично. Свържи се с поддръжката и човек ще прегледа акаунта ти."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Не изпращаме текстови съобщения за потвърждение до тази държава. Опитай с мобилен номер от друга държава или се свържи с поддръжката."
@@ -38469,9 +38464,9 @@ msgstr "Ще изпратим код за потвърждение на имей
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Ще изпратим код за потвърждение на имейла ти, преди да можеш да видиш кодовете си за възстановяване."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Ще изпратим SMS код, когато е наличен. Номерът ти не е свързан с акаунта ти. Запазваме само криптиран маркер, без ID на потребител, за да позволим най-много {PHONE_VERIFICATION_LIMIT} потвърждения за около {PHONE_VERIFICATION_WINDOW_DAYS} дни."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Ще изпратим SMS код, когато е наличен. Вашият номер не е свързан с акаунта ви. Съхраняваме само криптиран маркер, без потребителско ID, за ограничено време."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Сесията ти в {productName} изтече. Влез отново
msgid "Your account"
msgstr "Твоят акаунт"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Акаунтът ти веднага заработва нормално и сега няма да ти трябва телефонен номер. Това не е постоянно освобождаване. Присъединяването към голяма или публична общност може да върне тази проверка."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Профилът ви ще се върне към нормалното веднага и няма да ви е необходим телефонен номер сега. Това не е постоянно освобождаване и може да поискаме тази проверка отново по-късно."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Картата ти отговаря на условията. Пренасочваме те към страницата за плащане."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Мобилният ти оператор съобщава, че този номер не е активен. Провери го и опитай отново или се свържи с поддръжката, ако е правилен."
@@ -40216,10 +40211,10 @@ msgstr "новият ти имейл"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Новият ти прякор или остави празно, за да го нулираш."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Номерът ти не е свързан с акаунта ти. Пазим само криптиран маркер, без ID на потребител, за най-много {limit} проверки в рамките на около {duration} дни."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Номерът ви не е свързан с акаунта ви. Съхраняваме само криптиран маркер без потребителски ID за ограничено време."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/cs/messages.po b/fluxer_app/src/features/i18n/locales/cs/messages.po
index 52b579642..18e56d189 100644
--- a/fluxer_app/src/features/i18n/locales/cs/messages.po
+++ b/fluxer_app/src/features/i18n/locales/cs/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dní"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Před ověřením telefonu je vyžadována kontrola prohlížeče. Zkuste to znovu z přihlašovací stránky nebo kontaktujte podporu."
@@ -5240,8 +5240,8 @@ msgstr "Momentálně pryč"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Zpět"
@@ -6451,7 +6451,7 @@ msgstr "Sem nelze nahrávat soubory"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Uhelný motiv"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Odpočítávání"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Země"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mail není k dispozici"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Aktualizace e-mailu momentálně není k dispozici. Zkuste to prosím později nebo kontaktujte podporu."
@@ -13999,7 +13999,7 @@ msgstr "Zadejte platnou URL nebo kód šablony platformy {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Zadejte platnou e-mailovou adresu."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Zadejte platný odkaz na zprávu."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Zadejte platné číslo mobilního telefonu."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Zadejte platné telefonní číslo"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Zadejte {digitCount}místný kód odeslaný na číslo {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Zadejte {MFA_CODE_DIGIT_COUNT}místný kód odeslaný na {0}."
@@ -16137,7 +16137,7 @@ msgstr "Pořiďte si {premiumProductName} a přizpůsobte si čtyřmístný iden
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Získat nový kód"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Otevřete prohlížeč, přihlaste se a poté zadejte níže uvedený kód pro propojení účtu."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Otevřete si zprávy"
@@ -24047,12 +24047,12 @@ msgstr "Otevřete si zprávy"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Otevřete svou starou aplikaci {PRODUCT_NAME} a vyberte „Propojit nové zařízení“, poté zadejte níže uvedený kód."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Otevřete v telefonu aplikaci pro zprávy a vytvořte novou SMS."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Otevřete v telefonu aplikaci pro zprávy a začněte psát novou SMS."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Naše služba ověřování telefonních čísel má teď výpadek. Problém je u nás, nikoli ve vašem čísle. Počkejte pár minut a zkuste stejné číslo znovu."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefonní číslo"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Je vyžadováno telefonní číslo"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefonní číslo ověřeno"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Krok ověření telefonu"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Ověření telefonního čísla není pro tento účet k dispozici. Použijte jinou metodu nebo kontaktujte podporu."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Znovuzveřejnění: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Nejprve si vyžádejte nový kód."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Hledat komunity"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Hledat země..."
@@ -29559,17 +29559,17 @@ msgstr "Odesílat zprávy s převodem textu na řeč pomocí /tts. Členům, kte
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Odeslat kód <0>{0}</0> na <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Pošlete kód na níže uvedené telefonní číslo."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Odeslat tento kód"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Poslat tento připnutý příspěvek zpět v čase?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Odeslat na"
@@ -29606,16 +29606,11 @@ msgstr "Odeslat hlasovou zprávu"
msgid "Send:"
msgstr "Odesílání:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Odeslání SMS na toto číslo je drahé, proto nám místo toho musíte poslat zprávu."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Odesílání SMS na toto telefonní číslo je pro {PRODUCT_NAME} příliš drahé, takže nám ji musíte poslat vy. Víme, že to není ideální. Můžete také požádat správce této instance o zrušení tohoto požadavku pro váš účet."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Odesílání SMS na toto telefonní číslo je pro {PRODUCT_NAME} příliš drahé, takže nám ji musíte poslat vy. Víme, že to není ideální. Můžete také kontaktovat <0>{SUPPORT_EMAIL}</0> a požádat o zrušení tohoto požadavku pro váš účet."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Plynulejší video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Ověření SMS zprávou momentálně není k dispozici. Zkuste to prosím později, nebo kontaktujte podporu."
@@ -31397,7 +31392,7 @@ msgstr "Něco se pokazilo. Zkuste to prosím později."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Něco se pokazilo. Zkuste to znovu."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Ovládací prvky pro zaměstnance"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Mohou být účtovány standardní poplatky za zprávy od vašeho operátora."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Děkujeme, že pomáháte udržovat {productName} v bezpečí. Vaše nahlášení posoudíme co nejdříve."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Tento kód nefungoval. Zkontrolujte ho a zkuste to znovu."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Platnost kódu vypršela. Vyžádejte si nový kód."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Nevypadá to jako platná adresa URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Tento e-mail se již používá."
@@ -34118,8 +34113,8 @@ msgstr "Toto je váš poslední přístupový klíč a přístupové klíče jso
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Toto je váš poslední přístupový klíč. Jakmile o něj přijdete, nebudete moci používat přístupový klíč jako druhý faktor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Toto není mobilní číslo, takže nemůže přijímat naše SMS. Zkuste mobilní číslo nebo kontaktujte podporu, pokud si myslíte, že je to chyba."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Tato přezdívka bude viditelná pouze v této komunitě"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Toto číslo se ověřuje tak, že nám sami pošlete SMS. Vraťte se a znovu spusťte ověření telefonu, abyste získali kód a číslo, na které ho poslat."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Toto číslo vyžaduje ověření odesláním SMS nám místo přijetí SMS od nás."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Moderátoři tomuto účastníkovi vypnuli zvuk"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Toto telefonní číslo nelze použít. Zkuste jiné mobilní číslo nebo kontaktujte podporu."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Toto telefonní číslo již bylo použito. Zkuste jiné číslo nebo kontaktujte podporu."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Platnost ověřovací relace vypršela. Vraťte se do aplikace {productName} a spusťte platbu znovu."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Ověřovací relace vypršela. Začněte znovu."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Tímto se budou důvěryhodně otevírat všechny externí odkazy a přeskočí se upozornění pro každou doménu. Vaše stávající důvěryhodné domény budou nahrazeny. Toto je méně bezpečné."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Toto okno se automaticky aktualizuje, jakmile obdržíme vaši zprávu."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Převést HDR snímky do standardního rozsahu, čímž se sníží maximální jas."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Příliš mnoho pokusů. Chvíli počkejte a zkuste to znovu."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Použijte e-mailovou adresu, ke které máte přístup. Pošleme vám na ni kód."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Použijte e-mail, který se liší od vašeho současného."
@@ -37318,17 +37313,17 @@ msgstr "Ověřte, že jste to vy"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Ověřit telefon"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Ověřit telefonní číslo"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulář pro ověření telefonního čísla"
@@ -38192,7 +38187,7 @@ msgstr "Zvýšit hlasitost"
msgid "Wait a moment before deleting more messages."
msgstr "Před smazáním dalších zpráv chvíli počkejte."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Moment. Toto okno se automaticky zavře, jakmile obdržíme vaši zprávu."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Doba čekání mezi zprávami. Členové s oprávněním „{bypassSlowmodePermissionLabel}“ nemusí čekat."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Počkejte zde"
@@ -38368,13 +38363,13 @@ msgstr "Tento motiv se nepodařilo načíst. Může být poškozený nebo neplat
msgid "We couldn't remove that account. Try again."
msgstr "Tento účet se nám nepodařilo odebrat. Zkuste to znovu."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Toto telefonní číslo se nepodařilo automaticky ověřit. Kontaktujte podporu a váš účet posoudí její pracovník."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Do této země neposíláme ověřovací SMS. Zkuste mobilní číslo z jiné země nebo kontaktujte podporu."
@@ -38469,9 +38464,9 @@ msgstr "Než si budete moct změnit heslo, pošleme vám na e-mail ověřovací
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Před zobrazením záložních kódů vám na e-mail pošleme ověřovací kód."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Až to bude možné, pošleme vám SMS kód. Vaše číslo není propojeno s vaším účtem. Uchováváme pouze zašifrovanou značku bez ID uživatele, abychom umožnili maximálně {PHONE_VERIFICATION_LIMIT} ověření přibližně za {PHONE_VERIFICATION_WINDOW_DAYS} dní."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Pošleme SMS kód, jakmile bude dostupný. Vaše číslo nebude propojeno s vaším účtem. Uchováváme pouze šifrovaný identifikátor bez ID uživatele po omezenou dobu."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Vaše relace {productName} vypršela. Přihlaste se znovu a pokračujte
msgid "Your account"
msgstr "Váš účet"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Váš účet se okamžitě vrátí do normálu a telefonní číslo nyní nebudete potřebovat. Toto není trvalá výjimka. Připojení k velké nebo veřejné komunitě může tuto kontrolu znovu vyvolat."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Váš účet se okamžitě vrátí do normálu a telefonní číslo nyní nebudete potřebovat. Toto není trvalá výjimka a můžeme o tuto kontrolu požádat později."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Vaše karta je způsobilá. Nyní vás přesměrujeme na platební stránku."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Váš operátor uvádí, že toto číslo není v provozu. Zkontrolujte ho a zkuste to znovu. Pokud je správné, kontaktujte podporu."
@@ -40216,10 +40211,10 @@ msgstr "váš nový e-mail"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Vaše nová přezdívka. Chcete-li ji zrušit, nechte pole prázdné."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Vaše číslo není propojeno s vaším účtem. Uchováváme pouze zašifrovanou značku bez ID uživatele, a to maximálně pro {limit} ověření přibližně za {duration} dní."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Vaše číslo není propojeno s vaším účtem. Uchováváme pouze šifrovaný identifikátor bez ID uživatele po omezenou dobu."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/da/messages.po b/fluxer_app/src/features/i18n/locales/da/messages.po
index 6cedfd2f0..3cb48ce8d 100644
--- a/fluxer_app/src/features/i18n/locales/da/messages.po
+++ b/fluxer_app/src/features/i18n/locales/da/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dage"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Der kræves et browsertjek, før telefonbekræftelse kan udføres. Prøv igen fra loginskærmen, eller kontakt support."
@@ -5240,8 +5240,8 @@ msgstr "Ikke til stede lige nu"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Tilbage"
@@ -6451,7 +6451,7 @@ msgstr "Kan ikke uploade filer her"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Kulsort tema"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Nedtællingstimer"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Land"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mailadresse utilgængelig"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "E-mailadressen kan ikke ændres lige nu. Prøv igen senere, eller kontakt support."
@@ -13999,7 +13999,7 @@ msgstr "Indtast en gyldig skabelon-URL eller kode fra {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Indtast en gyldig e-mailadresse."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Angiv et gyldigt beskedslink."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Indtast et gyldigt mobilnummer."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Indtast et gyldigt telefonnummer"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Indtast den {digitCount}-cifrede kode, der er sendt til {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Indtast den {MFA_CODE_DIGIT_COUNT}-cifrede kode, der er sendt til {0}."
@@ -16137,7 +16137,7 @@ msgstr "Få {premiumProductName} for at tilpasse dit tag eller beholde det, når
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Få ny kode"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Åbn din browser, log ind, og indtast derefter koden herunder for at forbinde din konto."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Åbn dine beskeder"
@@ -24047,12 +24047,12 @@ msgstr "Åbn dine beskeder"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Åbn din gamle {PRODUCT_NAME}-app, vælg \"Tilknyt en ny enhed\", og indtast derefter koden nedenfor."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Åbn din telefons beskedapp, og opret en ny sms."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Åbn din telefons beskedapp, og start en ny sms."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Vores kontrol af telefonnumre er nede lige nu. Fejlen er hos os og skyldes ikke dit nummer. Vent et par minutter, og prøv det samme nummer igen."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefonnummer"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Telefonnummer er påkrævet"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefonnummer bekræftet"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Trin til telefonbekræftelse"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Telefonbekræftelse er ikke tilgængelig for denne konto. Brug en anden metode, eller kontakt support."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Genopslag: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Anmod først om en ny kode."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Søg i fællesskaber"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Søg lande..."
@@ -29559,17 +29559,17 @@ msgstr "Send tekst-til-tale-beskeder med /tts. Medlemmer, der har slået tekst t
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Send koden <0>{0}</0> til <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Send koden til telefonnummeret herunder."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Send denne kode"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Send denne fastgjorte besked tilbage i tiden?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Send til"
@@ -29606,16 +29606,11 @@ msgstr "Send talebesked"
msgid "Send:"
msgstr "Send:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Det er dyrt at sende en sms til dette nummer, så vi har brug for, at du sender os en sms i stedet."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Det er for dyrt for {PRODUCT_NAME} at sende en SMS til dette telefonnummer, så vi har brug for, at du sender os en SMS i stedet. Vi ved, at det ikke er ideelt. Du kan også bede administratorerne af denne instans om at fjerne dette krav fra din konto."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Det er for dyrt for {PRODUCT_NAME} at sende en SMS til dette telefonnummer, så vi har brug for, at du sender os en SMS i stedet. Vi ved, at det ikke er ideelt. Du kan også kontakte <0>{SUPPORT_EMAIL}</0> for at få os til at fjerne dette krav fra din konto."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Mere flydende video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "SMS-bekræftelse er ikke tilgængelig lige nu. Prøv igen senere, eller kontakt support."
@@ -31397,7 +31392,7 @@ msgstr "Der opstod en fejl. Prøv igen senere."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Der opstod en fejl. Prøv igen."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Medarbejderfunktioner"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Standardtakster for beskeder fra din udbyder kan være gældende."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Tak, fordi du hjælper med at holde {productName} sikkert. Vi gennemgår din anmeldelse hurtigst muligt."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Koden virkede ikke. Tjek den, og prøv igen."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Koden er udløbet. Anmod om en ny kode."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Det ligner ikke en gyldig URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Den e-mail er allerede i brug."
@@ -34118,8 +34113,8 @@ msgstr "Dette er din sidste adgangsnøgle, og adgangsnøgler er din anden faktor
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Dette er din sidste adgangsnøgle. Når den er væk, kan du ikke længere bruge en adgangsnøgle som din anden faktor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Dette er ikke et mobilnummer, så det kan ikke modtage vores SMS'er. Prøv et mobilnummer, eller kontakt support, hvis du mener, at det er forkert."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Dette kaldenavn vil kun være synligt i dette fællesskab"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "For at bekræfte dette nummer skal du i stedet sende os en sms. Gå tilbage og start telefonbekræftelsen igen for at få koden og det nummer, du skal sende den til."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Dette nummer skal bekræftes ved, at du sender os en sms, frem for at modtage en fra os."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Denne deltager kan ikke høre opkaldet, fordi moderatorerne har slået lyden fra"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Dette telefonnummer kan ikke bruges. Prøv et andet mobilnummer, eller kontakt support."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Dette telefonnummer er allerede blevet brugt. Prøv et andet nummer, eller kontakt support."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Denne bekræftelsessession er udløbet. Vend tilbage til {productName}, og start betalingen igen."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Denne bekræftelsessession er udløbet. Start forfra."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Dette markerer alle eksterne links som betroede og springer advarslen over for alle domæner. Dine eksisterende betroede domæner erstattes. Dette er mindre sikkert."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Dette vindue opdateres automatisk, når vi har modtaget din besked."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Tone-map HDR-billeder til standardområde, hvilket reducerer den maksimale lysstyrke."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "For mange forsøg. Vent lidt, og prøv så igen."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Brug en e-mailadresse, du har adgang til. Vi sender en kode dertil."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Brug en anden e-mailadresse end din nuværende."
@@ -37318,17 +37313,17 @@ msgstr "Bekræft, at det er dig"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Bekræft telefonnummer"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Bekræft telefonnummer"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formular til bekræftelse af telefonnummer"
@@ -38192,7 +38187,7 @@ msgstr "Skru op"
msgid "Wait a moment before deleting more messages."
msgstr "Vent et øjeblik, før du sletter flere beskeder."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Vent et øjeblik. Dette vindue lukkes automatisk, når vi modtager din besked."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Ventetid mellem beskeder. Medlemmer med tilladelsen \"{bypassSlowmodePermissionLabel}\" kan omgå den."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Vent her"
@@ -38368,13 +38363,13 @@ msgstr "Vi kunne ikke læse dette tema. Det er muligvis beskadiget eller ugyldig
msgid "We couldn't remove that account. Try again."
msgstr "Vi kunne ikke fjerne den konto. Prøv igen."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Vi kunne ikke bekræfte dette nummer automatisk. Kontakt support, så vil en person gennemgå din konto."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Vi sender ikke sms'er med bekræftelseskoder til dette land. Prøv et mobilnummer fra et andet land, eller kontakt support."
@@ -38469,9 +38464,9 @@ msgstr "Vi sender en bekræftelseskode til din e-mail, før du kan ændre din ad
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Vi sender en bekræftelseskode til din e-mail, før du kan se dine backupkoder."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Vi sender en SMS-kode, når det er muligt. Dit nummer er ikke knyttet til din konto. Vi gemmer kun en krypteret markør uden bruger-ID for at tillade højst {PHONE_VERIFICATION_LIMIT} bekræftelser inden for ca. {PHONE_VERIFICATION_WINDOW_DAYS} dage."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Vi sender en SMS-kode, når den er tilgængelig. Dit nummer er ikke knyttet til din konto. Vi gemmer kun en krypteret markør, uden bruger-ID, i en begrænset periode."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Din {productName}-session er udløbet. Log ind igen for at fortsætte me
msgid "Your account"
msgstr "Din konto"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Din konto fungerer normalt igen med det samme, og du behøver ikke et telefonnummer nu. Dette er ikke en permanent undtagelse. Hvis du tilmelder dig et stort eller offentligt fællesskab, kan denne kontrol blive nødvendig igen."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Din konto vender tilbage til normal med det samme, og du behøver ikke et telefonnummer nu. Dette er ikke en permanent undtagelse, og vi kan bede om denne kontrol igen senere."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Dit kort opfylder kravene. Du bliver nu omdirigeret til betalingssiden."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Din teleudbyder siger, at nummeret ikke er i brug. Tjek det, og prøv igen, eller kontakt support, hvis det er korrekt."
@@ -40216,10 +40211,10 @@ msgstr "din nye e-mail"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Dit nye kaldenavn, eller lad stå tomt for at nulstille det."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Dit nummer er ikke knyttet til din konto. Vi gemmer kun en krypteret markør uden bruger-ID for at tillade højst {limit} bekræftelser inden for ca. {duration} dage."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Dit nummer er ikke knyttet til din konto. Vi gemmer kun en krypteret markør, uden bruger-id, i en begrænset periode."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/de/messages.po b/fluxer_app/src/features/i18n/locales/de/messages.po
index 4d4170c4e..d8eb0ab94 100644
--- a/fluxer_app/src/features/i18n/locales/de/messages.po
+++ b/fluxer_app/src/features/i18n/locales/de/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 Tage"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Bevor du deine Telefonnummer verifizieren kannst, ist eine Browserprüfung erforderlich. Versuche es noch einmal über die Anmeldeseite oder kontaktiere den Support."
@@ -5240,8 +5240,8 @@ msgstr "Gerade abwesend"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Zurück"
@@ -6451,7 +6451,7 @@ msgstr "Dateien können hier nicht hochgeladen werden"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Kohle-Design"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Countdown-Timer"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Land"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-Mail nicht verfügbar"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "E-Mail-Aktualisierung ist zurzeit nicht verfügbar. Versuche es später erneut oder kontaktiere den Support."
@@ -13999,7 +13999,7 @@ msgstr "Gib eine gültige Vorlagen-URL oder einen gültigen Vorlagencode von {th
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Gib eine gültige E-Mail-Adresse ein."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Gib einen gültigen Nachrichtenlink ein."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Gib eine gültige Mobiltelefonnummer ein."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Gib eine gültige Telefonnummer ein"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Gib den {digitCount}-stelligen Code ein, der an {phoneNumber} gesendet wurde."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Gib den Code mit {MFA_CODE_DIGIT_COUNT} Ziffern ein, der an {0} gesendet wurde."
@@ -16137,7 +16137,7 @@ msgstr "Hol dir {premiumProductName}, um deinen Tag anzupassen oder ihn zu behal
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Neuen Code anfordern"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Öffne deinen Browser, melde dich an und gib dann den folgenden Code ein, um deinen Account zu verknüpfen."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Öffne deine Nachrichten"
@@ -24047,12 +24047,12 @@ msgstr "Öffne deine Nachrichten"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Öffne deine alte {PRODUCT_NAME}-App, wähle „Neues Gerät verknüpfen“ und gib dann den folgenden Code ein."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Öffne die Nachrichten-App deines Smartphones und erstelle eine neue SMS."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Öffne die Nachrichten-App deines Smartphones und beginne eine neue SMS."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Unsere Telefonnummernprüfung ist gerade ausgefallen. Das Problem liegt bei uns, nicht bei deiner Nummer. Warte ein paar Minuten und versuche es erneut mit derselben Nummer."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefonnummer"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Telefonnummer ist erforderlich"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefonnummer verifiziert"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Telefonschritt"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Telefonverifizierung ist für diesen Account nicht verfügbar. Verwende eine andere Methode oder kontaktiere den Support."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Reposts: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Fordere zuerst einen neuen Code an."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Communitys suchen"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Länder suchen …"
@@ -29559,17 +29559,17 @@ msgstr "Sende Text-to-Speech-Nachrichten mit /tts. Mitglieder, die Text-to-Speec
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Sende den Code <0>{0}</0> an <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Sende den Code an die unten stehende Telefonnummer."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Diesen Code senden"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Diesen Pin in die Vergangenheit schicken?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Senden an"
@@ -29606,16 +29606,11 @@ msgstr "Sprachnachricht senden"
msgid "Send:"
msgstr "Senden:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Das Senden einer SMS an diese Nummer ist teuer, daher bitten wir dich, uns stattdessen eine SMS zu schicken."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Das Senden einer SMS an diese Telefonnummer ist für {PRODUCT_NAME} zu teuer, daher bitten wir dich, uns stattdessen eine SMS zu senden. Wir wissen, dass dies nicht ideal ist. Du kannst auch die Administratoren dieser Instanz bitten, diese Anforderung für deinen Account aufzuheben."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Das Senden einer SMS an diese Telefonnummer ist für {PRODUCT_NAME} zu teuer, daher bitten wir dich, uns stattdessen eine SMS zu senden. Wir wissen, dass dies nicht ideal ist. Du kannst auch <0>{SUPPORT_EMAIL}</0> kontaktieren, damit wir diese Anforderung für deinen Account aufheben."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Flüssigeres Video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Die SMS-Verifizierung ist derzeit nicht verfügbar. Versuche es später erneut oder kontaktiere den Support."
@@ -31397,7 +31392,7 @@ msgstr "Es ist ein Fehler aufgetreten. Bitte versuche es später erneut."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Es ist ein Fehler aufgetreten. Bitte versuche es erneut."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Mitarbeiter-Steuerung"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Es können die üblichen Nachrichtentarife deines Mobilfunkanbieters anfallen."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Danke, dass du dabei hilfst, {productName} sicher zu halten. Wir prüfen deine Meldung so schnell wie möglich."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Der Code hat nicht funktioniert. Bitte überprüfe ihn und versuche es erneut."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Dieser Code ist abgelaufen. Fordere einen neuen Code an."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Das sieht nicht nach einer gültigen URL aus."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Diese E-Mail-Adresse wird bereits verwendet."
@@ -34118,8 +34113,8 @@ msgstr "Dies ist dein letzter Passkey und Passkeys sind dein zweiter Faktor. Wen
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Dies ist dein letzter Passkey. Sobald er weg ist, kannst du keinen Passkey mehr als zweiten Faktor verwenden."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Dies ist keine Handynummer und kann daher keine SMS empfangen. Versuche es mit einer Handynummer oder kontaktiere den Support, falls du denkst, dass dies ein Fehler ist."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Dieser Spitzname ist nur in dieser Community sichtbar"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Um diese Nummer zu verifizieren, musst du uns stattdessen eine SMS senden. Gehe zurück und starte die Telefonverifizierung erneut, um den Code und die Empfängernummer zu erhalten."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Für diese Nummer musst du uns zur Verifizierung eine SMS senden, statt eine von uns zu empfangen."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Der Ton dieses Teilnehmers wurde von Moderatoren ausgeschaltet"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Diese Telefonnummer kann nicht verwendet werden. Versuche es mit einer anderen Mobilnummer oder kontaktiere den Support."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Diese Telefonnummer wurde bereits verwendet. Versuche es mit einer anderen Nummer oder kontaktiere den Support."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Diese Verifizierungssitzung ist abgelaufen. Kehre zu {productName} zurück und starte den Bezahlvorgang erneut."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Diese Verifizierungssitzung ist abgelaufen. Bitte starte den Vorgang erneut."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Dadurch werden alle externen Links als vertrauenswürdig eingestuft und die Warnung für jede Domain übersprungen. Deine bestehenden vertrauenswürdigen Domains werden ersetzt. Dies ist weniger sicher."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Dieses Fenster wird automatisch aktualisiert, sobald wir deine Nachricht erhalten haben."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "HDR-Bilder auf den Standardbereich tonemappen, wodurch die Spitzenhelligkeit reduziert wird."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Zu viele Versuche. Warte einen Moment und versuche es dann erneut."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Verwende eine E-Mail-Adresse, auf die du Zugriff hast. Wir senden einen Code dorthin."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Verwende eine andere E-Mail-Adresse als deine aktuelle."
@@ -37318,17 +37313,17 @@ msgstr "Verifiziere deine Identität"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Telefonnummer verifizieren"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Telefonnummer verifizieren"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formular zur Verifizierung der Telefonnummer"
@@ -38192,7 +38187,7 @@ msgstr "Lauter"
msgid "Wait a moment before deleting more messages."
msgstr "Warte einen Moment, bevor du weitere Nachrichten löschst."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Bitte warte einen Moment. Dieses Fenster schließt sich automatisch, sobald wir deine Nachricht erhalten."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Wartezeit zwischen Nachrichten. Mitglieder mit der Berechtigung „{bypassSlowmodePermissionLabel}“ können sie umgehen."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Hier warten"
@@ -38368,13 +38363,13 @@ msgstr "Dieses Design konnte nicht gelesen werden. Es ist möglicherweise besch
msgid "We couldn't remove that account. Try again."
msgstr "Dieser Account konnte nicht entfernt werden. Bitte versuche es erneut."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Wir konnten diese Nummer nicht automatisch verifizieren. Kontaktiere den Support, damit jemand aus unserem Team deinen Account überprüfen kann."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Wir senden keine Verifizierungs-SMS in dieses Land. Versuche es mit einer Mobilnummer aus einem anderen Land oder kontaktiere den Support."
@@ -38469,9 +38464,9 @@ msgstr "Wir senden einen Bestätigungscode an deine E-Mail-Adresse, bevor du dei
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Wir senden dir einen Verifizierungscode an deine E-Mail, bevor du deine Backup-Codes anzeigen kannst."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Wir senden dir einen SMS-Code, sofern der SMS-Versand verfügbar ist. Deine Nummer ist nicht mit deinem Account verknüpft. Wir speichern nur eine verschlüsselte Markierung ohne Nutzer-ID, um höchstens {PHONE_VERIFICATION_LIMIT} Verifizierungen in etwa {PHONE_VERIFICATION_WINDOW_DAYS} Tagen zu erlauben."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Wir senden einen SMS-Code, sobald einer verfügbar ist. Deine Nummer wird nicht mit deinem Konto verknüpft. Wir speichern nur einen verschlüsselten Marker ohne Benutzer-ID für eine begrenzte Zeit."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Deine {productName}-Sitzung ist abgelaufen. Melde dich erneut an, um die
msgid "Your account"
msgstr "Dein Account"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Dein Account funktioniert sofort wieder normal und du benötigst jetzt keine Telefonnummer. Dies ist keine dauerhafte Ausnahme. Wenn du einer großen oder öffentlichen Community beitrittst, kann diese Prüfung erneut erforderlich werden."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Dein Konto ist sofort wieder normal und du brauchst jetzt keine Telefonnummer mehr. Dies ist keine dauerhafte Ausnahme, und wir können diese Überprüfung später erneut anfordern."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Deine Karte ist gültig. Du wirst jetzt zur Zahlungsseite weitergeleitet."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Dein Mobilfunkanbieter gibt an, dass diese Nummer nicht vergeben ist. Überprüfe sie und versuche es erneut, oder kontaktiere den Support, falls sie korrekt ist."
@@ -40216,10 +40211,10 @@ msgstr "deine neue E-Mail-Adresse"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Dein neuer Spitzname. Lass das Feld leer, um ihn zurückzusetzen."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Deine Telefonnummer ist nicht mit deinem Account verknüpft. Wir speichern nur eine verschlüsselte Markierung, ohne Benutzer-ID, für höchstens {limit} Verifizierungen in etwa {duration} Tagen."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Deine Nummer ist nicht mit deinem Konto verknüpft. Wir speichern nur einen verschlüsselten Marker ohne Benutzer-ID für eine begrenzte Zeit."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/el/messages.po b/fluxer_app/src/features/i18n/locales/el/messages.po
index 349fa96d8..8fe8750da 100644
--- a/fluxer_app/src/features/i18n/locales/el/messages.po
+++ b/fluxer_app/src/features/i18n/locales/el/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 ημέρες"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Απαιτείται έλεγχος προγράμματος περιήγησης πριν από την επαλήθευση τηλεφώνου. Δοκιμάστε ξανά από τη σελίδα σύνδεσης ή επικοινωνήστε με την υποστήριξη."
@@ -5240,8 +5240,8 @@ msgstr "Απών τώρα"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Πίσω"
@@ -6451,7 +6451,7 @@ msgstr "Δεν μπορείτε να ανεβάσετε αρχεία εδώ"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Θέμα Coal"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Χρονόμετρο αντίστροφης μέτρησης"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Χώρα"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Email μη διαθέσιμο"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Η ενημέρωση email δεν είναι διαθέσιμη αυτήν τη στιγμή. Δοκιμάστε ξανά αργότερα ή επικοινωνήστε με την υποστήριξη."
@@ -13999,7 +13999,7 @@ msgstr "Εισαγάγετε μια έγκυρη διεύθυνση URL ή κω
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Εισαγάγετε μια έγκυρη διεύθυνση email."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Εισαγάγετε έναν έγκυρο σύνδεσμο μηνύματος."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Εισαγάγετε έναν έγκυρο αριθμό κινητού τηλεφώνου."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Εισαγάγετε έναν έγκυρο αριθμό τηλεφώνου"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Εισαγάγετε τον κωδικό {digitCount} ψηφίων που στάλθηκε στο {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Εισάγετε τον κωδικό {MFA_CODE_DIGIT_COUNT} ψηφίων που στάλθηκε στο {0}."
@@ -16137,7 +16137,7 @@ msgstr "Αποκτήστε {premiumProductName} για να προσαρμόσε
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Λήψη νέου κωδικού"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Ανοίξτε το πρόγραμμα περιήγησής σας, συνδεθείτε και, στη συνέχεια, εισαγάγετε τον παρακάτω κωδικό για να συνδέσετε τον λογαριασμό σας."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Ανοίξτε τα μηνύματά σας"
@@ -24047,12 +24047,12 @@ msgstr "Ανοίξτε τα μηνύματά σας"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Ανοίξτε την παλιά σας εφαρμογή {PRODUCT_NAME}, επιλέξτε «Σύνδεση νέας συσκευής» και, στη συνέχεια, εισαγάγετε τον παρακάτω κωδικό."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Ανοίξτε την εφαρμογή μηνυμάτων του τηλεφώνου σας και δημιουργήστε ένα νέο μήνυμα κειμένου."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Ανοίξτε την εφαρμογή μηνυμάτων του τηλεφώνου σας και ξεκινήστε ένα νέο μήνυμα κειμένου."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Η υπηρεσία ελέγχου του αριθμού τηλεφώνου μας είναι προσωρινά εκτός λειτουργίας. Η ευθύνη είναι δική μας, όχι του αριθμού σας. Περιμένετε λίγα λεπτά και δοκιμάστε ξανά με τον ίδιο αριθμό."
@@ -24810,21 +24810,21 @@ msgstr "Τηλέφωνο"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Αριθμός τηλεφώνου"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Απαιτείται αριθμός τηλεφώνου"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Ο αριθμός τηλεφώνου επαληθεύτηκε"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Βήμα τηλεφώνου"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Η επαλήθευση τηλεφώνου δεν είναι διαθέσιμη για αυτόν τον λογαριασμό. Χρησιμοποιήστε άλλη μέθοδο ή επικοινωνήστε με την υποστήριξη."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Αναδημοσιεύσεις: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Ζητήστε πρώτα έναν νέο κωδικό."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Αναζήτηση κοινοτήτων"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Αναζήτηση χωρών..."
@@ -29559,17 +29559,17 @@ msgstr "Στείλτε μηνύματα κειμένου σε ομιλία με
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Στείλτε τον κωδικό <0>{0}</0> στο <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Στείλτε τον κωδικό στον παρακάτω αριθμό τηλεφώνου."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Στείλτε αυτόν τον κωδικό"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Να στείλετε αυτό το καρφιτσωμένο μήνυμα πίσω στον χρόνο;"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Αποστολή σε"
@@ -29606,16 +29606,11 @@ msgstr "Αποστολή φωνητικού μηνύματος"
msgid "Send:"
msgstr "Αποστολή:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Η αποστολή SMS σε αυτόν τον αριθμό είναι ακριβή, γι' αυτό πρέπει να μας στείλετε εσείς μήνυμα."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Η αποστολή SMS σε αυτόν τον αριθμό τηλεφώνου είναι πολύ ακριβή για το {PRODUCT_NAME}, οπότε πρέπει να μας στείλετε εσείς ένα SMS. Γνωρίζουμε ότι αυτό δεν είναι το ιδανικό. Μπορείτε επίσης να ζητήσετε από τους διαχειριστές αυτής της παρουσίας να καταργήσουν αυτήν την απαίτηση από τον λογαριασμό σας."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Η αποστολή SMS σε αυτόν τον αριθμό τηλεφώνου είναι πολύ ακριβή για το {PRODUCT_NAME}, οπότε πρέπει να μας στείλετε εσείς ένα SMS. Γνωρίζουμε ότι αυτό δεν είναι το ιδανικό. Μπορείτε επίσης να επικοινωνήσετε με το <0>{SUPPORT_EMAIL}</0> για να καταργήσουμε αυτήν την απαίτηση από τον λογαριασμό σας."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Ομαλότερο βίντεο"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Η επαλήθευση SMS δεν είναι διαθέσιμη αυτήν τη στιγμή. Δοκιμάστε ξανά αργότερα ή επικοινωνήστε με την υποστήριξη."
@@ -31397,7 +31392,7 @@ msgstr "Κάτι πήγε στραβά. Δοκιμάστε ξανά αργότε
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Κάτι πήγε στραβά. Δοκιμάστε ξανά."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Επιλογές προσωπικού"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Ενδέχεται να ισχύουν οι τυπικές χρεώσεις μηνυμάτων του παρόχου σας."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Σας ευχαριστούμε που συμβάλλετε στη διατήρηση της ασφάλειας του {productName}. Θα εξετάσουμε την αναφορά σας το συντομότερο δυνατό."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Αυτός ο κωδικός δεν λειτούργησε. Ελέγξτε τον και δοκιμάστε ξανά."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Αυτός ο κωδικός έληξε. Ζητήστε έναν νέο κωδικό."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Αυτό δεν μοιάζει με έγκυρη διεύθυνση URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Αυτό το email χρησιμοποιείται ήδη."
@@ -34118,8 +34113,8 @@ msgstr "Αυτό είναι το τελευταίο σας κλειδί πρόσ
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Αυτό είναι το τελευταίο σας κλειδί πρόσβασης. Μόλις διαγραφεί, δεν θα μπορείτε να χρησιμοποιήσετε κλειδί πρόσβασης ως δεύτερο παράγοντα."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Αυτός δεν είναι αριθμός κινητού, οπότε δεν μπορεί να λάβει τα μηνύματά μας. Δοκιμάστε έναν αριθμό κινητού ή επικοινωνήστε με την υποστήριξη αν πιστεύετε ότι αυτό είναι λάθος."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Αυτό το ψευδώνυμο θα είναι ορατό μόνο σε αυτήν την κοινότητα"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Αυτός ο αριθμός επαληθεύεται με μήνυμα που στέλνετε εσείς σε εμάς. Επιστρέψτε και ξεκινήστε ξανά την επαλήθευση τηλεφώνου για να λάβετε τον κωδικό και τον αριθμό στον οποίο θα στείλετε το μήνυμα."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Αυτός ο αριθμός χρειάζεται επαλήθευση με μήνυμα που στέλνετε εσείς, αντί για SMS από εμάς."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Αυτός ο συμμετέχων τέθηκε σε σίγαση ήχου από συντονιστές"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Αυτός ο αριθμός τηλεφώνου δεν μπορεί να χρησιμοποιηθεί. Δοκιμάστε έναν άλλο αριθμό κινητού ή επικοινωνήστε με την υποστήριξη."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Αυτός ο αριθμός τηλεφώνου έχει ήδη χρησιμοποιηθεί. Δοκιμάστε έναν άλλο αριθμό ή επικοινωνήστε με την υποστήριξη."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Αυτή η συνεδρία επαλήθευσης έληξε. Επιστρέψτε στο {productName} και ξεκινήστε ξανά την ολοκλήρωση αγοράς."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Αυτή η συνεδρία επαλήθευσης έληξε. Ξεκινήστε ξανά."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Έτσι θα εμπιστεύεστε όλους τους εξωτερικούς συνδέσμους και θα παραλείπετε την προειδοποίηση για κάθε τομέα. Οι υπάρχοντες αξιόπιστοι τομείς σας θα αντικατασταθούν. Αυτό είναι λιγότερο ασφαλές."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Αυτό το παράθυρο ενημερώνεται αυτόματα μόλις λάβουμε το μήνυμά σας."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Τονική προσαρμογή των εικόνων HDR στο τυπικό εύρος, με μείωση της μέγιστης φωτεινότητας."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Πάρα πολλές προσπάθειες. Περιμένετε λίγο και δοκιμάστε ξανά."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Χρησιμοποιήστε ένα email στο οποίο έχετε πρόσβαση. Θα στείλουμε έναν κωδικό εκεί."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Χρησιμοποιήστε ένα email διαφορετικό από το τρέχον."
@@ -37318,17 +37313,17 @@ msgstr "Επιβεβαιώστε την ταυτότητά σας"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Επαλήθευση τηλεφώνου"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Επαλήθευση αριθμού τηλεφώνου"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Φόρμα επαλήθευσης αριθμού τηλεφώνου"
@@ -38192,7 +38187,7 @@ msgstr "Αύξηση έντασης"
msgid "Wait a moment before deleting more messages."
msgstr "Περίμενε λίγο πριν διαγράψεις κι άλλα μηνύματα."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Περιμένετε λίγο. Αυτό το παράθυρο θα κλείσει αυτόματα μόλις λάβουμε το μήνυμά σας."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Χρονικό διάστημα μεταξύ των μηνυμάτων. Τα μέλη με το δικαίωμα \"{bypassSlowmodePermissionLabel}\" μπορούν να το παρακάμψουν."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Περιμένετε εδώ"
@@ -38368,13 +38363,13 @@ msgstr "Δεν μπορέσαμε να διαβάσουμε αυτό το θέμ
msgid "We couldn't remove that account. Try again."
msgstr "Δεν ήταν δυνατή η κατάργηση αυτού του λογαριασμού. Δοκιμάστε ξανά."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Δεν μπορέσαμε να επαληθεύσουμε αυτόν τον αριθμό αυτόματα. Επικοινωνήστε με την υποστήριξη και ένα άτομο θα ελέγξει τον λογαριασμό σας."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Δεν στέλνουμε μηνύματα επαλήθευσης σε αυτήν τη χώρα. Δοκιμάστε έναν αριθμό κινητού από άλλη χώρα ή επικοινωνήστε με την υποστήριξη."
@@ -38469,9 +38464,9 @@ msgstr "Θα στείλουμε έναν κωδικό επαλήθευσης σ
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Θα στείλουμε έναν κωδικό επαλήθευσης στο email σας πριν μπορέσετε να δείτε τους εφεδρικούς κωδικούς σας."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Θα στείλουμε έναν κωδικό SMS όταν είναι διαθέσιμος. Ο αριθμός σας δεν είναι συνδεδεμένος με τον λογαριασμό σας. Διατηρούμε μόνο έναν κρυπτογραφημένο δείκτη, χωρίς αναγνωριστικό χρήστη, για να επιτρέψουμε έως {PHONE_VERIFICATION_LIMIT} επαληθεύσεις σε περίπου {PHONE_VERIFICATION_WINDOW_DAYS} ημέρες."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Θα στείλουμε έναν κωδικό SMS όταν είναι διαθέσιμος. Ο αριθμός σας δεν συνδέεται με τον λογαριασμό σας. Διατηρούμε μόνο έναν κρυπτογραφημένο δείκτη, χωρίς αναγνωριστικό χρήστη, για περιορισμένο χρονικό διάστημα."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Η περίοδος λειτουργίας σας στο {productName}
msgid "Your account"
msgstr "Ο λογαριασμός σας"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Ο λογαριασμός σας επανέρχεται αμέσως σε κανονική λειτουργία και δεν θα χρειαστείτε αριθμό τηλεφώνου τώρα. Αυτή δεν είναι μόνιμη εξαίρεση. Η ένταξη σε μια μεγάλη ή δημόσια κοινότητα μπορεί να επαναφέρει αυτόν τον έλεγχο."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Ο λογαριασμός σας επανέρχεται αμέσως σε κανονική λειτουργία και δεν θα χρειαστείτε πλέον αριθμό τηλεφώνου. Αυτή δεν είναι μόνιμη εξαίρεση και ενδέχεται να σας ζητήσουμε ξανά αυτόν τον έλεγχο αργότερα."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Η κάρτα σας πληροί τις προϋποθέσεις. Σας ανακατευθύνουμε τώρα στη σελίδα πληρωμής."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Ο πάροχός σας αναφέρει ότι αυτός ο αριθμός δεν είναι σε χρήση. Ελέγξτε τον και δοκιμάστε ξανά, ή επικοινωνήστε με την υποστήριξη αν είναι σωστός."
@@ -40216,10 +40211,10 @@ msgstr "το νέο σας email"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Το νέο σου ψευδώνυμο, ή άφησέ το κενό για επαναφορά."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Ο αριθμός σας δεν είναι συνδεδεμένος με τον λογαριασμό σας. Διατηρούμε μόνο έναν κρυπτογραφημένο δείκτη, χωρίς αναγνωριστικό χρήστη, για έως {limit} επαληθεύσεις σε περίπου {duration} ημέρες."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Ο αριθμός σας δεν είναι συνδεδεμένος με τον λογαριασμό σας. Διατηρούμε μόνο ένα κρυπτογραφημένο δείκτη, χωρίς αναγνωριστικό χρήστη, για περιορισμένο χρονικό διάστημα."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/en-GB/messages.po b/fluxer_app/src/features/i18n/locales/en-GB/messages.po
index 17d5ebe29..d92f61c40 100644
--- a/fluxer_app/src/features/i18n/locales/en-GB/messages.po
+++ b/fluxer_app/src/features/i18n/locales/en-GB/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 days"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "A browser check is required before phone verification. Try again from the sign-in page or contact support."
@@ -5240,8 +5240,8 @@ msgstr "Away right now"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Back"
@@ -6451,7 +6451,7 @@ msgstr "Can't upload files here"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -7407,7 +7407,6 @@ msgstr "Checking your browser. This takes a few seconds."
msgid "Checkout"
msgstr "Checkout"
-# auto-i18n: reviewed unchanged
#. Modal body for the generic "checkout blocked" state on a self-hosted instance.
#: src/features/app/components/dialogs/components/plutonium/hooks/useCheckoutActions.tsx:156
msgid "Checkout is blocked for this account."
@@ -8295,7 +8294,7 @@ msgstr "Coal theme"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10300,7 +10299,7 @@ msgstr "Countdown timer"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Country"
@@ -13351,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Email unavailable"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Email update is unavailable right now. Try again later or contact support."
@@ -14000,7 +13999,7 @@ msgstr "Enter a valid {theOtherPlatform} template URL or code."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Enter a valid email address."
@@ -14011,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Enter a valid message link."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Enter a valid mobile phone number."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Enter a valid phone number"
@@ -14102,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Enter the {digitCount}-digit code sent to {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
@@ -16138,7 +16137,7 @@ msgstr "Get {premiumProductName} to customise your tag or keep it when changing
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Get new code"
@@ -24040,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Open your browser, sign in, then enter the code below to link your account."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Open your messages"
@@ -24048,12 +24047,12 @@ msgstr "Open your messages"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Open your phone's messaging app and create a new text message."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Open your phone's messaging app and start a new text message."
@@ -24224,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
@@ -24811,21 +24810,21 @@ msgstr "Phone"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Phone number"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Phone number is required"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Phone number verified"
@@ -24840,7 +24839,7 @@ msgid "Phone step"
msgstr "Phone step"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Phone verification is not available for this account. Use another method or contact support."
@@ -25904,7 +25903,6 @@ msgstr "Purchased {0}"
msgid "Purchased gifts"
msgstr "Purchased gifts"
-# auto-i18n: reviewed unchanged
#. Modal body shown on a self-hosted instance when purchases are disabled for the account.
#: src/features/app/components/dialogs/components/plutonium/hooks/useCheckoutActions.tsx:144
msgid "Purchases are disabled for this account."
@@ -27321,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Reposts: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Request a new code first."
@@ -28795,7 +28793,7 @@ msgid "Search communities"
msgstr "Search communities"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Search countries..."
@@ -29561,17 +29559,17 @@ msgstr "Send text-to-speech messages with /tts. Members who turned text-to-speec
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Send the code <0>{0}</0> to <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Send the code to the phone number below."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Send this code"
@@ -29581,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Send this pin back in time?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Send to"
@@ -29608,16 +29606,11 @@ msgstr "Send voice message"
msgid "Send:"
msgstr "Send:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Sending an SMS to this number is expensive, so we need you to text us instead."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
@@ -31204,7 +31197,7 @@ msgid "Smoother video"
msgstr "Smoother video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "SMS verification is unavailable right now. Try again later or contact support."
@@ -31399,7 +31392,7 @@ msgstr "Something went wrong. Try again later."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Something went wrong. Try again."
@@ -31739,7 +31732,7 @@ msgid "Staff controls"
msgstr "Staff controls"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Standard messaging rates from your carrier may apply."
@@ -33167,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Thank you for helping keep {productName} safe. We'll review your report as soon as possible."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "That code didn't work. Check it and try again."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "That code expired. Request a new code."
@@ -33200,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "That doesn't look like a valid URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "That email is already in use."
@@ -34120,8 +34113,8 @@ msgstr "This is your last passkey and passkeys are your second factor. Deleting
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
@@ -34202,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "This nickname will only be visible in this community"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "This number needs text-in verification instead of an SMS from us."
@@ -34232,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "This participant was deafened by moderators"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "This phone number cannot be used. Try another mobile number or contact support."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "This phone number has already been used. Try another number or contact support."
@@ -34389,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "This verification session expired. Return to {productName} and start checkout again."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "This verification session expired. Start again."
@@ -34487,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "This will trust all external links and skip the warning for every domain. Your existing trusted domains will be replaced. This is less secure."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "This window updates automatically after we receive your message."
@@ -34794,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Tone-map HDR images to standard range, reducing peak brightness."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Too many attempts. Wait a bit, then try again."
@@ -36634,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Use an email address you can access. We will send a code there."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Use an email that is different from your current one."
@@ -37320,17 +37313,17 @@ msgstr "Verify it's you"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verify phone"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verify phone number"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Verify phone number form"
@@ -38194,7 +38187,7 @@ msgstr "Volume up"
msgid "Wait a moment before deleting more messages."
msgstr "Wait a moment before deleting more messages."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Wait a moment. This window will close automatically once we receive your message."
@@ -38204,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" can bypass this."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Wait here"
@@ -38370,13 +38363,13 @@ msgstr "We couldn't read this theme. It may be corrupted or invalid."
msgid "We couldn't remove that account. Try again."
msgstr "We couldn't remove that account. Try again."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "We couldn't verify this number automatically. Contact support and a person will review your account."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
@@ -38471,9 +38464,9 @@ msgstr "We'll send a verification code to your email before you can change your
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "We'll send a verification code to your email before you can view your backup codes."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "We'll send an SMS code when available. Your number isn't linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39978,10 +39971,10 @@ msgstr "Your {productName} session expired. Sign in again to continue authorisin
msgid "Your account"
msgstr "Your account"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Your account goes back to normal straight away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40046,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Your card is eligible. Redirecting you to the payment page now."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
@@ -40218,10 +40211,10 @@ msgstr "your new email"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Your new nickname, or leave blank to reset it."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Your number isn't linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/en-US/messages.po b/fluxer_app/src/features/i18n/locales/en-US/messages.po
index 8f579c567..312aab27a 100644
--- a/fluxer_app/src/features/i18n/locales/en-US/messages.po
+++ b/fluxer_app/src/features/i18n/locales/en-US/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 days"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "A browser check is required before phone verification. Try again from the sign-in page or contact support."
@@ -5240,8 +5240,8 @@ msgstr "Away right now"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Back"
@@ -6451,7 +6451,7 @@ msgstr "Can't upload files here"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Coal theme"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Countdown timer"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Country"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Email unavailable"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Email update is unavailable right now. Try again later or contact support."
@@ -13999,7 +13999,7 @@ msgstr "Enter a valid {theOtherPlatform} template URL or code."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Enter a valid email address."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Enter a valid message link."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Enter a valid mobile phone number."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Enter a valid phone number"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Enter the {digitCount}-digit code sent to {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
@@ -16137,7 +16137,7 @@ msgstr "Get {premiumProductName} to customize your tag or keep it when changing
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Get new code"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Open your browser, sign in, then enter the code below to link your account."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Open your messages"
@@ -24047,12 +24047,12 @@ msgstr "Open your messages"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Open your phone's messaging app and create a new text message."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Open your phone's messaging app and start a new text message."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
@@ -24810,21 +24810,21 @@ msgstr "Phone"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Phone number"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Phone number is required"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Phone number verified"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Phone step"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Phone verification is not available for this account. Use another method or contact support."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Reposts: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Request a new code first."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Search communities"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Search countries..."
@@ -29559,17 +29559,17 @@ msgstr "Send text-to-speech messages with /tts. Members who turned text-to-speec
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Send the code <0>{0}</0> to <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Send the code to the phone number below."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Send this code"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Send this pin back in time?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Send to"
@@ -29606,16 +29606,11 @@ msgstr "Send voice message"
msgid "Send:"
msgstr "Send:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Sending an SMS to this number is expensive, so we need you to text us instead."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Smoother video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "SMS verification is unavailable right now. Try again later or contact support."
@@ -31397,7 +31392,7 @@ msgstr "Something went wrong. Try again later."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Something went wrong. Try again."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Staff controls"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Standard messaging rates from your carrier may apply."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Thank you for helping keep {productName} safe. We'll review your report as soon as possible."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "That code didn't work. Check it and try again."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "That code expired. Request a new code."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "That doesn't look like a valid URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "That email is already in use."
@@ -34118,8 +34113,8 @@ msgstr "This is your last passkey and passkeys are your second factor. Deleting
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "This nickname will only be visible in this community"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "This number needs text-in verification instead of an SMS from us."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "This participant was deafened by moderators"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "This phone number cannot be used. Try another mobile number or contact support."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "This phone number has already been used. Try another number or contact support."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "This verification session expired. Return to {productName} and start checkout again."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "This verification session expired. Start again."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "This will trust all external links and skip the warning for every domain. Your existing trusted domains will be replaced. This is less secure."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "This window updates automatically after we receive your message."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Tone-map HDR images to standard range, reducing peak brightness."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Too many attempts. Wait a bit, then try again."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Use an email address you can access. We will send a code there."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Use an email that is different from your current one."
@@ -37318,17 +37313,17 @@ msgstr "Verify it's you"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verify phone"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verify phone number"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Verify phone number form"
@@ -38192,7 +38187,7 @@ msgstr "Volume up"
msgid "Wait a moment before deleting more messages."
msgstr "Wait a moment before deleting more messages."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Wait a moment. This window will close automatically once we receive your message."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" can bypass this."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Wait here"
@@ -38368,13 +38363,13 @@ msgstr "We couldn't read this theme. It may be corrupted or invalid."
msgid "We couldn't remove that account. Try again."
msgstr "We couldn't remove that account. Try again."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "We couldn't verify this number automatically. Contact support and a person will review your account."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
@@ -38469,9 +38464,9 @@ msgstr "We'll send a verification code to your email before you can change your
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "We'll send a verification code to your email before you can view your backup codes."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Your {productName} session expired. Sign in again to continue authorizin
msgid "Your account"
msgstr "Your account"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Your card is eligible. Redirecting you to the payment page now."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
@@ -40216,10 +40211,10 @@ msgstr "your new email"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Your new nickname, or leave blank to reset it."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/es-419/messages.po b/fluxer_app/src/features/i18n/locales/es-419/messages.po
index 17b10c2c1..22a548bfe 100644
--- a/fluxer_app/src/features/i18n/locales/es-419/messages.po
+++ b/fluxer_app/src/features/i18n/locales/es-419/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 días"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Se requiere una verificación del navegador antes de la verificación telefónica. Intenta de nuevo desde la página de inicio de sesión o contacta a soporte."
@@ -5240,8 +5240,8 @@ msgstr "Ausente en este momento"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Atrás"
@@ -6451,7 +6451,7 @@ msgstr "No se pueden subir archivos aquí"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Tema carbón"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Temporizador de cuenta regresiva"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "País"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Correo electrónico no disponible"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "La actualización del correo electrónico no está disponible en este momento. Intenta de nuevo más tarde o contacta a soporte."
@@ -13999,7 +13999,7 @@ msgstr "Ingresa una URL o un código válido de una plantilla de {theOtherPlatfo
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Ingresa una dirección de correo electrónico válida."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Ingresa un enlace de mensaje válido."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Ingresa un número de teléfono celular válido."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Ingresa un número de teléfono válido"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Ingresa el código de {digitCount} dígitos que enviamos a {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Ingresa el código de {MFA_CODE_DIGIT_COUNT} dígitos que enviamos a {0}."
@@ -16137,7 +16137,7 @@ msgstr "Obtén {premiumProductName} para personalizar tu etiqueta o conservarla
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Obtener código nuevo"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Abre tu navegador, inicia sesión y luego ingresa el código a continuación para vincular tu cuenta."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Abre tus mensajes"
@@ -24047,12 +24047,12 @@ msgstr "Abre tus mensajes"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Abre tu antigua app de {PRODUCT_NAME}, selecciona \"Vincular un dispositivo nuevo\" y luego ingresa el código de abajo."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Abre la app de mensajes de tu teléfono y crea un mensaje de texto nuevo."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Abre tu app de mensajería y empieza un mensaje de texto nuevo."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Nuestro servicio de verificación de números de teléfono no está disponible en este momento. El problema es nuestro, no de tu número. Espera unos minutos y vuelve a intentarlo con el mismo número."
@@ -24810,21 +24810,21 @@ msgstr "Teléfono"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Número de teléfono"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Se requiere un número de teléfono"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Número de teléfono verificado"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Paso del teléfono"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "La verificación telefónica no está disponible para esta cuenta. Usa otro método o contacta a soporte."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Republicaciones: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Primero, solicita un código nuevo."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Buscar comunidades"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Buscar países..."
@@ -29559,17 +29559,17 @@ msgstr "Enviar mensajes con síntesis de voz mediante /tts. Los miembros que ten
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Enviar el código <0>{0}</0> a <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Envía el código al número de teléfono de abajo."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Enviar este código"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "¿Enviar este mensaje fijado al pasado?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Enviar a"
@@ -29606,16 +29606,11 @@ msgstr "Enviar mensaje de voz"
msgid "Send:"
msgstr "Enviar:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Enviar un SMS a este número es costoso, así que necesitamos que nos envíes un mensaje de texto en su lugar."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Enviar un SMS a este número de teléfono es demasiado costoso para {PRODUCT_NAME}, por lo que necesitamos que nos envíes un SMS tú. Sabemos que esto no es lo ideal. También puedes pedir a los administradores de esta instancia que eliminen este requisito de tu cuenta."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Enviar un SMS a este número de teléfono es demasiado costoso para {PRODUCT_NAME}, por lo que necesitamos que nos envíes un SMS tú. Sabemos que esto no es lo ideal. También puedes contactar a <0>{SUPPORT_EMAIL}</0> para que eliminemos este requisito de tu cuenta."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Video más fluido"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "La verificación por SMS no está disponible en este momento. Intenta de nuevo más tarde o contacta a soporte."
@@ -31397,7 +31392,7 @@ msgstr "Algo salió mal. Intenta de nuevo más tarde."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Algo salió mal. Intenta de nuevo."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Controles de personal"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Pueden aplicarse las tarifas de mensajería estándar de tu operador."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Gracias por ayudarnos a mantener {productName} seguro. Revisaremos tu reporte lo antes posible."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Ese código no funcionó. Revísalo e inténtalo de nuevo."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Ese código caducó. Solicita un código nuevo."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Parece que no es una URL válida."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Ese correo electrónico ya está en uso."
@@ -34118,8 +34113,8 @@ msgstr "Esta es tu última llave de acceso y las llaves de acceso son tu segundo
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Esta es tu última llave de acceso. Una vez que la elimines, no podrás usar una llave de acceso como segundo factor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Este no es un número de celular, por lo que no puede recibir nuestros SMS. Prueba con un número de celular o contacta a soporte si crees que es un error."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Este apodo solo será visible en esta comunidad"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Este número se verifica enviándonos un mensaje de texto. Vuelve atrás e inicia la verificación telefónica de nuevo para obtener el código y el número al que enviarlo."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Para verificar este número, debes enviarnos un SMS en lugar de recibir uno nuestro."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Los moderadores desactivaron el sonido de este participante"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "No se puede usar este número de teléfono. Prueba con otro número de celular o contacta a soporte."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Este número de teléfono ya ha sido utilizado. Prueba con otro número o contacta a soporte."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Esta sesión de verificación caducó. Vuelve a {productName} e inicia el proceso de pago de nuevo."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Esta sesión de verificación caducó. Vuelve a empezar."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Esto confiará en todos los enlaces externos y omitirá la advertencia para cada dominio. Tus dominios de confianza existentes serán reemplazados. Esto es menos seguro."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Esta ventana se actualiza automáticamente después de que recibamos tu mensaje."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Mapear el tono de las imágenes HDR al rango estándar, reduciendo el brillo máximo."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Demasiados intentos. Espera un poco y vuelve a intentarlo."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Usa una dirección de correo electrónico a la que tengas acceso. Te enviaremos un código allí."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Usa un correo electrónico diferente al actual."
@@ -37318,17 +37313,17 @@ msgstr "Verifica que eres tú"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verificar teléfono"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verificar número de teléfono"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulario para verificar el número de teléfono"
@@ -38192,7 +38187,7 @@ msgstr "Subir volumen"
msgid "Wait a moment before deleting more messages."
msgstr "Espera un momento antes de eliminar más mensajes."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Espera un momento. Esta ventana se cerrará automáticamente cuando recibamos tu mensaje."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Tiempo de espera entre mensajes. Los miembros con el permiso \"{bypassSlowmodePermissionLabel}\" pueden omitirlo."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Espera aquí"
@@ -38368,13 +38363,13 @@ msgstr "No pudimos leer este tema. Puede que esté dañado o no sea válido."
msgid "We couldn't remove that account. Try again."
msgstr "No pudimos eliminar esa cuenta. Intenta de nuevo."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "No pudimos verificar este número automáticamente. Ponte en contacto con soporte y una persona revisará tu cuenta."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "No enviamos mensajes de verificación a este país. Prueba con un número de celular de otro país o contacta a soporte."
@@ -38469,9 +38464,9 @@ msgstr "Te enviaremos un código de verificación a tu correo electrónico antes
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Te enviaremos un código de verificación a tu correo electrónico antes de que puedas ver tus códigos de respaldo."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Te enviaremos un código por SMS cuando esté disponible. Tu número no está vinculado a tu cuenta. Solo guardamos un marcador cifrado, sin ID de usuario, para permitir un máximo de {PHONE_VERIFICATION_LIMIT, plural, one {# verificación} other {# verificaciones}} en aproximadamente {PHONE_VERIFICATION_WINDOW_DAYS, plural, one {# día} other {# días}}."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Enviaremos un código SMS cuando esté disponible. Tu número no está vinculado a tu cuenta. Solo guardamos un marcador cifrado, sin ID de usuario, por tiempo limitado."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Tu sesión de {productName} caducó. Inicia sesión de nuevo para seguir
msgid "Your account"
msgstr "Tu cuenta"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Tu cuenta vuelve a la normalidad de inmediato y no necesitarás un número de teléfono ahora. Esta no es una exención permanente. Unirte a una comunidad grande o pública puede hacer que esta verificación regrese."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Tu cuenta vuelve a la normalidad de inmediato y no necesitarás un número de teléfono ahora. Esta no es una exención permanente y podemos volver a solicitar esta verificación más adelante."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Tu tarjeta cumple los requisitos. Te estamos redirigiendo a la página de pago."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Tu operador dice que este número no está en servicio. Verifícalo e inténtalo de nuevo, o contacta a soporte si es correcto."
@@ -40216,10 +40211,10 @@ msgstr "tu nuevo correo electrónico"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Tu nuevo apodo, o déjalo en blanco para restablecerlo."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Tu número no está vinculado a tu cuenta. Solo guardamos un marcador cifrado, sin ID de usuario, para un máximo de {limit, plural, one {# verificación} other {# verificaciones}} en aproximadamente {duration, plural, one {# día} other {# días}}."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Tu número no está vinculado a tu cuenta. Solo conservamos un marcador cifrado, sin ID de usuario, por tiempo limitado."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/es-ES/messages.po b/fluxer_app/src/features/i18n/locales/es-ES/messages.po
index 74a35ac92..e682b9916 100644
--- a/fluxer_app/src/features/i18n/locales/es-ES/messages.po
+++ b/fluxer_app/src/features/i18n/locales/es-ES/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 días"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Se requiere una comprobación del navegador antes de la verificación del teléfono. Inténtalo de nuevo desde la página de inicio de sesión o contacta con el soporte."
@@ -5240,8 +5240,8 @@ msgstr "Ausente ahora mismo"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Atrás"
@@ -6451,7 +6451,7 @@ msgstr "No se pueden subir archivos aquí"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Tema carbón"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Temporizador de cuenta atrás"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "País"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Correo electrónico no disponible"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "La actualización del correo electrónico no está disponible en este momento. Inténtalo de nuevo más tarde o contacta con el soporte."
@@ -13999,7 +13999,7 @@ msgstr "Introduce una URL o código de plantilla de {theOtherPlatform} válido."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Introduce una dirección de correo electrónico válida."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Introduce un enlace de mensaje válido."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Introduce un número de teléfono móvil válido."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Introduce un número de teléfono válido"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Introduce el código de {digitCount} dígitos enviado a {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Introduce el código de {MFA_CODE_DIGIT_COUNT} dígitos que te hemos enviado a {0}."
@@ -16137,7 +16137,7 @@ msgstr "Consigue {premiumProductName} para personalizar tu etiqueta o conservarl
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Obtener nuevo código"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Abre tu navegador, inicia sesión y, a continuación, introduce el código de abajo para vincular tu cuenta."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Abre tus mensajes"
@@ -24047,12 +24047,12 @@ msgstr "Abre tus mensajes"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Abre tu antigua app de {PRODUCT_NAME}, selecciona \"Vincular un dispositivo nuevo\" y luego introduce el código de abajo."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Abre la aplicación de mensajería de tu teléfono y crea un mensaje de texto nuevo."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Abre la aplicación de mensajería de tu teléfono e inicia un nuevo mensaje de texto."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Nuestro servicio de comprobación de números de teléfono no está disponible en este momento. El problema es nuestro, no de tu número. Espera unos minutos y vuelve a intentarlo con el mismo número."
@@ -24810,21 +24810,21 @@ msgstr "Teléfono"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Número de teléfono"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Se requiere un número de teléfono"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Número de teléfono verificado"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Paso del teléfono"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "La verificación telefónica no está disponible para esta cuenta. Usa otro método o contacta con soporte."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Republicaciones: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Primero, solicita un código nuevo."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Buscar comunidades"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Buscar países..."
@@ -29559,17 +29559,17 @@ msgstr "Enviar mensajes con síntesis de voz mediante /tts. Los miembros que ten
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Envía el código <0>{0}</0> a <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Envía el código al número de teléfono de abajo."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Enviar este código"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "¿Enviar este mensaje fijado al pasado?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Enviar a"
@@ -29606,16 +29606,11 @@ msgstr "Enviar mensaje de voz"
msgid "Send:"
msgstr "Enviar:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Enviar un SMS a este número es caro, así que necesitamos que nos envíes un mensaje de texto."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Enviar un SMS a este número de teléfono es demasiado caro para {PRODUCT_NAME}, así que necesitamos que nos envíes un SMS tú. Sabemos que no es lo ideal. También puedes pedir a los administradores de esta instancia que eliminen este requisito de tu cuenta."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Enviar un SMS a este número de teléfono es demasiado caro para {PRODUCT_NAME}, así que necesitamos que nos envíes un SMS tú. Sabemos que no es lo ideal. También puedes contactar con <0>{SUPPORT_EMAIL}</0> para que eliminemos este requisito de tu cuenta."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Vídeo más fluido"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "La verificación por SMS no está disponible en este momento. Inténtalo de nuevo más tarde o contacta con el soporte técnico."
@@ -31397,7 +31392,7 @@ msgstr "Ha ocurrido un error. Inténtalo de nuevo más tarde."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Ha ocurrido un error. Inténtalo de nuevo."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Controles de personal"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Pueden aplicarse las tarifas de mensajería estándar de tu operador."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Gracias por ayudarnos a mantener {productName} seguro. Revisaremos tu denuncia lo antes posible."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Ese código no funcionó. Compruébalo e inténtalo de nuevo."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Ese código ha caducado. Solicita un código nuevo."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "No parece una URL válida."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Ese correo electrónico ya está en uso."
@@ -34118,8 +34113,8 @@ msgstr "Esta es tu última clave de acceso y las claves de acceso son tu segundo
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Esta es tu última clave de acceso. Una vez que la elimines, no podrás usar una clave de acceso como segundo factor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Este número no es de un móvil, por lo que no puede recibir nuestros SMS. Prueba con un número de móvil o ponte en contacto con soporte si crees que esto es un error."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Este apodo solo será visible en esta comunidad"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Este número se verifica enviándonos un mensaje de texto. Vuelve atrás e inicia la verificación telefónica de nuevo para obtener el código y el número al que enviarlo."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Para verificar este número, debes enviarnos un SMS en lugar de recibir uno nuestro."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Los moderadores desactivaron el sonido de este participante"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "No se puede usar este número de teléfono. Prueba con otro número de móvil o contacta con soporte."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Este número de teléfono ya se ha usado. Prueba con otro número o contacta con el equipo de soporte."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "La sesión de verificación ha caducado. Vuelve a {productName} y reinicia el proceso de compra."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "La sesión de verificación ha caducado. Vuelve a empezar."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Esto hará que se confíe en todos los enlaces externos y se omita la advertencia para cada dominio. Tus dominios de confianza existentes serán reemplazados. Esto es menos seguro."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Esta ventana se actualiza automáticamente cuando recibimos tu mensaje."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Mapea el tono de las imágenes HDR al rango estándar, reduciendo el brillo máximo."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Demasiados intentos. Espera un poco y vuelve a intentarlo."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Usa una dirección de correo electrónico a la que tengas acceso. Te enviaremos un código allí."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Usa un correo electrónico diferente al actual."
@@ -37318,17 +37313,17 @@ msgstr "Verifica que eres tú"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verificar teléfono"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verificar número de teléfono"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulario de verificación del número de teléfono"
@@ -38192,7 +38187,7 @@ msgstr "Subir volumen"
msgid "Wait a moment before deleting more messages."
msgstr "Espera un momento antes de eliminar más mensajes."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Espera un momento. Esta ventana se cerrará automáticamente cuando recibamos tu mensaje."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Tiempo de espera entre mensajes. Los miembros con el permiso \"{bypassSlowmodePermissionLabel}\" pueden omitirlo."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Espera aquí"
@@ -38368,13 +38363,13 @@ msgstr "No hemos podido leer este tema. Puede que esté dañado o no sea válido
msgid "We couldn't remove that account. Try again."
msgstr "No hemos podido eliminar esa cuenta. Inténtalo de nuevo."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "No hemos podido verificar este número automáticamente. Ponte en contacto con soporte y una persona revisará tu cuenta."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "No enviamos mensajes de verificación a este país. Prueba con un número de móvil de otro país o ponte en contacto con soporte."
@@ -38469,9 +38464,9 @@ msgstr "Te enviaremos un código de verificación a tu correo electrónico antes
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Te enviaremos un código de verificación a tu correo electrónico antes de que puedas ver tus códigos de respaldo."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Te enviaremos un código por SMS cuando esté disponible. Tu número no está vinculado a tu cuenta. Solo guardamos un marcador cifrado, sin ID de usuario, para permitir un máximo de {PHONE_VERIFICATION_LIMIT, plural, one {# verificación} other {# verificaciones}} en aproximadamente {PHONE_VERIFICATION_WINDOW_DAYS, plural, one {# día} other {# días}}."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Enviaremos un código SMS cuando esté disponible. Tu número no se vinculará a tu cuenta. Solo guardamos un marcador cifrado, sin ID de usuario, durante un tiempo limitado."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Tu sesión de {productName} ha caducado. Inicia sesión de nuevo para se
msgid "Your account"
msgstr "Tu cuenta"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Tu cuenta volverá a la normalidad de inmediato y no necesitarás un número de teléfono ahora. Esta no es una exención permanente. Unirte a una comunidad grande o pública puede hacer que esta verificación vuelva a aparecer."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Tu cuenta volverá a la normalidad de inmediato y no necesitarás un número de teléfono. Esto no es una exención permanente y podemos volver a solicitar esta verificación más adelante."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Tu tarjeta cumple los requisitos. Te estamos redirigiendo a la página de pago."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Tu operador indica que este número no está en servicio. Compruébalo y vuelve a intentarlo, o ponte en contacto con soporte si es correcto."
@@ -40216,10 +40211,10 @@ msgstr "tu nuevo correo electrónico"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Tu nuevo apodo, o déjalo en blanco para restablecerlo."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Tu número no está vinculado a tu cuenta. Solo guardamos un marcador cifrado, sin ID de usuario, para un máximo de {limit, plural, one {# verificación} other {# verificaciones}} en aproximadamente {duration, plural, one {# día} other {# días}}."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Tu número no está vinculado a tu cuenta. Guardamos solo un marcador cifrado, sin ID de usuario, durante un tiempo limitado."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/fi/messages.po b/fluxer_app/src/features/i18n/locales/fi/messages.po
index 55effe041..b84ea8e30 100644
--- a/fluxer_app/src/features/i18n/locales/fi/messages.po
+++ b/fluxer_app/src/features/i18n/locales/fi/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 päivää"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Selaimen tarkistus vaaditaan ennen puhelinnumeron vahvistamista. Yritä uudelleen kirjautumissivulta tai ota yhteyttä tukeen."
@@ -5240,8 +5240,8 @@ msgstr "Poissa juuri nyt"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Takaisin"
@@ -6451,7 +6451,7 @@ msgstr "Tiedostoja ei voi lähettää tähän"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Hiiliteema"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Ajastin"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Maa"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Sähköposti ei ole saatavilla"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Sähköpostin päivitys ei ole käytettävissä juuri nyt. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen."
@@ -13999,7 +13999,7 @@ msgstr "Anna kelvollinen {theOtherPlatform}-mallin URL-osoite tai koodi."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Anna kelvollinen sähköpostiosoite."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Anna kelvollinen viestilinkki."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Anna kelvollinen matkapuhelinnumero."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Anna kelvollinen puhelinnumero"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Anna numeroon {phoneNumber} lähetetty {digitCount}-numeroinen koodi."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Anna {MFA_CODE_DIGIT_COUNT}-numeroinen koodi, joka lähetettiin numeroon {0}."
@@ -16137,7 +16137,7 @@ msgstr "Hanki {premiumProductName} ja mukauta tunnistettasi tai säilytä se, ku
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Pyydä uusi koodi"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Avaa selaimesi, kirjaudu sisään ja syötä sitten alla oleva koodi tilisi yhdistämiseksi."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Avaa viestisi"
@@ -24047,12 +24047,12 @@ msgstr "Avaa viestisi"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Avaa vanha {PRODUCT_NAME}-sovelluksesi, valitse \"Linkitä uusi laite\" ja syötä sitten alla oleva koodi."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Avaa puhelimen viestisovellus ja luo uusi tekstiviesti."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Avaa puhelimen viestisovellus ja aloita uusi tekstiviesti."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Puhelinnumeron tarkistuksemme ei ole juuri nyt käytettävissä. Tämä on meidän vikamme, ei numerosi. Odota muutama minuutti ja yritä samaa numeroa uudelleen."
@@ -24810,21 +24810,21 @@ msgstr "Puhelin"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Puhelinnumero"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Puhelinnumero vaaditaan"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Puhelinnumero vahvistettu"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Puhelinvaihe"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Puhelinnumeron vahvistus ei ole käytettävissä tällä tilillä. Käytä toista menetelmää tai ota yhteyttä tukeen."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Uudelleenjulkaisut: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Pyydä ensin uusi koodi."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Hae yhteisöjä"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Hae maita..."
@@ -29559,17 +29559,17 @@ msgstr "Lähetä tekstistä puheeksi -viestejä /tts-komennolla. Jäsenet, jotka
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Lähetä koodi <0>{0}</0> numeroon <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Lähetä koodi alla olevaan puhelinnumeroon."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Lähetä tämä koodi"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Lähetetäänkö tämä kiinnitys takaisin menneisyyteen?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Lähetä numeroon"
@@ -29606,16 +29606,11 @@ msgstr "Lähetä ääniviesti"
msgid "Send:"
msgstr "Lähetys:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Tekstiviestin lähettäminen tähän numeroon on kallista, joten pyydämme sinua lähettämään meille viestin sen sijaan."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Tekstiviestin lähettäminen tähän puhelinnumeroon on liian kallista {PRODUCT_NAME}-palvelulle, joten pyydämme sinua lähettämään meille tekstiviestin sen sijaan. Tiedämme, ettei tämä ole ihanteellista. Voit myös pyytää tämän instanssin ylläpitäjiä poistamaan tämän vaatimuksen tililtäsi."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Tekstiviestin lähettäminen tähän puhelinnumeroon on liian kallista {PRODUCT_NAME}-palvelulle, joten pyydämme sinua lähettämään meille tekstiviestin sen sijaan. Tiedämme, ettei tämä ole ihanteellista. Voit myös ottaa yhteyttä osoitteeseen <0>{SUPPORT_EMAIL}</0>, jotta voimme poistaa tämän vaatimuksen tililtäsi."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Sujuvampi video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Tekstiviestivahvistus ei ole käytettävissä juuri nyt. Yritä myöhemmin uudelleen tai ota yhteyttä tukeen."
@@ -31397,7 +31392,7 @@ msgstr "Jokin meni pieleen. Yritä myöhemmin uudelleen."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Jokin meni pieleen. Yritä uudelleen."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Henkilöstön toiminnot"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Operaattorisi normaalit viestihinnat saattavat olla voimassa."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Kiitos, että autat pitämään palvelun {productName} turvallisena. Tarkistamme ilmoituksesi mahdollisimman pian."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Koodi ei toiminut. Tarkista se ja yritä uudelleen."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Koodi vanhentui. Pyydä uusi koodi."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Tuo ei näytä kelvolliselta URL-osoitteelta."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Sähköpostiosoite on jo käytössä."
@@ -34118,8 +34113,8 @@ msgstr "Tämä on viimeinen pääsyavaimesi, ja pääsyavaimet ovat tilisi toine
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Tämä on viimeinen pääsyavaimesi. Kun se on poistettu, et voi enää käyttää pääsyavainta toisena vaiheena."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Tämä ei ole matkapuhelinnumero, joten se ei voi vastaanottaa tekstiviestiämme. Kokeile matkapuhelinnumeroa tai ota yhteyttä tukeen, jos uskot tämän olevan virhe."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Tämä lempinimi näkyy vain tässä yhteisössä"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Tämä numero vahvistetaan lähettämällä meille tekstiviesti. Palaa takaisin ja aloita puhelinnumeron vahvistus uudelleen, niin saat koodin ja numeron, johon viesti lähetetään."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Tämä numero vahvistetaan lähettämällä meille tekstiviesti, ei meiltä tulevalla tekstiviestillä."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Moderaattorit mykistivät tämän osallistujan äänet"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Tätä puhelinnumeroa ei voi käyttää. Kokeile toista matkapuhelinnumeroa tai ota yhteyttä tukeen."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Tätä puhelinnumeroa on jo käytetty. Kokeile toista numeroa tai ota yhteyttä tukeen."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Vahvistusistunto vanhentui. Palaa sovellukseen {productName} ja siirry uudelleen kassalle."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Tämä vahvistusistunto vanhentui. Aloita alusta."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Tämä merkitsee kaikki ulkoiset linkit luotetuiksi ja ohittaa varoituksen jokaisella verkkotunnuksella. Nykyiset luotetut verkkotunnuksesi korvataan. Tämä on vähemmän turvallista."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Tämä ikkuna päivittyy automaattisesti, kun olemme vastaanottaneet viestisi."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Sovita HDR-kuvat vakiokirkkausalueelle, mikä laskee huippukirkkautta."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Liian monta yritystä. Odota hetki ja yritä sitten uudelleen."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Käytä sähköpostiosoitetta, johon pääset käsiksi. Lähetämme sinne koodin."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Käytä eri sähköpostiosoitetta kuin nykyinen."
@@ -37318,17 +37313,17 @@ msgstr "Vahvista henkilöllisyytesi"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Vahvista puhelinnumero"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Vahvista puhelinnumero"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Vahvista puhelinnumero -lomake"
@@ -38192,7 +38187,7 @@ msgstr "Suurenna äänenvoimakkuutta"
msgid "Wait a moment before deleting more messages."
msgstr "Odota hetki ennen kuin poistat lisää viestejä."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Odota hetki. Tämä ikkuna sulkeutuu automaattisesti, kun olemme vastaanottaneet viestisi."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Viive viestien välillä. Jäsenet, joilla on oikeus \"{bypassSlowmodePermissionLabel}\", voivat ohittaa sen."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Odota tässä"
@@ -38368,13 +38363,13 @@ msgstr "Teemaa ei voitu lukea. Se voi olla vioittunut tai virheellinen."
msgid "We couldn't remove that account. Try again."
msgstr "Tilin poistaminen ei onnistunut. Yritä uudelleen."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Emme voineet vahvistaa tätä numeroa automaattisesti. Ota yhteyttä tukeen, niin henkilö tarkistaa tilisi."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Emme lähetä vahvistustekstiviestejä tähän maahan. Kokeile toisesta maasta olevaa mobiilinumeroa tai ota yhteyttä tukeen."
@@ -38469,9 +38464,9 @@ msgstr "Lähetämme vahvistuskoodin sähköpostiisi, ennen kuin voit vaihtaa sal
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Lähetämme vahvistuskoodin sähköpostiisi, ennen kuin voit tarkastella varakoodejasi."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Lähetämme tekstiviestikoodin, kun se on saatavilla. Numeroasi ei ole linkitetty tiliisi. Säilytämme vain salatun tunnisteen ilman käyttäjätunnusta, jotta voimme sallia enintään {PHONE_VERIFICATION_LIMIT} vahvistusta noin {PHONE_VERIFICATION_WINDOW_DAYS} päivän aikana."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Lähetämme tekstiviestikoodin, kun se on saatavilla. Numerosi ei ole linkitetty tiliisi. Säilytämme vain salatun merkinnän ilman käyttäjätunnusta rajoitetun ajan."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "{productName}-istuntosi vanheni. Kirjaudu sisään uudelleen jatkaaksesi
msgid "Your account"
msgstr "Tilisi"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Tilisi palautuu normaaliksi heti, etkä tarvitse puhelinnumeroa nyt. Tämä ei ole pysyvä vapautus. Suureen tai julkiseen yhteisöön liittyminen voi tuoda tämän tarkistuksen takaisin."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Tilisi palautuu heti normaaliksi, etkä tarvitse puhelinnumeroa nyt. Tämä ei ole pysyvä vapautus, ja voimme pyytää tätä tarkistusta myöhemmin uudelleen."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Korttisi kelpaa. Ohjaamme sinut nyt maksusivulle."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Operaattorisi mukaan numero ei ole käytössä. Tarkista se ja yritä uudelleen tai ota yhteyttä tukeen, jos se on oikein."
@@ -40216,10 +40211,10 @@ msgstr "uusi sähköpostiosoitteesi"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Uusi lempinimesi, tai jätä tyhjäksi palauttaaksesi sen."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Puhelinnumeroasi ei ole linkitetty tiliisi. Säilytämme vain salatun tunnisteen ilman käyttäjätunnusta enintään {limit} vahvistusta varten noin {duration} päivän ajan."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Numeroasi ei ole yhdistetty tiliisi. Säilytämme vain salatun merkinnän ilman käyttäjätunnusta rajoitetun ajan."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/fr/messages.po b/fluxer_app/src/features/i18n/locales/fr/messages.po
index bac897f36..7c8c77566 100644
--- a/fluxer_app/src/features/i18n/locales/fr/messages.po
+++ b/fluxer_app/src/features/i18n/locales/fr/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 jours"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Une vérification du navigateur est requise avant la vérification du téléphone. Réessayez depuis la page de connexion ou contactez l'assistance."
@@ -5240,8 +5240,8 @@ msgstr "Absent(e) pour le moment"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Retour"
@@ -6451,7 +6451,7 @@ msgstr "Impossible d’envoyer des fichiers ici"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Thème charbon"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Compte à rebours"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Pays"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mail non disponible"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "La mise à jour de l'e-mail est actuellement indisponible. Réessayez plus tard ou contactez l'assistance."
@@ -13999,7 +13999,7 @@ msgstr "Entrez une URL ou un code de modèle {theOtherPlatform} valide."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Saisissez une adresse e-mail valide."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Saisissez un lien de message valide."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Saisissez un numéro de téléphone mobile valide."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Saisissez un numéro de téléphone valide"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Saisissez le code à {digitCount} chiffres envoyé au {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Saisissez le code à {MFA_CODE_DIGIT_COUNT} chiffres envoyé au {0}."
@@ -16137,7 +16137,7 @@ msgstr "Obtenez {premiumProductName} pour personnaliser votre tag ou le conserve
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Recevoir un nouveau code"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Ouvrez votre navigateur, connectez-vous, puis saisissez le code ci-dessous pour associer votre compte."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Ouvrez vos messages"
@@ -24047,12 +24047,12 @@ msgstr "Ouvrez vos messages"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Ouvrez votre ancienne application {PRODUCT_NAME} et choisissez « Lier un nouvel appareil », puis saisissez le code ci-dessous."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Ouvrez l’application de SMS de votre téléphone et rédigez un nouveau message."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Ouvrez l’application de SMS de votre téléphone et commencez un nouveau message."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Notre vérification de numéro de téléphone est temporairement indisponible. C'est de notre faute, pas celle de votre numéro. Veuillez patienter quelques minutes et réessayer avec le même numéro."
@@ -24810,21 +24810,21 @@ msgstr "Téléphone"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Numéro de téléphone"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Numéro de téléphone requis"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Numéro de téléphone vérifié"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Étape du téléphone"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "La vérification par téléphone n'est pas disponible pour ce compte. Utilisez une autre méthode ou contactez l'assistance."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Republications : <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Demandez d'abord un nouveau code."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Rechercher des communautés"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Rechercher des pays…"
@@ -29559,17 +29559,17 @@ msgstr "Envoyer des messages lus à voix haute avec /tts. Les membres ayant acti
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Envoyer le code <0>{0}</0> au <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Envoyez le code au numéro de téléphone ci-dessous."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Envoyer ce code"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Renvoyer cet élément épinglé dans le passé ?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Envoyer à"
@@ -29606,16 +29606,11 @@ msgstr "Envoyer un message vocal"
msgid "Send:"
msgstr "Envoi :"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "L’envoi d’un SMS à ce numéro coûte cher. Nous vous demandons donc de nous envoyer un SMS à la place."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "L'envoi d'un SMS à ce numéro de téléphone est trop coûteux pour {PRODUCT_NAME}. Nous avons donc besoin que vous nous envoyiez un SMS à la place. Nous savons que ce n'est pas idéal. Vous pouvez également demander aux administrateurs de cette instance de lever cette exigence pour votre compte."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "L'envoi d'un SMS à ce numéro de téléphone est trop coûteux pour {PRODUCT_NAME}. Nous avons donc besoin que vous nous envoyiez un SMS à la place. Nous savons que ce n'est pas idéal. Vous pouvez également contacter <0>{SUPPORT_EMAIL}</0> pour que nous levions cette exigence de votre compte."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Vidéo plus fluide"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "La vérification par SMS est indisponible pour le moment. Réessayez plus tard ou contactez l'assistance."
@@ -31397,7 +31392,7 @@ msgstr "Un problème est survenu. Veuillez réessayer plus tard."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Une erreur est survenue. Veuillez réessayer."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Commandes du personnel"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Des frais de messagerie standard de votre opérateur peuvent s'appliquer."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Merci de nous aider à assurer la sécurité de {productName}. Nous examinerons votre signalement dès que possible."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Ce code n'a pas fonctionné. Vérifiez-le et réessayez."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Ce code a expiré. Demandez un nouveau code."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Ceci ne semble pas être une URL valide."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Cet e-mail est déjà utilisé."
@@ -34118,8 +34113,8 @@ msgstr "C'est votre dernière clé d'accès, et les clés d'accès sont votre de
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "C'est votre dernière clé d'accès. Une fois qu'elle sera supprimée, vous ne pourrez plus utiliser de clé d'accès comme deuxième facteur."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Ce n’est pas un numéro de mobile et il ne peut donc pas recevoir notre SMS. Essayez un numéro de mobile ou contactez l’assistance si vous pensez qu’il s’agit d’une erreur."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Ce surnom ne sera visible que dans cette communauté"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Pour vérifier ce numéro, vous devez nous envoyer un SMS. Revenez en arrière et recommencez la vérification téléphonique pour obtenir le code et le numéro auquel l’envoyer."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Pour vérifier ce numéro, vous devez nous envoyer un SMS au lieu d’en recevoir un."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Les modérateurs ont désactivé le son de ce participant"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Ce numéro de téléphone ne peut pas être utilisé. Essayez un autre numéro de mobile ou contactez l'assistance."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Ce numéro de téléphone a déjà été utilisé. Essayez un autre numéro ou contactez l'assistance."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Cette session de vérification a expiré. Retournez à {productName} et recommencez le paiement."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Cette session de vérification a expiré. Veuillez recommencer."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Cela approuvera tous les liens externes et ignorera l'avertissement pour chaque domaine. Vos domaines approuvés existants seront remplacés. C'est moins sécurisé."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Cette fenêtre se met à jour automatiquement après réception de votre message."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Convertir les images HDR en plage standard, réduisant ainsi la luminosité maximale."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Trop de tentatives. Attendez un peu, puis réessayez."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Utilisez une adresse e-mail à laquelle vous avez accès. Nous vous enverrons un code à cette adresse."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Utilisez une adresse e-mail différente de celle que vous utilisez actuellement."
@@ -37318,17 +37313,17 @@ msgstr "Vérifiez que c'est bien vous"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Vérifier le téléphone"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Vérifier le numéro de téléphone"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulaire de vérification du numéro de téléphone"
@@ -38192,7 +38187,7 @@ msgstr "Augmenter le volume"
msgid "Wait a moment before deleting more messages."
msgstr "Attendez un instant avant de supprimer d'autres messages."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Veuillez patienter un instant. Cette fenêtre se fermera automatiquement dès que nous recevrons votre message."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Attendre entre les messages. Les membres disposant de la permission « {bypassSlowmodePermissionLabel} » peuvent ignorer ce délai."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Veuillez patienter"
@@ -38368,13 +38363,13 @@ msgstr "Nous n'avons pas pu lire ce thème. Il est peut-être corrompu ou invali
msgid "We couldn't remove that account. Try again."
msgstr "Nous n'avons pas pu supprimer ce compte. Veuillez réessayer."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Nous n’avons pas pu vérifier ce numéro automatiquement. Contactez l’assistance pour qu’une personne examine votre compte."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Nous n’envoyons pas de SMS de vérification dans ce pays. Essayez un numéro de mobile d’un autre pays ou contactez l’assistance."
@@ -38469,9 +38464,9 @@ msgstr "Nous enverrons un code de vérification à votre adresse e-mail avant qu
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Nous enverrons un code de vérification à votre adresse e-mail avant que vous puissiez consulter vos codes de secours."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Nous enverrons un code par SMS si cette option est disponible. Votre numéro n’est pas lié à votre compte. Nous conservons uniquement un marqueur chiffré, sans identifiant d’utilisateur, pour autoriser au maximum {PHONE_VERIFICATION_LIMIT} vérifications sur environ {PHONE_VERIFICATION_WINDOW_DAYS} jours."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Nous enverrons un code SMS lorsqu'il sera disponible. Votre numéro n'est pas lié à votre compte. Nous conservons uniquement un identifiant chiffré, sans ID utilisateur, pendant une durée limitée."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Votre session {productName} a expiré. Connectez-vous à nouveau pour co
msgid "Your account"
msgstr "Votre compte"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Votre compte redevient normal immédiatement et vous n'aurez pas besoin de numéro de téléphone. Ce n'est pas une exemption permanente. Rejoindre une communauté grande ou publique peut réactiver cette vérification."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Votre compte redeviendra normal immédiatement et vous n'aurez pas besoin de numéro de téléphone pour le moment. Ce n'est pas une exemption permanente, et nous pourrons vous demander cette vérification à nouveau plus tard."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Votre carte est éligible. Redirection vers la page de paiement en cours."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Votre opérateur indique que ce numéro n’est pas en service. Vérifiez-le et réessayez, ou contactez l’assistance si le numéro est correct."
@@ -40216,10 +40211,10 @@ msgstr "votre nouvelle adresse e-mail"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Votre nouveau surnom, ou laissez vide pour le réinitialiser."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Votre numéro n'est pas lié à votre compte. Nous ne conservons qu'un marqueur chiffré, sans identifiant d'utilisateur, pour un maximum de {limit} vérifications en environ {duration} jours."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Votre numéro n'est pas lié à votre compte. Nous conservons uniquement un marqueur chiffré, sans identifiant utilisateur, pendant une durée limitée."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/he/messages.po b/fluxer_app/src/features/i18n/locales/he/messages.po
index d29c2a5d9..e3a97b921 100644
--- a/fluxer_app/src/features/i18n/locales/he/messages.po
+++ b/fluxer_app/src/features/i18n/locales/he/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 ימים"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "נדרשת בדיקת דפדפן לפני אימות הטלפון. יש לנסות שוב מדף ההתחברות או ליצור קשר עם התמיכה."
@@ -5240,8 +5240,8 @@ msgstr "לא זמין כרגע"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "חזרה"
@@ -6451,7 +6451,7 @@ msgstr "לא ניתן להעלות קבצים כאן"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "ערכת נושא פחם"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "טיימר ספירה לאחור"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "מדינה"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "האימייל אינו זמין"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "עדכון האימייל אינו זמין כרגע. יש לנסות שוב מאוחר יותר או לפנות לתמיכה."
@@ -13999,7 +13999,7 @@ msgstr "יש להזין כתובת URL או קוד תבנית חוקיים של
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "יש להזין כתובת אימייל חוקית."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "יש להזין קישור חוקי להודעה."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "יש להזין מספר טלפון נייד חוקי."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "יש להזין מספר טלפון חוקי"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "הזן את הקוד בן {digitCount} הספרות שנשלח אל {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "הזן את הקוד בן {MFA_CODE_DIGIT_COUNT} הספרות שנשלח אל {0}."
@@ -16137,7 +16137,7 @@ msgstr "קבל את {premiumProductName} כדי להתאים אישית את ה
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "קבל קוד חדש"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "פתח את הדפדפן שלך, היכנס, ואז הזן את הקוד למטה כדי לקשר את חשבונך."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "פתח את ההודעות שלך"
@@ -24047,12 +24047,12 @@ msgstr "פתח את ההודעות שלך"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "פתח את אפליקציית {PRODUCT_NAME} הישנה שלך ובחר \"קשר מכשיר חדש\", ואז הזן את הקוד שלמטה."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "פתח את אפליקציית ההודעות בטלפון וצור הודעת טקסט חדשה."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "פתח את אפליקציית ההודעות בטלפון שלך והתחל הודעת טקסט חדשה."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "בדיקת מספר הטלפון שלנו אינה פועלת כרגע. זו אשמתנו, לא אשמת המספר שלך. המתן מספר דקות ונסה שוב עם אותו המספר."
@@ -24810,21 +24810,21 @@ msgstr "טלפון"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "מספר טלפון"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "נדרש מספר טלפון"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "מספר הטלפון אומת"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "שלב טלפון"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "אימות טלפוני אינו זמין עבור חשבון זה. השתמש בשיטה אחרת או פנה לתמיכה."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "ריפוסטים: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "יש לבקש קוד חדש תחילה."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "חיפוש קהילות"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "חיפוש מדינות..."
@@ -29559,17 +29559,17 @@ msgstr "שלח הודעות טקסט לדיבור באמצעות /tts. חברי
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "שלח את הקוד <0>{0}</0> אל <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "שלח את הקוד למספר הטלפון שלמטה."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "שלח את הקוד הזה"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "לשלוח את ההצמדה הזו אחורה בזמן?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "שליחה אל"
@@ -29606,16 +29606,11 @@ msgstr "שלח הודעה קולית"
msgid "Send:"
msgstr "שליחה:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "שליחת SMS למספר הזה יקרה, לכן אנחנו צריכים שתשלח לנו הודעה במקום."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "שליחת SMS למספר הטלפון הזה יקרה מדי עבור {PRODUCT_NAME}, ולכן אנחנו צריכים שתשלח לנו SMS במקום. אנחנו יודעים שזה לא אידיאלי. אפשר גם לבקש ממנהלי המערכת של המופע הזה להסיר את הדרישה הזו מהחשבון שלך."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "שליחת SMS למספר הטלפון הזה יקרה מדי עבור {PRODUCT_NAME}, ולכן אנחנו צריכים שתשלח לנו SMS במקום. אנחנו יודעים שזה לא אידיאלי. אפשר גם ליצור קשר עם <0>{SUPPORT_EMAIL}</0> כדי שנסיר את הדרישה הזו מהחשבון שלך."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "וידאו חלק יותר"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "אימות באמצעות SMS אינו זמין כרגע. נסה שוב מאוחר יותר או צור קשר עם התמיכה."
@@ -31397,7 +31392,7 @@ msgstr "משהו השתבש. יש לנסות שוב מאוחר יותר."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "משהו השתבש. יש לנסות שוב."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "פקדי צוות"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "ייתכן שיחולו תעריפי ההודעות הרגילים של הספק שלך."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "תודה שעזרת לשמור על הבטיחות ב-{productName}. נבדוק את הדיווח שלך בהקדם האפשרי."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "הקוד הזה לא עבד. יש לבדוק אותו ולנסות שוב."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "הקוד הזה פג תוקף. בקש קוד חדש."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "זה לא נראה כמו כתובת URL תקינה."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "כתובת האימייל הזו כבר נמצאת בשימוש."
@@ -34118,8 +34113,8 @@ msgstr "זהו מפתח הגישה האחרון שלך, ומפתחות גישה
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "זהו מפתח הגישה האחרון שלך. לאחר שיימחק, לא תוכל להשתמש במפתח גישה כשלב האימות השני שלך."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "זה לא מספר נייד, ולכן אינו יכול לקבל מאיתנו הודעות SMS. נסה מספר נייד, או פנה לתמיכה אם אתה חושב שזה שגוי."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "הכינוי הזה יהיה גלוי רק בקהילה הזו"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "המספר הזה מאומת על ידי שליחת הודעת טקסט אלינו. חזור והתחל שוב את אימות הטלפון כדי לקבל את הקוד ואת המספר שאליו יש לשלוח הודעת טקסט."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "המספר הזה דורש אימות בטקסט במקום הודעת SMS מאיתנו."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "השמע של משתתף זה הושתק על ידי מנהלים"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "אי אפשר להשתמש במספר הטלפון הזה. יש לנסות מספר נייד אחר או ליצור קשר עם התמיכה."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "מספר הטלפון הזה כבר נמצא בשימוש. נסה מספר אחר או צור קשר עם התמיכה."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "תוקף סשן האימות פג. יש לחזור אל {productName} ולהתחיל את תהליך התשלום מחדש."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "תוקף סשן האימות הזה פג. יש להתחיל מחדש."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "פעולה זו תאפשר אמון בכל הקישורים החיצוניים ותדלג על האזהרה עבור כל דומיין. הדומיינים המהימנים הקיימים שלך יוחלפו. אפשרות זו פחות מאובטחת."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "החלון הזה יתעדכן אוטומטית לאחר שנקבל את ההודעה שלך."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "ממפה תמונות HDR לטווח רגיל ומפחית את בהירות השיא."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "ניסית יותר מדי פעמים. המתן מעט ונסה שוב."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "השתמש בכתובת אימייל שיש לך גישה אליה. נשלח לשם קוד."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "יש להשתמש בכתובת אימייל שונה מהכתובת הנוכחית שלך."
@@ -37318,17 +37313,17 @@ msgstr "אימות זהותך"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "אימות מספר טלפון"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "אימות מספר טלפון"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "טופס אימות מספר טלפון"
@@ -38192,7 +38187,7 @@ msgstr "הגברת עוצמת הקול"
msgid "Wait a moment before deleting more messages."
msgstr "המתן רגע לפני מחיקת הודעות נוספות."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "המתן רגע. חלון זה ייסגר אוטומטית ברגע שנקבל את ההודעה שלך."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "המתנה בין הודעות. חברים עם ההרשאה \"{bypassSlowmodePermissionLabel}\" יכולים לעקוף זאת."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "המתן כאן"
@@ -38368,13 +38363,13 @@ msgstr "לא הצלחנו לקרוא את העיצוב הזה. ייתכן שהו
msgid "We couldn't remove that account. Try again."
msgstr "לא הצלחנו להסיר את החשבון הזה. יש לנסות שוב."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "לא הצלחנו לאמת את המספר הזה באופן אוטומטי. צור קשר עם התמיכה ונציג אנושי יבדוק את חשבונך."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "איננו שולחים הודעות אימות למדינה זו. נסה מספר נייד ממדינה אחרת, או פנה לתמיכה."
@@ -38469,9 +38464,9 @@ msgstr "נשלח קוד אימות לאימייל שלך לפני שתוכל ל
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "נשלח קוד אימות לאימייל שלך לפני שתוכל להציג את קודי הגיבוי שלך."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "נשלח קוד אימות ב-SMS כשזה יהיה זמין. מספר הטלפון שלך לא מקושר לחשבון. אנחנו שומרים רק סמן מוצפן, ללא מזהה משתמש, כדי לאפשר לכל היותר {PHONE_VERIFICATION_LIMIT} אימותים בתוך כ-{PHONE_VERIFICATION_WINDOW_DAYS} ימים."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "נשלח קוד SMS כשיגיע. המספר שלך לא מקושר לחשבון שלך. אנו שומרים רק סימון מוצפן, ללא מזהה משתמש, לזמן מוגבל."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "הסשן שלך ב-{productName} פג. היכנס שוב כדי להמש
msgid "Your account"
msgstr "החשבון שלך"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "החשבון שלך יחזור לקדמותו מיד ולא תזדקק למספר טלפון כעת. זה אינו פטור קבוע. הצטרפות לקהילה גדולה או ציבורית עשויה להחזיר את הבדיקה הזו."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "החשבון שלך יחזור למצב רגיל באופן מיידי ולא תזדקק למספר טלפון כעת. זו אינה פטורה קבועה, ואנו עשויים לבקש בדיקה זו שוב בעתיד."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "הכרטיס שלך מתאים. אנו מעבירים אותך עכשיו לדף התשלום."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "חברת הסלולר שלך מדווחת שהמספר הזה אינו פעיל. בדוק אותו ונסה שוב, או פנה לתמיכה אם הוא תקין."
@@ -40216,10 +40211,10 @@ msgstr "האימייל החדש שלך"
msgid "Your new nickname, or leave blank to reset it."
msgstr "הכינוי החדש שלך, או השאר ריק כדי לאפס אותו."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "המספר שלך אינו מקושר לחשבונך. אנחנו שומרים רק סמן מוצפן, ללא מזהה משתמש, לכל היותר {limit} אימותים בכ-{duration} ימים."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "המספר שלך אינו מקושר לחשבון שלך. אנו שומרים רק סימון מוצפן, ללא מזהה משתמש, לזמן מוגבל."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/hi/messages.po b/fluxer_app/src/features/i18n/locales/hi/messages.po
index e75da415f..26d8420ba 100644
--- a/fluxer_app/src/features/i18n/locales/hi/messages.po
+++ b/fluxer_app/src/features/i18n/locales/hi/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 दिन"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "फ़ोन वेरिफ़िकेशन से पहले ब्राउज़र जाँच ज़रूरी है। साइन-इन पेज से फिर से कोशिश करें या सहायता से संपर्क करें।"
@@ -5240,8 +5240,8 @@ msgstr "अभी दूर हूँ"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "वापस"
@@ -6451,7 +6451,7 @@ msgstr "यहां फ़ाइलें अपलोड नहीं की
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "कोल थीम"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "काउंटडाउन टाइमर"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "देश"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "ईमेल अनुपलब्ध है"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "ईमेल अपडेट अभी अनुपलब्ध है। बाद में फिर से कोशिश करें या सहायता से संपर्क करें।"
@@ -13999,7 +13999,7 @@ msgstr "मान्य {theOtherPlatform} टेम्पलेट यूआर
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "एक मान्य ईमेल पता डालें।"
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "एक वैध मैसेज लिंक डालें।"
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "एक मान्य मोबाइल फ़ोन नंबर डालें।"
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "एक मान्य फ़ोन नंबर डालें"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "{phoneNumber} पर भेजे गए {digitCount} अंकों वाला कोड डालें।"
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "{0} पर भेजे गए {MFA_CODE_DIGIT_COUNT} अंकों वाला कोड डालें।"
@@ -16137,7 +16137,7 @@ msgstr "अपना टैग कस्टमाइज़ करने या
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "नया कोड पाएँ"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "अपना ब्राउज़र खोलें, साइन इन करें, फिर अपना अकाउंट लिंक करने के लिए नीचे दिया गया कोड डालें।"
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "अपने मैसेज खोलें"
@@ -24047,12 +24047,12 @@ msgstr "अपने मैसेज खोलें"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "अपना पुराना {PRODUCT_NAME} ऐप खोलें और \"नया डिवाइस लिंक करें\" चुनें, फिर नीचे दिया गया कोड दर्ज करें।"
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "अपने फ़ोन का मैसेजिंग ऐप खोलें और एक नया टेक्स्ट मैसेज बनाएँ।"
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "अपने फ़ोन के मैसेजिंग ऐप को खोलें और एक नया टेक्स्ट मैसेज शुरू करें।"
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "हमारा फ़ोन नंबर चेक अभी डाउन है। यह हमारी गलती है, आपके नंबर की नहीं। कुछ मिनट रुकें और उसी नंबर को फिर से आज़माएँ।"
@@ -24810,21 +24810,21 @@ msgstr "फ़ोन"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "फ़ोन नंबर"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "फ़ोन नंबर ज़रूरी है"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "फ़ोन नंबर वेरिफ़ाई हो गया"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "फ़ोन स्टेप"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "इस अकाउंट के लिए फ़ोन वेरिफ़िकेशन उपलब्ध नहीं है। कोई दूसरा तरीका इस्तेमाल करें या सहायता से संपर्क करें।"
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "रीपोस्ट: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "पहले नए कोड का अनुरोध करें।"
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "कम्युनिटी खोजें"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "देश खोजें..."
@@ -29559,17 +29559,17 @@ msgstr "/tts के साथ टेक्स्ट-टू-स्पीच म
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "कोड <0>{0}</0> को <1>{1}</1> पर भेजें"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "नीचे दिए गए फ़ोन नंबर पर कोड भेजें।"
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "यह कोड भेजें"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "इस पिन को अतीत में वापस भेज दें?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "इस नंबर पर भेजें"
@@ -29606,16 +29606,11 @@ msgstr "वॉइस मैसेज भेजें"
msgid "Send:"
msgstr "भेजा:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "इस नंबर पर SMS भेजना महंगा है, इसलिए हम चाहते हैं कि आप हमें टेक्स्ट करें।"
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "{PRODUCT_NAME} के लिए इस फ़ोन नंबर पर SMS भेजना बहुत महंगा है, इसलिए हम चाहते हैं कि आप हमें SMS भेजें। हम जानते हैं कि यह आदर्श नहीं है। आप अपने अकाउंट से इस शर्त को हटवाने के लिए इस इंस्टेंस के एडमिनिस्ट्रेटर से भी कह सकते हैं।"
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "{PRODUCT_NAME} के लिए इस फ़ोन नंबर पर SMS भेजना बहुत महंगा है, इसलिए हम चाहते हैं कि आप हमें SMS भेजें। हम जानते हैं कि यह आदर्श नहीं है। आप अपने अकाउंट से इस शर्त को हटवाने के लिए <0>{SUPPORT_EMAIL}</0> पर भी संपर्क कर सकते हैं।"
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "ज़्यादा स्मूद वीडियो"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "SMS वेरिफ़िकेशन अभी उपलब्ध नहीं है। बाद में फिर से कोशिश करें या सहायता से संपर्क करें।"
@@ -31397,7 +31392,7 @@ msgstr "कुछ गड़बड़ हो गई। बाद में फि
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "कुछ गड़बड़ हो गई। फिर से कोशिश करें।"
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "स्टाफ़ कंट्रोल"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "आपके कैरियर से सामान्य मैसेजिंग दरें लागू हो सकती हैं।"
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "{productName} को सुरक्षित रखने में मदद करने के लिए धन्यवाद। हम जल्द से जल्द आपकी रिपोर्ट की समीक्षा करेंगे।"
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "वह कोड काम नहीं आया। इसे जांचें और फिर से कोशिश करें।"
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "वह कोड समाप्त हो गया है। नया कोड मांगें।"
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "यह एक मान्य यूआरएल नहीं लग रहा है।"
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "वह ईमेल पहले से उपयोग में है।"
@@ -34118,8 +34113,8 @@ msgstr "यह आपकी आखिरी पासकी है और पा
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "यह आपकी आखिरी पासकी है। इसके मिट जाने के बाद आप पासकी का उपयोग अपने दूसरे कारक के रूप में नहीं कर पाएँगे।"
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "यह मोबाइल नंबर नहीं है, इसलिए इस पर हमारा टेक्स्ट नहीं भेजा जा सकता। कोई मोबाइल नंबर आज़माएँ, या अगर आपको लगता है कि यह गलत है तो सहायता से संपर्क करें।"
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "यह निकनेम सिर्फ़ इस कम्युनिटी में दिखेगा"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "यह नंबर हमें टेक्स्ट करके ही वेरिफ़ाई किया जाता है। कोड और वह नंबर पाने के लिए, जिस पर टेक्स्ट करना है, वापस जाएं और फ़ोन वेरिफ़िकेशन फिर से शुरू करें।"
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "इस नंबर को हमारे SMS के बजाय टेक्स्ट-इन वेरिफ़िकेशन की ज़रूरत है।"
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "इस प्रतिभागी को मॉडरेटर ने डीफ़ेन किया है"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "इस फ़ोन नंबर का उपयोग नहीं किया जा सकता है। कोई दूसरा मोबाइल नंबर आज़माएँ या सहायता से संपर्क करें।"
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "यह फ़ोन नंबर पहले ही इस्तेमाल किया जा चुका है। कोई दूसरा नंबर आज़माएँ या सहायता से संपर्क करें।"
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "यह वेरिफ़िकेशन सेशन एक्सपायर हो गया है। {productName} पर वापस जाएं और चेकआउट फिर से शुरू करें।"
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "यह वेरिफ़िकेशन सेशन एक्सपायर हो गया है। फिर से शुरू करें।"
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "इससे सभी बाहरी लिंक पर भरोसा किया जाएगा और हर डोमेन के लिए चेतावनी को छोड़ दिया जाएगा। आपके मौजूदा भरोसेमंद डोमेन बदल दिए जाएँगे। यह कम सुरक्षित है।"
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "आपका मैसेज मिलने के बाद यह विंडो अपने आप अपडेट हो जाएगी।"
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "HDR इमेज को सामान्य रेंज में टोन-मैप करें, जिससे पीक ब्राइटनेस कम हो जाएगी।"
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "बहुत ज़्यादा कोशिशें की गई हैं। थोड़ी देर इंतज़ार करें, फिर से कोशिश करें।"
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "ऐसा ईमेल पता इस्तेमाल करें जिस तक आपकी पहुँच हो। हम उस पर एक कोड भेजेंगे।"
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "ऐसा ईमेल इस्तेमाल करें जो आपके मौजूदा ईमेल से अलग हो।"
@@ -37318,17 +37313,17 @@ msgstr "पुष्टि करें कि यह आप ही हैं"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "फ़ोन वेरिफ़ाई करें"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "फ़ोन नंबर वेरिफ़ाई करें"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "फ़ोन नंबर वेरिफ़ाई करने का फ़ॉर्म"
@@ -38192,7 +38187,7 @@ msgstr "आवाज़ बढ़ाएँ"
msgid "Wait a moment before deleting more messages."
msgstr "और मैसेज डिलीट करने से पहले थोड़ा इंतज़ार करें।"
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "थोड़ा इंतज़ार करें। आपका मैसेज मिलते ही यह विंडो अपने-आप बंद हो जाएगी।"
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "मैसेज के बीच इंतज़ार करें। जिन सदस्यों के पास \"{bypassSlowmodePermissionLabel}\" अनुमति है, वे इसे बायपास कर सकते हैं।"
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "यहां इंतज़ार करें"
@@ -38368,13 +38363,13 @@ msgstr "हम इस थीम को पढ़ नहीं पाए। ह
msgid "We couldn't remove that account. Try again."
msgstr "हम उस अकाउंट को हटा नहीं पाए। फिर से कोशिश करें।"
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "हम इस नंबर को अपने-आप वेरिफ़ाई नहीं कर सके। सहायता से संपर्क करें, कोई व्यक्ति आपके अकाउंट की समीक्षा करेगा।"
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "हम इस देश में वेरिफ़िकेशन टेक्स्ट नहीं भेजते। किसी दूसरे देश का मोबाइल नंबर आज़माएँ, या सहायता से संपर्क करें।"
@@ -38469,9 +38464,9 @@ msgstr "आपका पासवर्ड बदलने से पहले
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "आपके बैकअप कोड देखने से पहले हम आपके ईमेल पर एक वेरिफ़िकेशन कोड भेजेंगे।"
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "उपलब्ध होने पर हम एक SMS कोड भेजेंगे। आपका नंबर आपके अकाउंट से लिंक नहीं है। हम केवल एक एन्क्रिप्टेड मार्कर रखते हैं, जिसमें कोई यूज़र ID नहीं होती, ताकि लगभग {PHONE_VERIFICATION_WINDOW_DAYS} दिनों में ज़्यादा से ज़्यादा {PHONE_VERIFICATION_LIMIT} वेरिफ़िकेशन की अनुमति मिल सके।"
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "उपलब्ध होने पर हम एक SMS कोड भेजेंगे। आपका नंबर आपके खाते से लिंक नहीं है। हम सीमित समय के लिए, बिना किसी उपयोगकर्ता आईडी के, केवल एक एन्क्रिप्टेड मार्कर रखते हैं।"
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "आपका {productName} सेशन समाप्त हो गय
msgid "Your account"
msgstr "आपका अकाउंट"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "आपका अकाउंट तुरंत सामान्य हो जाएगा और अभी आपको फ़ोन नंबर की ज़रूरत नहीं होगी। यह कोई स्थायी छूट नहीं है। किसी बड़ी या सार्वजनिक कम्युनिटी में शामिल होने पर यह जाँच फिर से आ सकती है।"
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "आपका खाता तुरंत सामान्य हो जाएगा और अब आपको फ़ोन नंबर की आवश्यकता नहीं होगी। यह एक स्थायी छूट नहीं है, और हम बाद में फिर से यह जाँच माँग सकते हैं।"
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "आपका कार्ड योग्य है। आपको अभी भुगतान पेज पर रीडायरेक्ट किया जा रहा है।"
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "आपका कैरियर कह रहा है कि यह नंबर सेवा में नहीं है। इसे जाँचें और फिर से कोशिश करें, या अगर यह सही है तो सहायता से संपर्क करें।"
@@ -40216,10 +40211,10 @@ msgstr "आपका नया ईमेल"
msgid "Your new nickname, or leave blank to reset it."
msgstr "आपका नया उपनाम, या इसे रीसेट करने के लिए खाली छोड़ दें।"
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "आपका नंबर आपके अकाउंट से लिंक नहीं है। हम बिना किसी यूज़र आईडी के, ज़्यादा से ज़्यादा {limit} वेरिफ़िकेशन के लिए, लगभग {duration} दिनों तक सिर्फ़ एक एन्क्रिप्टेड मार्कर रखते हैं।"
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "आपका नंबर आपके खाते से लिंक नहीं है। हम सीमित समय के लिए, बिना किसी उपयोगकर्ता आईडी के, केवल एक एन्क्रिप्टेड मार्कर रखते हैं।"
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/hr/messages.po b/fluxer_app/src/features/i18n/locales/hr/messages.po
index 774eb2473..648ff15b7 100644
--- a/fluxer_app/src/features/i18n/locales/hr/messages.po
+++ b/fluxer_app/src/features/i18n/locales/hr/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dana"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Potrebna je provjera preglednika prije provjere telefona. Pokušajte ponovno sa stranice za prijavu ili se obratite podršci."
@@ -5240,8 +5240,8 @@ msgstr "Trenutno odsutan"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Natrag"
@@ -6451,7 +6451,7 @@ msgstr "Ovdje nije moguće učitati datoteke"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Ugljena tema"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Odbrojavanje"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Država"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-pošta nedostupna"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Ažuriranje e-pošte trenutačno nije dostupno. Pokušajte ponovno kasnije ili se obratite podršci."
@@ -13999,7 +13999,7 @@ msgstr "Unesite valjani URL ili kod predloška za {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Unesite valjanu adresu e-pošte."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Unesite valjanu poveznicu poruke."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Unesite valjani broj mobilnog telefona."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Unesite valjani telefonski broj"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Unesite {digitCount}-znamenkasti kod poslan na {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Unesite {MFA_CODE_DIGIT_COUNT}-znamenkasti kod poslan na {0}."
@@ -16137,7 +16137,7 @@ msgstr "Nabavite {premiumProductName} da biste prilagodili svoju oznaku ili je z
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Zatraži novi kôd"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Otvorite preglednik, prijavite se, a zatim unesite kôd u nastavku za povezivanje računa."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Otvorite poruke"
@@ -24047,12 +24047,12 @@ msgstr "Otvorite poruke"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Otvorite svoju staru aplikaciju {PRODUCT_NAME} i odaberite \"Poveži novi uređaj\", a zatim unesite kod ispod."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Otvorite aplikaciju za poruke na svom telefonu i stvorite novu tekstualnu poruku."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Otvorite aplikaciju za poruke na telefonu i započnite novu tekstualnu poruku."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Naša provjera telefonskih brojeva trenutačno ne radi. Do nas je, a ne do vašeg broja. Pričekajte nekoliko minuta i pokušajte ponovno s istim brojem."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Broj telefona"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Broj telefona je obavezan"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Broj telefona potvrđen"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Korak telefona"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Telefonska provjera nije dostupna za ovaj račun. Upotrijebite drugu metodu ili se obratite podršci."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Ponovne objave: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Prvo zatražite novi kôd."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Pretražite zajednice"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Pretražite države..."
@@ -29559,17 +29559,17 @@ msgstr "Šaljite poruke pretvaranjem teksta u govor pomoću /tts. Članovi koji
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Pošaljite kod <0>{0}</0> na <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Pošaljite kod na telefonski broj u nastavku."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Pošalji ovaj kod"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Vratiti ovu prikvačenu poruku u prošlost?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Pošalji na"
@@ -29606,16 +29606,11 @@ msgstr "Pošalji glasovnu poruku"
msgid "Send:"
msgstr "Slanje:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Slanje SMS-a na ovaj broj je skupo, stoga nam ga trebate poslati vi."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Slanje SMS-a na ovaj broj telefona preskupo je za {PRODUCT_NAME}, stoga nam ga morate poslati vi. Znamo da ovo nije idealno. Također možete zamoliti administratore ove instance da uklone ovaj zahtjev s vašeg računa."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Slanje SMS-a na ovaj broj telefona preskupo je za {PRODUCT_NAME}, stoga nam ga morate poslati vi. Znamo da ovo nije idealno. Također možete kontaktirati <0>{SUPPORT_EMAIL}</0> kako bismo uklonili ovaj zahtjev s vašeg računa."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Glađi videozapis"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "SMS provjera trenutačno nije dostupna. Pokušajte ponovno kasnije ili se obratite podršci."
@@ -31397,7 +31392,7 @@ msgstr "Nešto je pošlo po zlu. Pokušajte ponovno kasnije."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Nešto je pošlo po zlu. Pokušajte ponovno."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Kontrole za osoblje"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Mogu se primjenjivati standardne naknade za poruke vašeg operatera."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Hvala vam što nam pomažete održati {productName} sigurnim. Pregledat ćemo vašu prijavu što je prije moguće."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Taj kôd ne radi. Provjerite ga i pokušajte ponovno."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Taj je kôd istekao. Zatražite novi kôd."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Čini se da ovo nije valjan URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Ta se adresa e-pošte već koristi."
@@ -34118,8 +34113,8 @@ msgstr "Ovo je vaš posljednji pristupni ključ, a pristupni ključevi su vaš d
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Ovo je vaš posljednji pristupni ključ. Kada ga više ne bude, nećete moći koristiti pristupni ključ kao drugi faktor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Ovo nije broj mobitela, stoga ne može primiti naš SMS. Pokušajte s brojem mobitela ili se obratite podršci ako mislite da je ovo pogrešno."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Ovaj nadimak bit će vidljiv samo u ovoj zajednici"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Ovaj se broj provjerava tako da vi pošaljete poruku nama. Vratite se i ponovno pokrenite provjeru telefonskog broja kako biste dobili kod i broj na koji šaljete poruku."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Za ovaj broj provjera se radi tako da vi pošaljete poruku nama, a ne mi SMS vama."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Moderatori su ovom sudioniku isključili zvuk"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Ovaj telefonski broj ne može se koristiti. Pokušajte s drugim brojem mobitela ili se obratite podršci."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Ovaj je telefonski broj već korišten. Pokušajte s drugim brojem ili se obratite podršci."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Sesija provjere je istekla. Vratite se u {productName} i ponovno pokrenite naplatu."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Ova sesija provjere je istekla. Počnite ponovno."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Time ćete vjerovati svim vanjskim poveznicama i preskočiti upozorenje za svaku domenu. Vaše postojeće pouzdane domene bit će zamijenjene. Ovo je manje sigurno."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Ovaj se prozor automatski ažurira nakon što primimo vašu poruku."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Preslikavanje HDR slika na standardni raspon, smanjujući vršnu svjetlinu."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Previše pokušaja. Pričekajte malo, pa pokušajte ponovno."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Koristite e-poštu koju možete otvoriti. Tamo ćemo poslati kôd."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Koristite e-poštu koja se razlikuje od vaše trenutačne."
@@ -37318,17 +37313,17 @@ msgstr "Potvrdite da ste to vi"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Potvrdite telefon"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Potvrdite telefonski broj"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Obrazac za potvrdu telefonskog broja"
@@ -38192,7 +38187,7 @@ msgstr "Povećaj glasnoću"
msgid "Wait a moment before deleting more messages."
msgstr "Pričekajte trenutak prije brisanja više poruka."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Pričekajte trenutak. Ovaj će se prozor automatski zatvoriti čim primimo vašu poruku."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Vrijeme čekanja između poruka. Članovi s dopuštenjem \"{bypassSlowmodePermissionLabel}\" mogu ga zaobići."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Pričekajte ovdje"
@@ -38368,13 +38363,13 @@ msgstr "Nismo mogli učitati ovu temu. Možda je oštećena ili nevažeća."
msgid "We couldn't remove that account. Try again."
msgstr "Nismo mogli ukloniti taj račun. Pokušajte ponovno."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Nismo mogli automatski provjeriti ovaj broj. Obratite se podršci i osoba će pregledati vaš račun."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Ne šaljemo poruke za provjeru u ovu državu. Pokušajte s mobilnim brojem iz druge države ili se obratite podršci."
@@ -38469,9 +38464,9 @@ msgstr "Poslat ćemo vam kod za provjeru na e-poštu prije nego što možete pro
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Poslat ćemo vam kod za provjeru na vašu e-poštu prije nego što možete vidjeti svoje rezervne kodove."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Poslat ćemo SMS kod kada bude dostupan. Vaš broj nije povezan s vašim računom. Čuvamo samo šifrirani marker, bez korisničkog ID-a, kako bismo omogućili najviše {PHONE_VERIFICATION_LIMIT} provjera u otprilike {PHONE_VERIFICATION_WINDOW_DAYS} dana."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Poslat ćemo SMS kod čim bude dostupan. Vaš broj nije povezan s vašim računom. Zadržavamo samo enkriptirani identifikator, bez korisničkog ID-a, na ograničeno vrijeme."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Vaša je sesija za {productName} istekla. Prijavite se ponovno kako bist
msgid "Your account"
msgstr "Vaš račun"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Račun vam se odmah vraća u normalno stanje i sada vam neće trebati broj telefona. Ovo nije trajno izuzeće. Pridruživanje velikoj ili javnoj zajednici može ponovno pokrenuti ovu provjeru."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Račun vam se odmah vraća u normalu i više vam neće trebati broj telefona. Ovo nije trajno izuzeće i možemo ponovno zatražiti ovu provjeru kasnije."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Vaša kartica ispunjava uvjete. Preusmjeravamo vas na stranicu za plaćanje."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Vaš operater kaže da taj broj nije u upotrebi. Provjerite ga i pokušajte ponovno, ili se obratite podršci ako je ispravan."
@@ -40216,10 +40211,10 @@ msgstr "vaša nova e-pošta"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Vaš novi nadimak ili ostavite prazno za poništavanje."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Vaš broj nije povezan s vašim računom. Čuvamo samo šifrirani marker, bez korisničkog ID-a, za najviše {limit} provjera u otprilike {duration} dana."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Vaš broj nije povezan s vašim računom. Zadržavamo samo šifrirani pokazatelj, bez korisničkog ID-a, na ograničeno vrijeme."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/hu/messages.po b/fluxer_app/src/features/i18n/locales/hu/messages.po
index 1f15833e8..ad1d6c893 100644
--- a/fluxer_app/src/features/i18n/locales/hu/messages.po
+++ b/fluxer_app/src/features/i18n/locales/hu/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 nap"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "A telefonszám ellenőrzése előtt böngészőellenőrzés szükséges. Próbáld újra a bejelentkezési oldalról, vagy fordulj az ügyfélszolgálathoz."
@@ -5240,8 +5240,8 @@ msgstr "Jelenleg távol"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Vissza"
@@ -6451,7 +6451,7 @@ msgstr "Ide nem tölthetsz fel fájlokat"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Szén téma"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Visszaszámláló"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Ország"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mail nem elérhető"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Az e-mail-cím frissítése jelenleg nem érhető el. Próbáld újra később, vagy fordulj az ügyfélszolgálathoz."
@@ -13999,7 +13999,7 @@ msgstr "Adj meg egy érvényes sablon-URL-t vagy -kódot a(z) {theOtherPlatform}
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Érvényes e-mail-címet adj meg."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Érvényes üzenetlinket adj meg."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Adj meg egy érvényes mobilszámot."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Adj meg egy érvényes telefonszámot"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Add meg a(z) {phoneNumber} telefonszámra küldött {digitCount} számjegyű kódot."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Add meg a(z) {MFA_CODE_DIGIT_COUNT} számjegyű kódot, amelyet ide küldtünk: {0}."
@@ -16137,7 +16137,7 @@ msgstr "Szerezd be a(z) {premiumProductName} csomagot, hogy testre szabd a címk
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Új kód kérése"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Nyisd meg a böngésződet, jelentkezz be, majd add meg az alábbi kódot a fiókod összekapcsolásához."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Nyisd meg az üzeneteidet"
@@ -24047,12 +24047,12 @@ msgstr "Nyisd meg az üzeneteidet"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Nyisd meg a régi {PRODUCT_NAME} alkalmazásodat, válaszd az „Új eszköz csatolása” lehetőséget, majd add meg az alábbi kódot."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Nyisd meg a telefonod üzenetküldő alkalmazását, és hozz létre egy új szöveges üzenetet."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Nyisd meg a telefonod üzenetküldő alkalmazását, és kezdj új szöveges üzenetet."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Jelenleg nem elérhető a telefonszám-ellenőrzésünk. Ez a mi hibánk, nem a számé. Várj pár percet, és próbáld meg újra ugyanazzal a számmal."
@@ -24810,21 +24810,21 @@ msgstr "Telefonszám"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefonszám"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Telefonszám megadása kötelező"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefonszám ellenőrizve"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Telefonos lépés"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "A telefonszám-ellenőrzés nem érhető el ehhez a fiókhoz. Használj másik módszert, vagy fordulj az ügyfélszolgálathoz."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Újraközlések: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Előbb kérj egy új kódot."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Közösségek keresése"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Országok keresése..."
@@ -29559,17 +29559,17 @@ msgstr "Felolvasandó üzenetek küldése a /tts paranccsal. Azok a tagok, akik
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Küldd el a(z) <0>{0}</0> kódot ide: <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Küldd el a kódot az alábbi telefonszámra."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Küldd el ezt a kódot"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Visszaküldöd ezt a rögzítést az időben?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Küldés ide"
@@ -29606,16 +29606,11 @@ msgstr "Hangüzenet küldése"
msgid "Send:"
msgstr "Küldés:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Az SMS küldése erre a számra költséges, ezért azt kérjük, hogy inkább te küldj nekünk üzenetet."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Túl drága lenne a(z) {PRODUCT_NAME} számára, ha SMS-t küldenénk erre a telefonszámra, ezért arra kérünk, hogy te küldj nekünk egy SMS-t. Tudjuk, hogy ez nem ideális. Megkérheted ennek a példánynak az adminisztrátorait is, hogy oldják fel ezt a korlátozást a fiókodon."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Túl drága lenne a(z) {PRODUCT_NAME} számára, ha SMS-t küldenénk erre a telefonszámra, ezért arra kérünk, hogy te küldj nekünk egy SMS-t. Tudjuk, hogy ez nem ideális. Felveheted a kapcsolatot a(z) <0>{SUPPORT_EMAIL}</0> címen is, hogy feloldjuk ezt a korlátozást a fiókodon."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Folyamatosabb videó"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Az SMS-ellenőrzés jelenleg nem érhető el. Próbáld újra később, vagy fordulj az ügyfélszolgálathoz."
@@ -31397,7 +31392,7 @@ msgstr "Hiba történt. Próbáld újra később."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Hiba történt. Próbáld újra."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Személyzeti vezérlők"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "A szolgáltatód szokásos üzenetküldési díjai érvényesek lehetnek."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Köszönjük, hogy segítesz megőrizni a(z) {productName} biztonságát. A bejelentésedet a lehető leghamarabb megvizsgáljuk."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Ez a kód nem működött. Ellenőrizd, és próbáld újra."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Ez a kód lejárt. Kérj új kódot."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Ez nem tűnik érvényes URL-nek."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Ez az e-mail-cím már használatban van."
@@ -34118,8 +34113,8 @@ msgstr "Ez az utolsó jelszókulcsod, és a jelszókulcsok a második hitelesít
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Ez az utolsó jelszókulcsod. Ha törlöd, nem tudsz többé jelszókulcsot használni második hitelesítési tényezőként."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Ez nem mobiltelefonszám, így nem tudunk rá SMS-t küldeni. Próbálkozz egy mobiltelefonszámmal, vagy vedd fel a kapcsolatot az ügyfélszolgálattal, ha úgy gondolod, hogy ez hiba."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Ez a becenév csak ebben a közösségben lesz látható"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Ezt a számot úgy igazolhatod, hogy te küldesz nekünk SMS-t. Lépj vissza, és indítsd újra a telefonos ellenőrzést, hogy megkapd az elküldendő kódot és a címzett telefonszámát."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Ezt a számot nekünk küldött SMS-sel kell igazolnod, tőlünk kapott SMS helyett."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "A moderátorok kikapcsolták a hangot ennél a résztvevőnél"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Ez a telefonszám nem használható. Próbálj másik mobilszámot, vagy fordulj az ügyfélszolgálathoz."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Ezt a telefonszámot már használták. Próbálj másik számot, vagy fordulj az ügyfélszolgálathoz."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Ez az ellenőrzési munkamenet lejárt. Térj vissza a(z) {productName} alkalmazásba, és indítsd újra a fizetést."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Ez az ellenőrzési munkamenet lejárt. Kezdd újra."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Ez megbízhatónak jelöl minden külső hivatkozást, és kihagyja a figyelmeztetést minden domain esetében. A meglévő megbízható domainjeid felülíródnak. Ez kevésbé biztonságos."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Ez az ablak automatikusan frissül, amint megkapjuk az üzenetedet."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "A HDR képek tónusleképezése normál tartományba, csökkentve a csúcsfényerőt."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Túl sok próbálkozás. Várj egy kicsit, majd próbáld újra."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Olyan e-mail-címet használj, amit meg tudsz nyitni. Kódot küldünk oda."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Olyan e-mail-címet használj, amely eltér a jelenlegitől."
@@ -37318,17 +37313,17 @@ msgstr "Igazold, hogy te vagy az"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Telefonszám ellenőrzése"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Telefonszám ellenőrzése"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Telefonszám-ellenőrző űrlap"
@@ -38192,7 +38187,7 @@ msgstr "Hangerő növelése"
msgid "Wait a moment before deleting more messages."
msgstr "Várj egy pillanatot, mielőtt további üzeneteket törölsz."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Várj egy pillanatot. Ez az ablak automatikusan bezáródik, amint megkapjuk az üzenetedet."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Várakozás az üzenetek között. A(z) „{bypassSlowmodePermissionLabel}” jogosultsággal rendelkező tagok ezt megkerülhetik."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Várj itt"
@@ -38368,13 +38363,13 @@ msgstr "Nem tudtuk beolvasni ezt a témát. Lehet, hogy sérült vagy érvényte
msgid "We couldn't remove that account. Try again."
msgstr "Nem sikerült eltávolítani a fiókot. Próbáld újra."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Nem tudtuk automatikusan ellenőrizni ezt a számot. Vedd fel a kapcsolatot az ügyfélszolgálattal, és egy munkatárs átnézi a fiókodat."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Nem küldünk ellenőrző SMS-eket ebbe az országba. Próbálkozz egy másik országból származó mobilszámmal, vagy lépj kapcsolatba az ügyfélszolgálattal."
@@ -38469,9 +38464,9 @@ msgstr "Jelszóváltoztatás előtt ellenőrző kódot küldünk az e-mail-címe
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "A biztonsági kódjaid megtekintése előtt ellenőrző kódot küldünk az e-mail-címedre."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Ha elérhető lesz, SMS-ben küldünk egy kódot. A telefonszámod nincs összekapcsolva a fiókoddal. Csak egy titkosított jelölőt tárolunk, felhasználói azonosító nélkül, hogy legfeljebb {PHONE_VERIFICATION_LIMIT} ellenőrzést engedélyezzünk körülbelül {PHONE_VERIFICATION_WINDOW_DAYS} napon belül."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "SMS-kódot küldünk, amint elérhető lesz. A számod nincs összekapcsolva a fiókoddal. Csak egy titkosított jelölőt tárolunk, felhasználói azonosító nélkül, korlátozott ideig."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Lejárt a(z) {productName} munkameneted. Jelentkezz be újra, hogy folyt
msgid "Your account"
msgstr "A fiókod"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "A fiókod azonnal visszaáll a normál állapotba, és most nem lesz szükséged telefonszámra. Ez nem állandó kivétel. Egy nagy vagy nyilvános közösséghez való csatlakozás esetén ez az ellenőrzés újra megjelenhet."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Fiókod azonnal visszaáll a normál állapotba, és most nem lesz szükséged telefonszámra. Ez nem végleges mentesség, és később kérhetünk újabb ellenőrzést."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "A kártyád megfelel a feltételeknek. Most átirányítunk a fizetési oldalra."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "A szolgáltatód szerint ez a szám nem aktív. Ellenőrizd, és próbáld újra, vagy vedd fel a kapcsolatot az ügyfélszolgálattal, ha a szám helyes."
@@ -40216,10 +40211,10 @@ msgstr "az új e-mail-címed"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Az új beceneved, vagy hagyd üresen az alapértelmezés visszaállításához."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "A telefonszámod nincs összekapcsolva a fiókoddal. Csak egy titkosított jelölőt tárolunk, felhasználói azonosító nélkül, legfeljebb {limit} ellenőrzéshez, körülbelül {duration} napig."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "A számod nincs összekapcsolva a fiókoddal. Csak egy titkosított jelölőt tárolunk, felhasználói azonosító nélkül, korlátozott ideig."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/id/messages.po b/fluxer_app/src/features/i18n/locales/id/messages.po
index 7493173f2..ca2b182b6 100644
--- a/fluxer_app/src/features/i18n/locales/id/messages.po
+++ b/fluxer_app/src/features/i18n/locales/id/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 hari"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Pemeriksaan browser diperlukan sebelum verifikasi telepon. Coba lagi dari halaman masuk atau hubungi dukungan."
@@ -5240,8 +5240,8 @@ msgstr "Sedang tidak di tempat"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Kembali"
@@ -6451,7 +6451,7 @@ msgstr "Tidak bisa mengunggah file di sini"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Tema batu bara"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Timer hitung mundur"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Negara"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Email tidak tersedia"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Pembaruan email tidak tersedia saat ini. Coba lagi nanti atau hubungi dukungan."
@@ -13999,7 +13999,7 @@ msgstr "Masukkan URL atau kode template {theOtherPlatform} yang valid."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Masukkan alamat email yang valid."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Masukkan tautan pesan yang valid."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Masukkan nomor ponsel yang valid."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Masukkan nomor telepon yang valid"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Masukkan kode {digitCount} digit yang dikirim ke {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Masukkan kode {MFA_CODE_DIGIT_COUNT} digit yang dikirim ke {0}."
@@ -16137,7 +16137,7 @@ msgstr "Dapatkan {premiumProductName} untuk menyesuaikan tagmu atau mempertahank
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Dapatkan kode baru"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Buka browsermu, masuk, lalu masukkan kode di bawah untuk menautkan akunmu."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Buka pesanmu"
@@ -24047,12 +24047,12 @@ msgstr "Buka pesanmu"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Buka aplikasi {PRODUCT_NAME} lamamu dan pilih Tautkan perangkat baru, lalu masukkan kode di bawah ini."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Buka aplikasi pesan di ponselmu dan buat pesan teks baru."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Buka aplikasi pesan di ponselmu dan mulai pesan teks baru."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Pemeriksaan nomor telepon kami sedang tidak berfungsi. Ini masalah di sisi kami, bukan nomormu. Tunggu beberapa menit, lalu coba nomor yang sama lagi."
@@ -24810,21 +24810,21 @@ msgstr "Telepon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Nomor telepon"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Nomor telepon wajib diisi"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Nomor telepon terverifikasi"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Langkah telepon"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Verifikasi telepon tidak tersedia untuk akun ini. Gunakan metode lain atau hubungi dukungan."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Postingan ulang: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Minta kode baru terlebih dahulu."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Cari komunitas"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Cari negara..."
@@ -29559,17 +29559,17 @@ msgstr "Kirim pesan text-to-speech dengan /tts. Anggota yang mengaktifkan text-t
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Kirim kode <0>{0}</0> ke <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Kirim kode ke nomor telepon di bawah."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Kirim kode ini"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Kirim sematan ini kembali ke masa lalu?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Kirim ke"
@@ -29606,16 +29606,11 @@ msgstr "Kirim pesan suara"
msgid "Send:"
msgstr "Kirim:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Mengirim SMS ke nomor ini mahal, jadi kami minta kamu yang mengirim SMS ke kami."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Mengirim SMS ke nomor telepon ini terlalu mahal untuk {PRODUCT_NAME}, jadi kami minta kamu yang mengirim SMS ke kami. Kami tahu ini kurang ideal. Kamu juga bisa meminta administrator instance ini untuk menghapus persyaratan ini dari akunmu."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Mengirim SMS ke nomor telepon ini terlalu mahal untuk {PRODUCT_NAME}, jadi kami minta kamu yang mengirim SMS ke kami. Kami tahu ini kurang ideal. Kamu juga bisa menghubungi <0>{SUPPORT_EMAIL}</0> agar kami menghapus persyaratan ini dari akunmu."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Video lebih lancar"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Verifikasi SMS tidak tersedia saat ini. Coba lagi nanti atau hubungi dukungan."
@@ -31397,7 +31392,7 @@ msgstr "Terjadi kesalahan. Coba lagi nanti."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Terjadi kesalahan. Coba lagi."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Kontrol staf"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Tarif pesan standar dari operatormu mungkin berlaku."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Terima kasih telah membantu menjaga {productName} tetap aman. Kami akan meninjau laporanmu sesegera mungkin."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Kode itu tidak berfungsi. Periksa dan coba lagi."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Kode tersebut sudah kedaluwarsa. Minta kode baru."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Itu bukan URL yang valid."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Email tersebut sudah digunakan."
@@ -34118,8 +34113,8 @@ msgstr "Ini passkey terakhirmu dan passkey adalah faktor keduamu. Menghapusnya a
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Ini passkey terakhirmu. Setelah dihapus, kamu tidak bisa lagi menggunakan passkey sebagai faktor keduamu."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Ini bukan nomor ponsel, jadi tidak bisa menerima SMS kami. Coba gunakan nomor ponsel, atau hubungi dukungan jika kamu merasa ini salah."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Nama panggilan ini hanya akan terlihat di komunitas ini"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Nomor ini diverifikasi dengan mengirim SMS ke kami. Kembali dan mulai lagi verifikasi telepon untuk mendapatkan kode dan nomor tujuan SMS-nya."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Nomor ini perlu diverifikasi dengan mengirim SMS ke kami, bukan menerima SMS dari kami."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Suara masuk peserta ini dibisukan oleh moderator"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Nomor telepon ini tidak dapat digunakan. Coba nomor ponsel lain atau hubungi dukungan."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Nomor telepon ini sudah digunakan. Coba nomor lain atau hubungi dukungan."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Sesi verifikasi ini telah kedaluwarsa. Kembali ke {productName} dan mulai pembayaran lagi."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Sesi verifikasi ini telah kedaluwarsa. Mulai lagi."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Ini akan memercayai semua tautan eksternal dan melewati peringatan untuk setiap domain. Domain tepercayamu yang sudah ada akan diganti. Ini kurang aman."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Jendela ini akan diperbarui secara otomatis setelah kami menerima pesanmu."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Petakan nada gambar HDR ke rentang standar untuk mengurangi kecerahan puncak."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Terlalu banyak percobaan. Tunggu sebentar, lalu coba lagi."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Gunakan email yang bisa kamu akses. Kami akan mengirimkan kode ke sana."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Gunakan email yang berbeda dari emailmu saat ini."
@@ -37318,17 +37313,17 @@ msgstr "Verifikasi bahwa ini kamu"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verifikasi telepon"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verifikasi nomor telepon"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulir verifikasi nomor telepon"
@@ -38192,7 +38187,7 @@ msgstr "Naikkan volume"
msgid "Wait a moment before deleting more messages."
msgstr "Tunggu sebentar sebelum menghapus pesan lagi."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Tunggu sebentar. Jendela ini akan tertutup otomatis setelah kami menerima pesanmu."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Jeda antar pesan. Anggota dengan \"{bypassSlowmodePermissionLabel}\" dapat melewati ini."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Tunggu di sini"
@@ -38368,13 +38363,13 @@ msgstr "Kami tidak dapat membaca tema ini. Mungkin rusak atau tidak valid."
msgid "We couldn't remove that account. Try again."
msgstr "Kami tidak dapat menghapus akun tersebut. Coba lagi."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Kami tidak dapat memverifikasi nomor ini secara otomatis. Hubungi dukungan dan seseorang akan meninjau akunmu."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Kami tidak mengirim SMS verifikasi ke negara ini. Coba nomor ponsel dari negara lain, atau hubungi dukungan."
@@ -38469,9 +38464,9 @@ msgstr "Kami akan mengirimkan kode verifikasi ke emailmu sebelum kamu dapat meng
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Kami akan mengirimkan kode verifikasi ke emailmu sebelum kamu dapat melihat kode cadanganmu."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Kami akan mengirimkan kode SMS jika tersedia. Nomormu tidak tertaut ke akunmu. Kami hanya menyimpan penanda terenkripsi, tanpa ID pengguna, untuk mengizinkan paling banyak {PHONE_VERIFICATION_LIMIT} verifikasi dalam sekitar {PHONE_VERIFICATION_WINDOW_DAYS} hari."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Kami akan mengirimkan kode SMS jika tersedia. Nomor Anda tidak ditautkan ke akun Anda. Kami hanya menyimpan penanda terenkripsi, tanpa ID pengguna, untuk waktu terbatas."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Sesi {productName} kamu telah berakhir. Masuk lagi untuk melanjutkan oto
msgid "Your account"
msgstr "Akunmu"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Akunmu langsung kembali normal dan kamu tidak perlu nomor telepon untuk saat ini. Ini bukan pengecualian permanen. Bergabung dengan komunitas besar atau publik bisa memunculkan pemeriksaan ini lagi."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Akun Anda akan kembali normal segera dan Anda tidak akan memerlukan nomor telepon sekarang. Ini bukan pengecualian permanen, dan kami dapat meminta pemeriksaan ini lagi nanti."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Kartumu memenuhi syarat. Kamu akan dialihkan ke halaman pembayaran sekarang."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Operatormu menyatakan nomor ini tidak aktif. Periksa kembali lalu coba lagi, atau hubungi dukungan jika nomornya sudah benar."
@@ -40216,10 +40211,10 @@ msgstr "email barumu"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Nama panggilan barumu, atau kosongkan untuk mengatur ulang."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Nomormu tidak ditautkan ke akunmu. Kami hanya menyimpan penanda terenkripsi, tanpa ID pengguna, untuk paling banyak {limit} verifikasi dalam sekitar {duration} hari."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Nomor Anda tidak tertaut ke akun Anda. Kami hanya menyimpan penanda terenkripsi, tanpa ID pengguna, untuk waktu yang terbatas."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/it/messages.po b/fluxer_app/src/features/i18n/locales/it/messages.po
index a1975e1d3..a89c95b76 100644
--- a/fluxer_app/src/features/i18n/locales/it/messages.po
+++ b/fluxer_app/src/features/i18n/locales/it/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 giorni"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "È richiesto un controllo del browser prima della verifica telefonica. Riprova dalla pagina di accesso o contatta il supporto."
@@ -5240,8 +5240,8 @@ msgstr "Assente in questo momento"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Indietro"
@@ -6451,7 +6451,7 @@ msgstr "Impossibile caricare file qui"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Tema carbone"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Timer conto alla rovescia"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Paese"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Email non disponibile"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "L'aggiornamento dell'email non è disponibile al momento. Riprova più tardi o contatta l'assistenza."
@@ -13999,7 +13999,7 @@ msgstr "Inserisci un URL o un codice modello {theOtherPlatform} valido."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Inserisci un indirizzo email valido."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Inserisci un link del messaggio valido."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Inserisci un numero di cellulare valido."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Inserisci un numero di telefono valido"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Inserisci il codice di {digitCount} cifre inviato a {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Inserisci il codice di {MFA_CODE_DIGIT_COUNT} cifre inviato a {0}."
@@ -16137,7 +16137,7 @@ msgstr "Ottieni {premiumProductName} per personalizzare il tuo tag o mantenerlo
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Ricevi nuovo codice"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Apri il browser, accedi, quindi inserisci il codice qui sotto per collegare il tuo account."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Apri i tuoi messaggi"
@@ -24047,12 +24047,12 @@ msgstr "Apri i tuoi messaggi"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Apri la tua vecchia app {PRODUCT_NAME} e scegli Collega un nuovo dispositivo, quindi inserisci il codice qui sotto."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Apri l'app Messaggi del tuo telefono e crea un nuovo SMS."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Apri l’app di messaggistica del tuo telefono e crea un nuovo SMS."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Il nostro servizio di verifica dei numeri di telefono è temporaneamente fuori servizio. Il problema dipende da noi, non dal tuo numero. Attendi qualche minuto e riprova con lo stesso numero."
@@ -24810,21 +24810,21 @@ msgstr "Telefono"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Numero di telefono"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Numero di telefono obbligatorio"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Numero di telefono verificato"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Passaggio telefonico"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "La verifica telefonica non è disponibile per questo account. Usa un altro metodo o contatta l'assistenza."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Ripubblicazioni: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Richiedi prima un nuovo codice."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Cerca community"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Cerca Paesi..."
@@ -29559,17 +29559,17 @@ msgstr "Invia messaggi di sintesi vocale con /tts. I membri che hanno attivato l
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Invia il codice <0>{0}</0> a <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Invia il codice al numero di telefono qui sotto."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Invia questo codice"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Vuoi rimandare indietro nel tempo questo messaggio fissato?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Invia a"
@@ -29606,16 +29606,11 @@ msgstr "Invia messaggio vocale"
msgid "Send:"
msgstr "Invio:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Inviare un SMS a questo numero è costoso, quindi ti chiediamo di inviarci un SMS."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Inviare un SMS a questo numero di telefono è troppo costoso per {PRODUCT_NAME}, quindi abbiamo bisogno che sia tu a inviarci un SMS. Sappiamo che non è l'ideale. Puoi anche chiedere agli amministratori di questa istanza di rimuovere questo requisito dal tuo account."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Inviare un SMS a questo numero di telefono è troppo costoso per {PRODUCT_NAME}, quindi abbiamo bisogno che sia tu a inviarci un SMS. Sappiamo che non è l'ideale. Puoi anche contattare <0>{SUPPORT_EMAIL}</0> per chiederci di rimuovere questo requisito dal tuo account."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Video più fluido"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "La verifica SMS non è disponibile al momento. Riprova più tardi o contatta l'assistenza."
@@ -31397,7 +31392,7 @@ msgstr "Si è verificato un errore. Riprova più tardi."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Si è verificato un errore. Riprova."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Controlli staff"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Potrebbero essere applicate le tariffe standard per i messaggi del tuo operatore."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Grazie per aver contribuito a rendere {productName} un luogo sicuro. Esamineremo la tua segnalazione il prima possibile."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Il codice non ha funzionato. Controllalo e riprova."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Il codice è scaduto. Richiedine uno nuovo."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Non sembra un URL valido."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Questa email è già in uso."
@@ -34118,8 +34113,8 @@ msgstr "Questa è la tua ultima passkey e le passkey sono il tuo secondo fattore
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Questa è la tua ultima passkey. Una volta eliminata, non potrai più usare una passkey come secondo fattore."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Questo non è un numero di cellulare, quindi non può ricevere i nostri SMS. Prova con un numero di cellulare o contatta il supporto se pensi che ci sia un errore."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Questo soprannome sarà visibile solo in questa community"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Questo numero va verificato inviandoci un SMS. Torna indietro e avvia di nuovo la verifica telefonica per ottenere il codice e il numero a cui inviarlo."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Questo numero richiede che sia tu a inviarci un SMS, anziché riceverne uno da noi."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "I moderatori hanno disattivato l’audio di questo partecipante"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Questo numero di telefono non può essere usato. Prova un altro numero di cellulare o contatta l'assistenza."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Questo numero di telefono è già stato utilizzato. Prova un altro numero o contatta l'assistenza."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "La sessione di verifica è scaduta. Torna a {productName} e ricomincia la procedura di acquisto."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Questa sessione di verifica è scaduta. Riprova."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "In questo modo tutti i link esterni verranno considerati attendibili e l'avviso per ogni dominio verrà ignorato. I domini attendibili esistenti verranno sostituiti. Questa operazione è meno sicura."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Questa finestra si aggiorna automaticamente dopo aver ricevuto il tuo messaggio."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Mappa le immagini HDR all'intervallo standard, riducendo la luminosità di picco."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Troppi tentativi. Attendi un attimo, poi riprova."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Usa un indirizzo email a cui hai accesso. Ti invieremo un codice a quell’indirizzo."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Usa un'email diversa da quella attuale."
@@ -37318,17 +37313,17 @@ msgstr "Verifica la tua identità"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verifica telefono"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verifica numero di telefono"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Modulo di verifica del numero di telefono"
@@ -38192,7 +38187,7 @@ msgstr "Alza volume"
msgid "Wait a moment before deleting more messages."
msgstr "Attendi un momento prima di eliminare altri messaggi."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Attendi un momento. Questa finestra si chiuderà automaticamente quando riceveremo il tuo messaggio."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Tempo di attesa tra i messaggi. I membri con il permesso \"{bypassSlowmodePermissionLabel}\" possono ignorarlo."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Attendi qui"
@@ -38368,13 +38363,13 @@ msgstr "Non è stato possibile leggere questo tema. Potrebbe essere danneggiato
msgid "We couldn't remove that account. Try again."
msgstr "Non è stato possibile rimuovere l'account. Riprova."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Non siamo riusciti a verificare questo numero automaticamente. Contatta il supporto e una persona esaminerà il tuo account."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Non inviamo SMS di verifica in questo paese. Prova con un numero di cellulare di un altro paese o contatta il supporto."
@@ -38469,9 +38464,9 @@ msgstr "Ti invieremo un codice di verifica via email prima che tu possa cambiare
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Ti invieremo un codice di verifica alla tua email prima che tu possa visualizzare i tuoi codici di backup."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Ti invieremo un codice SMS quando disponibile. Il tuo numero non è collegato al tuo account. Conserviamo solo un indicatore crittografato, senza ID utente, per consentire al massimo {PHONE_VERIFICATION_LIMIT} verifiche in circa {PHONE_VERIFICATION_WINDOW_DAYS} giorni."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Ti invieremo un codice SMS quando sarà disponibile. Il tuo numero non è collegato al tuo account. Conserviamo solo un marcatore crittografato, senza ID utente, per un tempo limitato."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "La tua sessione di {productName} è scaduta. Accedi di nuovo per continu
msgid "Your account"
msgstr "Il tuo account"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Il tuo account tornerà subito alla normalità e non avrai bisogno di un numero di telefono. Questa non è un'esenzione permanente. L'iscrizione a una community grande o pubblica potrebbe riattivare questo controllo."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Il tuo account tornerà subito alla normalità e non avrai bisogno di un numero di telefono. Questa non è un'esenzione permanente e potremmo richiedere nuovamente questa verifica in futuro."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "La tua carta è idonea. Ti stiamo reindirizzando alla pagina di pagamento."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Il tuo operatore indica che questo numero non è attivo. Controllalo e riprova, oppure contatta il supporto se è corretto."
@@ -40216,10 +40211,10 @@ msgstr "la tua nuova email"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Il tuo nuovo soprannome; lascia vuoto per reimpostarlo."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Il tuo numero non è collegato al tuo account. Conserviamo solo un indicatore crittografato, senza ID utente, per un massimo di {limit} verifiche in circa {duration} giorni."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Il tuo numero non è collegato al tuo account. Conserviamo solo un marcatore crittografato, senza ID utente, per un tempo limitato."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/ja/messages.po b/fluxer_app/src/features/i18n/locales/ja/messages.po
index 9ead0f752..cb7dff470 100644
--- a/fluxer_app/src/features/i18n/locales/ja/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ja/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7日間"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "電話番号認証の前にブラウザチェックが必要です。サインインページからやり直すか、サポートにお問い合わせください。"
@@ -5240,8 +5240,8 @@ msgstr "現在離席中"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "戻る"
@@ -6451,7 +6451,7 @@ msgstr "ここにファイルをアップロードできません"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "石炭テーマ"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "カウントダウンタイマー"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "国"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "メールアドレスを利用できません"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "現在、メールアドレスの更新はできません。しばらくしてからもう一度お試しいただくか、サポートにお問い合わせください。"
@@ -13999,7 +13999,7 @@ msgstr "有効な{theOtherPlatform}テンプレートURLまたはコードを入
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "有効なメールアドレスを入力してください。"
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "有効なメッセージリンクを入力してください。"
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "有効な携帯電話番号を入力してください。"
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "有効な電話番号を入力してください"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "{phoneNumber}に送信された{digitCount}桁のコードを入力してください。"
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "{0}に送信された{MFA_CODE_DIGIT_COUNT}桁のコードを入力してください。"
@@ -16137,7 +16137,7 @@ msgstr "タグをカスタマイズしたり、ユーザー名の変更時にタ
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "新しいコードを取得"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "ブラウザを開いてサインインし、以下のコードを入力してアカウントをリンクしてください。"
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "メッセージアプリを開く"
@@ -24047,12 +24047,12 @@ msgstr "メッセージアプリを開く"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "古い{PRODUCT_NAME}アプリを開き、「新しいデバイスをリンク」を選択して、以下のコードを入力してください。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "スマートフォンのメッセージアプリを開き、新しいメッセージを作成してください。"
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "スマートフォンのメッセージアプリを開き、新しいテキストメッセージを作成してください。"
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "電話番号の確認が現在利用できません。これは当社の問題であり、お客様の電話番号の問題ではありません。数分お待ちになってから、同じ電話番号をもう一度お試しください。"
@@ -24810,21 +24810,21 @@ msgstr "電話番号"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "電話番号"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "電話番号は必須です"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "電話番号を確認しました"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "電話番号認証ステップ"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "このアカウントでは電話番号認証をご利用いただけません。別の方法を使用するか、サポートにお問い合わせください。"
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "リポスト:<0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "まず新しいコードをリクエストしてください。"
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "コミュニティを検索"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "国を検索…"
@@ -29559,17 +29559,17 @@ msgstr "/tts で読み上げメッセージを送信します。読み上げ機
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "コード <0>{0}</0> を <1>{1}</1> に送信"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "以下の電話番号にコードを送信してください。"
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "このコードを送信"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "このピンを過去に戻しますか?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "送信先"
@@ -29606,16 +29606,11 @@ msgstr "ボイスメッセージを送信"
msgid "Send:"
msgstr "送信:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "この電話番号へのSMS送信は費用がかかるため、代わりにテキストメッセージを送信してください。"
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "{PRODUCT_NAME}からこの電話番号にSMSを送信すると費用が高額になるため、代わりにSMSを送信していただく必要があります。ご不便をおかけして申し訳ございません。このインスタンスの管理者に依頼して、この要件を解除してもらうことも可能です。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "{PRODUCT_NAME}からこの電話番号にSMSを送信すると費用が高額になるため、代わりにSMSを送信していただく必要があります。ご不便をおかけして申し訳ございません。<0>{SUPPORT_EMAIL}</0>までご連絡いただければ、この要件を解除することも可能です。"
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "よりスムーズなビデオ"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "現在、SMS認証をご利用いただけません。しばらくしてからもう一度お試しいただくか、サポートにお問い合わせください。"
@@ -31397,7 +31392,7 @@ msgstr "問題が発生しました。後でもう一度お試しください。
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "問題が発生しました。もう一度お試しください。"
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "スタッフコントロール"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "ご利用の携帯電話会社によっては、通常のメッセージ料金がかかる場合があります。"
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "{productName}を安全に保つためのご協力ありがとうございます。できるだけ早くご報告内容を確認いたします。"
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "コードが正しくありません。確認してもう一度お試しください。"
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "コードの有効期限が切れました。新しいコードをリクエストしてください。"
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "有効なURLではないようです。"
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "そのメールアドレスは既に使用されています。"
@@ -34118,8 +34113,8 @@ msgstr "これは最後のパスキーであり、パスキーはこのアカウ
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "これは最後のパスキーです。これを削除すると、パスキーを2つ目の認証要素として使用できなくなります。"
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "これは携帯電話番号ではないため、SMSを受信できません。携帯電話番号を試すか、誤りがあると思われる場合はサポートにご連絡ください。"
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "このニックネームはこのコミュニティ内でのみ表示されます"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "この電話番号は、こちらにテキストメッセージを送信して認証します。戻って電話番号認証をやり直すと、コードと送信先の番号を確認できます。"
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "この電話番号は、こちらからのSMSではなく、こちらにテキストメッセージを送信して認証する必要があります。"
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "この参加者はモデレーターによりスピーカーミュートされています"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "この電話番号は使用できません。別の携帯電話番号を試すか、サポートにお問い合わせください。"
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "この電話番号はすでに使用されています。別の番号を試すか、サポートにお問い合わせください。"
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "認証セッションの有効期限が切れました。{productName}に戻り、もう一度チェックアウトを開始してください。"
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "この認証セッションは期限切れです。もう一度やり直してください。"
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "すべての外部リンクを信頼し、ドメインごとの警告をスキップします。既存の信頼済みドメインは上書きされます。セキュリティが低下します。"
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "メッセージを受信すると、このウィンドウは自動的に更新されます。"
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "HDR画像を標準範囲にトーンマップし、ピーク輝度を下げます。"
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "試行回数が多すぎます。しばらく待ってから、もう一度お試しください。"
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "アクセスできるメールアドレスを使用してください。そのアドレスにコードを送信します。"
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "現在登録されているメールアドレスとは異なるものを使用してください。"
@@ -37318,17 +37313,17 @@ msgstr "ご本人確認"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "電話番号を認証"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "電話番号を認証"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "電話番号認証フォーム"
@@ -38192,7 +38187,7 @@ msgstr "音量を上げる"
msgid "Wait a moment before deleting more messages."
msgstr "続けてメッセージを削除する前に、少し時間をおいてください。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "しばらくお待ちください。メッセージを受信すると、このウィンドウは自動的に閉じます。"
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "メッセージ間の待機時間です。「{bypassSlowmodePermissionLabel}」権限を持つメンバーはこれをバイパスできます。"
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "そのままお待ちください"
@@ -38368,13 +38363,13 @@ msgstr "このテーマは読み込めませんでした。破損しているか
msgid "We couldn't remove that account. Try again."
msgstr "アカウントを削除できませんでした。もう一度お試しください。"
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "この電話番号は自動で確認できませんでした。サポートに連絡すると、担当者がアカウントを確認します。"
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "この国への確認メッセージは送信できません。別の国の携帯電話番号をお試しいただくか、サポートにお問い合わせください。"
@@ -38469,9 +38464,9 @@ msgstr "パスワードを変更する前に、ご登録のメールアドレス
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "バックアップコードを表示する前に、認証コードをメールでお送りします。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "SMSコードが利用可能になり次第、送信します。この電話番号はアカウントにリンクされていません。ユーザーIDを含まない暗号化されたマーカーのみを保持し、約{PHONE_VERIFICATION_WINDOW_DAYS}日間で最大{PHONE_VERIFICATION_LIMIT}回の認証を許可します。"
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "利用可能になり次第、SMSコードをお送りします。この番号はアカウントとは紐づけられません。一時的に、ユーザーIDを含まない暗号化されたマーカーのみを保持します。"
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "{productName}のセッションの有効期限が切れました。こ
msgid "Your account"
msgstr "アカウント"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "アカウントはすぐに元通りになり、電話番号は不要になります。これは恒久的な免除ではありません。大規模または公開コミュニティに参加すると、このチェックが再度表示される場合があります。"
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "アカウントはすぐに元通りになり、電話番号は不要になります。これは恒久的な免除ではなく、後で再度確認を求める場合があります。"
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "カードが有効です。支払いページに移動します。"
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "お使いの通信事業者の情報によると、この番号は現在利用されていません。番号を確認してもう一度お試しいただくか、番号が正しい場合はサポートにご連絡ください。"
@@ -40216,10 +40211,10 @@ msgstr "新しいメールアドレス"
msgid "Your new nickname, or leave blank to reset it."
msgstr "新しいニックネーム。空白のままにするとリセットされます。"
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "電話番号はアカウントに紐付けられません。保持するのはユーザーIDを含まない暗号化されたマーカーのみで、対象は約{duration}日間で最大{limit}回の認証です。"
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "お客様の番号はアカウントにリンクされていません。暗号化されたマーカーのみを、ユーザーIDなしで、期間限定で保持します。"
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/ko/messages.po b/fluxer_app/src/features/i18n/locales/ko/messages.po
index 70598c5f3..0482e9a9e 100644
--- a/fluxer_app/src/features/i18n/locales/ko/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ko/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7일"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "전화번호 인증 전에 브라우저 확인이 필요합니다. 로그인 페이지에서 다시 시도하거나 고객지원팀에 문의하세요."
@@ -5240,8 +5240,8 @@ msgstr "지금은 부재중"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "뒤로"
@@ -6451,7 +6451,7 @@ msgstr "여기에 파일을 올릴 수 없습니다"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "석탄 테마"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "카운트다운 타이머"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "국가"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "이메일 사용 불가"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "지금은 이메일을 업데이트할 수 없습니다. 나중에 다시 시도하거나 고객지원팀에 문의하세요."
@@ -13999,7 +13999,7 @@ msgstr "유효한 {theOtherPlatform} 템플릿 URL 또는 코드를 입력하세
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "유효한 이메일 주소를 입력하세요."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "유효한 메시지 링크를 입력하세요."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "유효한 휴대폰 번호를 입력하세요."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "유효한 전화번호를 입력하세요"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "{phoneNumber}(으)로 전송된 {digitCount}자리 코드를 입력하세요."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "{0}(으)로 전송된 {MFA_CODE_DIGIT_COUNT}자리 코드를 입력하세요."
@@ -16137,7 +16137,7 @@ msgstr "태그를 맞춤 설정하거나 사용자 이름을 변경할 때 현
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "새 코드 받기"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "브라우저를 열고 로그인한 다음 아래 코드를 입력하여 계정을 연결하세요."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "메시지 열기"
@@ -24047,12 +24047,12 @@ msgstr "메시지 열기"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "기존 {PRODUCT_NAME} 앱을 열고 새 기기 연결을 선택한 다음 아래 코드를 입력하세요."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "휴대폰 메시지 앱을 열고 새 문자 메시지를 작성해 주세요."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "휴대폰 메시지 앱을 열고 새 문자 메시지를 시작하세요."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "전화번호 확인 시스템에 일시적으로 문제가 발생했습니다. 고객님의 번호가 아닌 저희 시스템 문제입니다. 몇 분 후에 같은 번호로 다시 시도해 주세요."
@@ -24810,21 +24810,21 @@ msgstr "전화번호"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "전화번호"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "전화번호를 입력해 주세요"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "전화번호 인증 완료"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "전화번호 단계"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "이 계정에서는 전화 인증을 사용할 수 없습니다. 다른 방법을 사용하거나 고객지원팀에 문의하세요."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "재게시: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "먼저 새 코드를 요청하세요."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "커뮤니티 검색"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "국가 검색..."
@@ -29559,17 +29559,17 @@ msgstr "/tts로 텍스트 음성 변환 메시지를 보낼 수 있습니다.
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "코드 <0>{0}</0>을(를) <1>{1}</1>(으)로 보내기"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "아래 전화번호로 코드를 보내주세요."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "코드 전송"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "이 핀을 과거로 돌려보낼까요?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "다음으로 전송"
@@ -29606,16 +29606,11 @@ msgstr "음성 메시지 보내기"
msgid "Send:"
msgstr "송신:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "이 번호로 SMS를 보내는 데 비용이 많이 들기 때문에 대신 문자를 보내주셔야 합니다."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "{PRODUCT_NAME}에서 이 전화번호로 SMS를 보내는 비용이 너무 비싸서, 대신 고객님께서 저희에게 SMS를 보내주셔야 합니다. 불편하시겠지만, 이 인스턴스의 관리자에게 요청하여 이 요구 사항을 해제할 수도 있습니다."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "{PRODUCT_NAME}에서 이 전화번호로 SMS를 보내는 비용이 너무 비싸서, 대신 고객님께서 저희에게 SMS를 보내주셔야 합니다. 불편하시겠지만, <0>{SUPPORT_EMAIL}</0>로 문의하여 이 요구 사항을 해제할 수도 있습니다."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "더 부드러운 영상"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "지금은 SMS 인증을 이용할 수 없습니다. 나중에 다시 시도하거나 고객지원팀에 문의하세요."
@@ -31397,7 +31392,7 @@ msgstr "문제가 발생했습니다. 나중에 다시 시도해 주세요."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "문제가 발생했습니다. 다시 시도해 주세요."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "직원 도구"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "이동통신사의 표준 메시지 요금이 부과될 수 있습니다."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "{productName}을(를) 안전하게 유지하는 데 도움을 주셔서 감사합니다. 최대한 빨리 신고 내용을 검토하겠습니다."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "코드가 올바르지 않습니다. 다시 확인하고 시도해 주세요."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "코드가 만료되었습니다. 새 코드를 요청해 주세요."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "유효한 URL이 아닌 것 같아요."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "이미 사용 중인 이메일입니다."
@@ -34118,8 +34113,8 @@ msgstr "이것이 마지막 패스키이며, 패스키가 두 번째 인증 수
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "이것이 마지막 패스키입니다. 삭제하고 나면 패스키를 두 번째 인증 수단으로 사용할 수 없습니다."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "이 번호는 휴대폰 번호가 아니어서 문자를 받을 수 없습니다. 휴대폰 번호를 입력하거나, 잘못되었다고 생각되면 고객지원팀에 문의하세요."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "이 닉네임은 이 커뮤니티에서만 표시됩니다"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "이 번호는 직접 문자를 보내서 인증합니다. 코드와 문자를 보낼 번호를 받으려면 뒤로 가서 전화 인증을 다시 시작하세요."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "이 번호는 SMS를 받는 대신 직접 문자를 보내 인증해야 합니다."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "이 참가자는 모더레이터가 소리를 껐습니다"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "이 전화번호는 사용할 수 없습니다. 다른 휴대폰 번호를 사용해 보거나 고객지원팀에 문의하세요."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "이 전화번호는 이미 사용 중입니다. 다른 번호를 사용해 보거나 고객지원팀에 문의하세요."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "인증 세션이 만료되었습니다. {productName}으로 돌아가서 다시 결제를 시작해 주세요."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "인증 세션이 만료되었습니다. 다시 시작해 주세요."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "모든 외부 링크를 신뢰하고 모든 도메인에 대한 경고를 건너뜁니다. 기존 신뢰 도메인은 교체됩니다. 보안 수준이 낮아집니다."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "메시지를 받으면 이 창이 자동으로 업데이트됩니다."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "HDR 이미지를 표준 범위로 톤 매핑하여 최고 밝기를 줄입니다."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "시도 횟수가 너무 많습니다. 잠시 기다린 후 다시 시도해 주세요."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "본인이 확인할 수 있는 이메일 주소를 사용하세요. 해당 주소로 인증 코드를 보내드립니다."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "현재 이메일과 다른 이메일을 사용하세요."
@@ -37318,17 +37313,17 @@ msgstr "본인 인증하기"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "전화번호 인증"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "전화번호 인증"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "전화번호 인증 양식"
@@ -38192,7 +38187,7 @@ msgstr "볼륨 높이기"
msgid "Wait a moment before deleting more messages."
msgstr "메시지를 더 삭제하기 전에 잠시 기다려 주세요."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "잠시만 기다려 주세요. 메시지 수신 시 이 창은 자동으로 닫힙니다."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "메시지를 보낸 후 다음 메시지까지 기다려야 합니다. \"{bypassSlowmodePermissionLabel}\" 권한이 있는 멤버는 이 제한을 건너뛸 수 있습니다."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "잠시만 기다려 주세요"
@@ -38368,13 +38363,13 @@ msgstr "테마를 읽을 수 없습니다. 파일이 손상되었거나 유효
msgid "We couldn't remove that account. Try again."
msgstr "계정을 삭제할 수 없습니다. 다시 시도해 주세요."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "이 번호는 자동으로 인증할 수 없습니다. 고객지원팀에 문의하시면 담당자가 계정을 검토해 드립니다."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "이 국가로는 인증 문자를 보내지 않습니다. 다른 국가의 휴대폰 번호를 사용하거나 고객지원팀에 문의하세요."
@@ -38469,9 +38464,9 @@ msgstr "비밀번호 변경 전, 이메일로 인증 코드를 보내드립니
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "백업 코드를 확인하기 전에 이메일로 인증 코드를 보내드립니다."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "가능한 경우 SMS 코드를 보내드립니다. 회원님의 전화번호는 계정에 연결되어 있지 않습니다. 사용자 ID 없이 암호화된 마커만 보관하며, 약 {PHONE_VERIFICATION_WINDOW_DAYS}일 이내에 최대 {PHONE_VERIFICATION_LIMIT}회 인증만 허용됩니다."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "코드가 준비되면 SMS로 보내드립니다. 전화번호는 계정에 연결되지 않습니다. 사용자 ID 없이 암호화된 마커만 제한된 시간 동안 보관합니다."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "{productName} 세션이 만료되었습니다. 이 애플리케이션의
msgid "Your account"
msgstr "내 계정"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "계정이 즉시 정상으로 돌아가며 지금은 전화번호가 필요하지 않습니다. 이는 영구적인 면제가 아닙니다. 규모가 크거나 공개된 커뮤니티에 참여하면 이 확인 절차가 다시 나타날 수 있습니다."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "계정이 즉시 정상으로 돌아가며, 지금은 전화번호가 필요하지 않습니다. 이는 영구적인 면제는 아니며, 나중에 다시 인증을 요청할 수 있습니다."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "카드 사용이 가능합니다. 지금 결제 페이지로 이동합니다."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "이동통신사에서 이 번호가 사용되지 않는 번호라고 확인했습니다. 번호를 확인하고 다시 시도하거나, 번호가 정확하다면 고객지원팀에 문의하세요."
@@ -40216,10 +40211,10 @@ msgstr "새 이메일 주소"
msgid "Your new nickname, or leave blank to reset it."
msgstr "새로운 닉네임입니다. 비워두면 초기화됩니다."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "회원님의 전화번호는 계정에 연결되어 있지 않습니다. 사용자 ID 없이 암호화된 마커만 보관하며, 약 {duration}일 동안 최대 {limit}회 인증에 사용됩니다."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "전화번호가 계정에 연결되어 있지 않습니다. 사용자 ID 없이 암호화된 마커만 제한된 시간 동안 보관합니다."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/lt/messages.po b/fluxer_app/src/features/i18n/locales/lt/messages.po
index 1efaf7ce4..acbd1714d 100644
--- a/fluxer_app/src/features/i18n/locales/lt/messages.po
+++ b/fluxer_app/src/features/i18n/locales/lt/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dienos"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Prieš patvirtinant telefono numerį, reikalingas naršyklės patikrinimas. Bandykite dar kartą prisijungimo puslapyje arba susisiekite su palaikymo komanda."
@@ -5240,8 +5240,8 @@ msgstr "Šiuo metu nesu prie kompiuterio"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Atgal"
@@ -6451,7 +6451,7 @@ msgstr "Čia negalima įkelti failų"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Anglies tema"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Atgalinės atskaitos laikmatis"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Šalis"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "El. paštas nepasiekiamas"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "El. pašto atnaujinimas šiuo metu nepasiekiamas. Bandykite dar kartą vėliau arba susisiekite su palaikymo komanda."
@@ -13999,7 +13999,7 @@ msgstr "Įveskite tinkamą „{theOtherPlatform}“ šablono URL arba kodą."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Įveskite galiojantį el. pašto adresą."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Įveskite galiojančią žinutės nuorodą."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Įveskite galiojantį mobiliojo telefono numerį."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Įveskite galiojantį telefono numerį"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Įveskite {digitCount} skaitmenų kodą, išsiųstą į {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Įveskite {MFA_CODE_DIGIT_COUNT} skaitmenų kodą, išsiųstą į {0}."
@@ -16137,7 +16137,7 @@ msgstr "Gaukite {premiumProductName}, kad tinkintumėte savo žymą arba ją iš
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Gauti naują kodą"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Atidarykite naršyklę, prisijunkite, tada įveskite toliau pateiktą kodą, kad susietumėte paskyrą."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Atidarykite savo žinutes"
@@ -24047,12 +24047,12 @@ msgstr "Atidarykite savo žinutes"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Atidarykite savo senąją „{PRODUCT_NAME}“ programėlę ir pasirinkite „Susieti naują įrenginį“, tada įveskite žemiau pateiktą kodą."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Atidarykite telefono žinučių programėlę ir sukurkite naują tekstinę žinutę."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Atidarykite telefono žinučių programėlę ir pradėkite naują tekstinę žinutę."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Šiuo metu mūsų telefono numerio patikra neveikia. Tai mūsų klaida, ne jūsų numerio. Palaukite kelias minutes ir bandykite dar kartą su tuo pačiu numeriu."
@@ -24810,21 +24810,21 @@ msgstr "Telefonas"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefono numeris"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Reikalingas telefono numeris"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefono numeris patvirtintas"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Telefono žingsnis"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Telefono numerio patvirtinimas šiai paskyrai negalimas. Naudokite kitą metodą arba susisiekite su palaikymo komanda."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Pakartotiniai bendrinimai: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Pirmiausia paprašykite naujo kodo."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Ieškoti bendruomenių"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Ieškoti šalių..."
@@ -29559,17 +29559,17 @@ msgstr "Siųsti teksto į kalbą žinutes komanda /tts. Nariai, įjungę teksto
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Siųskite kodą <0>{0}</0> numeriu <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Išsiųskite kodą toliau nurodytu telefono numeriu."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Siųsti šį kodą"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Išsiųsti šį prisegimą atgal į praeitį?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Siųsti į"
@@ -29606,16 +29606,11 @@ msgstr "Siųsti balso žinutę"
msgid "Send:"
msgstr "Siųsti:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "SMS siuntimas šiuo numeriu yra brangus, todėl prašome vietoj to parašyti mums."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "SMS siuntimas šiuo telefono numeriu „{PRODUCT_NAME}“ yra per brangus, todėl prašome vietoj to atsiųsti SMS mums. Žinome, kad tai nėra idealu. Taip pat galite paprašyti šios instancijos administratorių panaikinti šį reikalavimą jūsų paskyrai."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "SMS siuntimas šiuo telefono numeriu „{PRODUCT_NAME}“ yra per brangus, todėl prašome vietoj to atsiųsti SMS mums. Žinome, kad tai nėra idealu. Taip pat galite kreiptis adresu <0>{SUPPORT_EMAIL}</0>, kad panaikintume šį reikalavimą jūsų paskyrai."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Sklandesnis vaizdas"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Šiuo metu SMS patvirtinimas nepasiekiamas. Bandykite dar kartą vėliau arba susisiekite su palaikymo komanda."
@@ -31397,7 +31392,7 @@ msgstr "Kažkas nepavyko. Bandykite dar kartą vėliau."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Kažkas nepavyko. Bandykite dar kartą."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Darbuotojo valdikliai"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Gali būti taikomi standartiniai jūsų operatoriaus pranešimų siuntimo tarifai."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Dėkojame, kad padedate užtikrinti „{productName}“ saugumą. Jūsų pranešimą peržiūrėsime kuo greičiau."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Šis kodas netiko. Patikrinkite jį ir bandykite dar kartą."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Šis kodas nebegalioja. Prašykite naujo kodo."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Atrodo, tai nėra tinkamas URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Šis el. paštas jau naudojamas."
@@ -34118,8 +34113,8 @@ msgstr "Tai paskutinis jūsų prieigos raktas, o prieigos raktai yra jūsų antr
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Tai paskutinis jūsų prieigos raktas. Kai jo nebeliks, negalėsite naudoti prieigos rakto kaip antrojo veiksnio."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Tai nėra mobiliojo telefono numeris, todėl jis negali gauti mūsų SMS žinučių. Pabandykite įvesti mobiliojo telefono numerį arba susisiekite su palaikymo tarnyba, jei manote, kad tai klaida."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Šis slapyvardis bus matomas tik šioje bendruomenėje"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Šis numeris patvirtinamas siunčiant mums SMS. Grįžkite ir dar kartą pradėkite telefono patvirtinimą, kad gautumėte kodą ir numerį, kuriuo reikia siųsti SMS."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Šiam numeriui reikia patvirtinimo išsiunčiant mums SMS, o ne gaunant SMS iš mūsų."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Šiam dalyviui garsą išjungė moderatoriai"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Šio telefono numerio negalima naudoti. Bandykite kitą mobiliojo telefono numerį arba susisiekite su palaikymo komanda."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Šis telefono numeris jau buvo naudotas. Bandykite kitą numerį arba susisiekite su palaikymo komanda."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Šis patvirtinimo seansas baigėsi. Grįžkite į „{productName}“ ir pradėkite atsiskaitymą iš naujo."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Šis patvirtinimo seansas baigėsi. Pradėkite iš naujo."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Visos išorinės nuorodos bus laikomos patikimomis ir įspėjimas nebebus rodomas nė vienam domenui. Esami patikimi domenai bus pakeisti. Tai mažiau saugu."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Šis langas atnaujinamas automatiškai, kai tik gausime jūsų žinutę."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Tonuoti HDR vaizdus į standartinį diapazoną, sumažinant didžiausią ryškumą."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Per daug bandymų. Šiek tiek palaukite ir bandykite dar kartą."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Naudokite el. pašto adresą, kurį galite pasiekti. Ten atsiųsime kodą."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Naudokite kitą el. pašto adresą nei dabartinis."
@@ -37318,17 +37313,17 @@ msgstr "Patvirtinkite, kad tai jūs"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Patvirtinti telefono numerį"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Patvirtinti telefono numerį"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Telefono numerio patvirtinimo forma"
@@ -38192,7 +38187,7 @@ msgstr "Didinti garsumą"
msgid "Wait a moment before deleting more messages."
msgstr "Palaukite akimirką, prieš trindami daugiau žinučių."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Palaukite. Šis langas automatiškai užsidarys, kai tik gausime jūsų žinutę."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Laikas tarp žinučių. Nariai, turintys leidimą „{bypassSlowmodePermissionLabel}“, gali jį apeiti."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Palaukite čia"
@@ -38368,13 +38363,13 @@ msgstr "Nepavyko nuskaityti šios temos. Ji gali būti sugadinta arba netinkama.
msgid "We couldn't remove that account. Try again."
msgstr "Nepavyko pašalinti paskyros. Bandykite dar kartą."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Nepavyko automatiškai patvirtinti šio numerio. Susisiekite su palaikymo tarnyba ir jūsų paskyrą peržiūrės žmogus."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Mes nesiunčiame patvirtinimo SMS į šią šalį. Pabandykite naudoti kitoje šalyje esantį mobiliojo telefono numerį arba susisiekite su palaikymo tarnyba."
@@ -38469,9 +38464,9 @@ msgstr "Kad galėtumėte pakeisti slaptažodį, atsiųsime patvirtinimo kodą į
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Kad galėtumėte peržiūrėti atsarginius kodus, atsiųsime patvirtinimo kodą į jūsų el. paštą."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Kai bus galima, atsiųsime SMS kodą. Jūsų numeris nesusietas su paskyra. Saugome tik užšifruotą žymeklį be naudotojo ID, kad per maždaug {PHONE_VERIFICATION_WINDOW_DAYS} dienas būtų galima atlikti ne daugiau kaip {PHONE_VERIFICATION_LIMIT} patvirtinimų."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Atsiųsime SMS kodą, kai tik jis bus pasiekiamas. Jūsų numeris nebus susietas su paskyra. Mes saugome tik užšifruotą žymę be vartotojo ID, ribotą laiką."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Jūsų „{productName}“ seanso laikas baigėsi. Prisijunkite iš nauj
msgid "Your account"
msgstr "Jūsų paskyra"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Jūsų paskyra iškart grįš į įprastą būseną ir jums nereikės telefono numerio. Tai nėra nuolatinė išimtis. Prisijungus prie didelės ar viešos bendruomenės šis patikrinimas gali grįžti."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Jūsų paskyra iškart grįš į įprastą būseną ir jums nereikės telefono numerio. Tai nėra nuolatinė išimtis, ir mes galime paprašyti šio patikrinimo vėliau."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Jūsų kortelė tinkama. Dabar būsite nukreipti į mokėjimo puslapį."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Jūsų operatorius teigia, kad šis numeris nebenaudojamas. Patikrinkite jį ir bandykite dar kartą arba susisiekite su palaikymo tarnyba, jei numeris teisingas."
@@ -40216,10 +40211,10 @@ msgstr "jūsų naujas el. pašto adresas"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Jūsų naujas slapyvardis arba palikite tuščią, kad jį atstatytumėte."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Jūsų numeris nesusietas su paskyra. Saugome tik užšifruotą žymeklį be naudotojo ID, daugiausia {limit} patvirtinimų per maždaug {duration} dienas."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Jūsų numeris nesusietas su paskyra. Mes saugome tik užšifruotą žymeklį be vartotojo ID, ribotą laiką."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/nl/messages.po b/fluxer_app/src/features/i18n/locales/nl/messages.po
index 575212ddd..1cfb0138d 100644
--- a/fluxer_app/src/features/i18n/locales/nl/messages.po
+++ b/fluxer_app/src/features/i18n/locales/nl/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dagen"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Voordat je je telefoonnummer kunt verifiëren, is een browsercontrole vereist. Probeer het opnieuw vanaf de inlogpagina of neem contact op met support."
@@ -5240,8 +5240,8 @@ msgstr "Nu afwezig"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Terug"
@@ -6451,7 +6451,7 @@ msgstr "Kan hier geen bestanden uploaden"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Kolenzwart thema"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Afteltimer"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Land"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mailadres niet beschikbaar"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Je e-mailadres kan momenteel niet worden bijgewerkt. Probeer het later opnieuw of neem contact op met het supportteam."
@@ -13999,7 +13999,7 @@ msgstr "Voer een geldige sjabloon-URL of -code van {theOtherPlatform} in."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Voer een geldig e-mailadres in."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Voer een geldige berichtlink in."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Voer een geldig mobiel telefoonnummer in."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Voer een geldig telefoonnummer in"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Voer de {digitCount}-cijferige code in die is verzonden naar {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Voer de code van {MFA_CODE_DIGIT_COUNT} cijfers in die is verzonden naar {0}."
@@ -16137,7 +16137,7 @@ msgstr "Neem {premiumProductName} om je tag aan te passen of te behouden wanneer
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Nieuwe code ontvangen"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Open je browser, meld je aan en voer de onderstaande code in om je account te koppelen."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Open je berichten"
@@ -24047,12 +24047,12 @@ msgstr "Open je berichten"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Open je oude {PRODUCT_NAME}-app en kies 'Nieuw apparaat koppelen' en voer daarna de onderstaande code in."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Open de berichtenapp van je telefoon en maak een nieuw sms-bericht aan."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Open de berichtenapp op je telefoon en start een nieuw sms-bericht."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Onze telefoonnummercontrole is momenteel niet beschikbaar. Dit ligt aan ons, niet aan je nummer. Wacht een paar minuten en probeer hetzelfde nummer opnieuw."
@@ -24810,21 +24810,21 @@ msgstr "Telefoon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefoonnummer"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Telefoonnummer is verplicht"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefoonnummer geverifieerd"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Telefoonstap"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Telefoonverificatie is niet beschikbaar voor dit account. Gebruik een andere methode of neem contact op met de ondersteuning."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Reposts: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Vraag eerst een nieuwe code aan."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Communities zoeken"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Landen zoeken..."
@@ -29559,17 +29559,17 @@ msgstr "Verstuur tekst-naar-spraakberichten met /tts. Leden die tekst-naar-spraa
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Stuur de code <0>{0}</0> naar <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Stuur de code naar het onderstaande telefoonnummer."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Verstuur deze code"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Deze pin terug in de tijd sturen?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Verzenden naar"
@@ -29606,16 +29606,11 @@ msgstr "Spraakbericht verzenden"
msgid "Send:"
msgstr "Verzenden:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Een sms naar dit nummer sturen is duur. Daarom vragen we je om ons een sms te sturen."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Het versturen van een sms naar dit telefoonnummer is te duur voor {PRODUCT_NAME}. Daarom vragen we je om ons een sms te sturen. We begrijpen dat dit niet ideaal is. Je kunt ook de beheerders van deze instantie vragen om deze vereiste van je account te verwijderen."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Het versturen van een sms naar dit telefoonnummer is te duur voor {PRODUCT_NAME}. Daarom vragen we je om ons een sms te sturen. We begrijpen dat dit niet ideaal is. Je kunt ook contact opnemen met <0>{SUPPORT_EMAIL}</0> om deze vereiste van je account te laten verwijderen."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Vloeiendere video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Sms-verificatie is momenteel niet beschikbaar. Probeer het later opnieuw of neem contact op met de ondersteuning."
@@ -31397,7 +31392,7 @@ msgstr "Er is iets misgegaan. Probeer het later opnieuw."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Er is iets misgegaan. Probeer het opnieuw."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Medewerkersopties"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Standaard sms-tarieven van je provider kunnen van toepassing zijn."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Bedankt dat je helpt om {productName} veilig te houden. We bekijken je melding zo snel mogelijk."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Die code werkte niet. Controleer de code en probeer het opnieuw."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Die code is verlopen. Vraag een nieuwe code aan."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Dat lijkt geen geldige URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Dat e-mailadres is al in gebruik."
@@ -34118,8 +34113,8 @@ msgstr "Dit is je laatste passkey en passkeys zijn je tweede factor. Als je deze
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Dit is je laatste passkey. Als deze weg is, kun je geen passkey meer gebruiken als je tweede factor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Dit is geen mobiel nummer en kan daarom onze sms niet ontvangen. Probeer een mobiel nummer, of neem contact op met het supportteam als dit volgens jou niet klopt."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Deze bijnaam is alleen zichtbaar in deze community"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Dit nummer wordt geverifieerd door ons te sms'en. Ga terug en start de telefoonverificatie opnieuw om de code en het nummer om naartoe te sms'en te krijgen."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Om dit nummer te verifiëren, moet je ons een sms sturen in plaats van er een van ons te ontvangen."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Moderators hebben het geluid voor deze deelnemer uitgeschakeld"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Dit telefoonnummer kan niet worden gebruikt. Probeer een ander mobiel nummer of neem contact op met de ondersteuning."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Dit telefoonnummer is al gebruikt. Probeer een ander nummer of neem contact op met support."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Deze verificatiesessie is verlopen. Ga terug naar {productName} en start het afrekenen opnieuw."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Deze verificatiesessie is verlopen. Begin opnieuw."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Hiermee worden alle externe links vertrouwd en wordt de waarschuwing voor elk domein overgeslagen. Je bestaande vertrouwde domeinen worden vervangen. Dit is minder veilig."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Dit venster wordt automatisch bijgewerkt nadat we je bericht hebben ontvangen."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "HDR-afbeeldingen omzetten naar standaardbereik, waardoor de piekhelderheid wordt verminderd."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Te veel pogingen. Wacht even en probeer het dan opnieuw."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Gebruik een e-mailadres waar je toegang toe hebt. We sturen daar een code naartoe."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Gebruik een ander e-mailadres dan je huidige."
@@ -37318,17 +37313,17 @@ msgstr "Verifieer dat jij het bent"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Telefoonnummer verifiëren"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Telefoonnummer verifiëren"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulier voor telefoonnummerverificatie"
@@ -38192,7 +38187,7 @@ msgstr "Volume omhoog"
msgid "Wait a moment before deleting more messages."
msgstr "Wacht even voordat je meer berichten verwijdert."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Even geduld. Dit venster sluit automatisch zodra we je bericht ontvangen."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Wacht tussen berichten. Leden met de machtiging \"{bypassSlowmodePermissionLabel}\" kunnen deze wachttijd omzeilen."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Even wachten"
@@ -38368,13 +38363,13 @@ msgstr "We konden dit thema niet lezen. Het is mogelijk beschadigd of ongeldig."
msgid "We couldn't remove that account. Try again."
msgstr "We konden dat account niet verwijderen. Probeer het opnieuw."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "We konden dit nummer niet automatisch verifiëren. Neem contact op met support en een medewerker zal je account beoordelen."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "We sturen geen verificatie-sms’jes naar dit land. Probeer een mobiel nummer uit een ander land, of neem contact op met het supportteam."
@@ -38469,9 +38464,9 @@ msgstr "We sturen een verificatiecode naar je e-mailadres voordat je je wachtwoo
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "We sturen een verificatiecode naar je e-mail voordat je je back-upcodes kunt bekijken."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "We sturen een sms-code wanneer dat mogelijk is. Je nummer is niet gekoppeld aan je account. We bewaren alleen een versleutelde markering, zonder gebruikers-ID, om maximaal {PHONE_VERIFICATION_LIMIT} verificaties in ongeveer {PHONE_VERIFICATION_WINDOW_DAYS} dagen toe te staan."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "We sturen een sms-code zodra deze beschikbaar is. Je nummer wordt niet aan je account gekoppeld. We bewaren alleen een versleuteld merkteken, zonder gebruikers-ID, voor een beperkte tijd."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Je {productName}-sessie is verlopen. Log opnieuw in om door te gaan met
msgid "Your account"
msgstr "Je account"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Je account wordt direct weer normaal en je hebt nu geen telefoonnummer nodig. Dit is geen permanente uitzondering. Lid worden van een grote of openbare community kan deze controle opnieuw activeren."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Je account is direct weer normaal en je hebt nu geen telefoonnummer nodig. Dit is geen permanente uitzondering en we kunnen deze controle later opnieuw vragen."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Je kaart is geschikt. Je wordt nu doorgestuurd naar de betaalpagina."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Je provider geeft aan dat dit nummer niet in gebruik is. Controleer het en probeer het opnieuw, of neem contact op met support als het wel klopt."
@@ -40216,10 +40211,10 @@ msgstr "je nieuwe e-mailadres"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Je nieuwe bijnaam, of laat leeg om deze te resetten."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Je nummer is niet gekoppeld aan je account. We bewaren alleen een versleutelde markering, zonder gebruikers-ID, voor maximaal {limit} verificaties in ongeveer {duration} dagen."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Uw nummer is niet gekoppeld aan uw account. We bewaren slechts een versleuteld merkteken, zonder gebruikers-ID, voor een beperkte tijd."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/no/messages.po b/fluxer_app/src/features/i18n/locales/no/messages.po
index b127b998a..800ed6634 100644
--- a/fluxer_app/src/features/i18n/locales/no/messages.po
+++ b/fluxer_app/src/features/i18n/locales/no/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dager"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "En nettlesersjekk kreves før telefonverifisering. Prøv igjen fra påloggingssiden eller kontakt kundestøtte."
@@ -5240,8 +5240,8 @@ msgstr "Borte akkurat nå"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Tilbake"
@@ -6451,7 +6451,7 @@ msgstr "Kan ikke laste opp filer her"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Kull-tema"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Nedtellingstidtaker"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Land"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-post utilgjengelig"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Du kan ikke endre e-postadressen akkurat nå. Prøv igjen senere eller kontakt kundestøtte."
@@ -13999,7 +13999,7 @@ msgstr "Skriv inn en gyldig mal-URL eller malkode fra {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Skriv inn en gyldig e-postadresse."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Skriv inn en gyldig meldingslenke."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Skriv inn et gyldig mobilnummer."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Skriv inn et gyldig telefonnummer"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Skriv inn den {digitCount}-sifrede koden som ble sendt til {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Skriv inn koden med {MFA_CODE_DIGIT_COUNT} siffer som ble sendt til {0}."
@@ -16137,7 +16137,7 @@ msgstr "Skaff deg {premiumProductName} for å tilpasse taggen din eller beholde
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Få ny kode"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Åpne nettleseren din, logg på, og skriv inn koden nedenfor for å koble til kontoen din."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Åpne meldingene dine"
@@ -24047,12 +24047,12 @@ msgstr "Åpne meldingene dine"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Åpne din gamle {PRODUCT_NAME}-app og velg «Koble til en ny enhet», og skriv deretter inn koden nedenfor."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Åpne telefonens meldingsapp og opprett en ny tekstmelding."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Åpne meldingsappen på telefonen din og start en ny tekstmelding."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Nummerkontrollen vår er nede akkurat nå. Dette er vår feil, ikke nummeret ditt. Vent noen minutter og prøv samme nummer igjen."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefonnummer"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Telefonnummer er påkrevd"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefonnummer bekreftet"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Trinn for telefonbekreftelse"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Telefonverifisering er ikke tilgjengelig for denne kontoen. Bruk en annen metode eller kontakt kundestøtte."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Videredelinger: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Be om en ny kode først."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Søk i fellesskap"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Søk etter land …"
@@ -29559,17 +29559,17 @@ msgstr "Send tekst-til-tale-meldinger med /tts. Medlemmer som har slått på tek
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Send koden <0>{0}</0> til <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Send koden til telefonnummeret nedenfor."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Send denne koden"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Sende denne festede meldingen tilbake i tid?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Send til"
@@ -29606,16 +29606,11 @@ msgstr "Send talemelding"
msgid "Send:"
msgstr "Send:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Det er dyrt å sende en SMS til dette nummeret, så vi trenger at du sender oss en tekstmelding i stedet."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Det er for dyrt for {PRODUCT_NAME} å sende en SMS til dette telefonnummeret, så vi trenger at du sender oss en SMS i stedet. Vi vet at dette ikke er ideelt. Du kan også be administratorene av denne instansen om å fjerne dette kravet fra kontoen din."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Det er for dyrt for {PRODUCT_NAME} å sende en SMS til dette telefonnummeret, så vi trenger at du sender oss en SMS i stedet. Vi vet at dette ikke er ideelt. Du kan også kontakte <0>{SUPPORT_EMAIL}</0> for å få oss til å fjerne dette kravet fra kontoen din."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Jevnere video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "SMS-verifisering er utilgjengelig akkurat nå. Prøv igjen senere, eller kontakt kundestøtte."
@@ -31397,7 +31392,7 @@ msgstr "Noe gikk galt. Prøv igjen senere."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Noe gikk galt. Prøv igjen."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Kontroller for ansatte"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Standard meldingspriser fra operatøren din kan gjelde."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Takk for at du hjelper oss med å holde {productName} trygt. Vi vil gjennomgå rapporten din så snart som mulig."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Koden fungerte ikke. Sjekk den og prøv igjen."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Koden er utløpt. Be om en ny kode."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Det ser ikke ut som en gyldig URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "E-postadressen er allerede i bruk."
@@ -34118,8 +34113,8 @@ msgstr "Dette er din siste passnøkkel, og passnøkler er din andre faktor. Hvis
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Dette er din siste passnøkkel. Når den er borte, kan du ikke lenger bruke en passnøkkel som din andre faktor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Dette er ikke et mobilnummer, så det kan ikke motta SMS-en vår. Prøv et mobilnummer, eller kontakt kundestøtte hvis du mener dette er feil."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Dette kallenavnet vil bare være synlig i dette fellesskapet"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Dette nummeret må i stedet bekreftes ved at du sender en SMS til oss. Gå tilbake og start telefonbekreftelsen på nytt for å få koden og nummeret du skal sende til."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Dette nummeret krever at du sender oss en SMS for å bekrefte det, i stedet for å motta en SMS fra oss."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Moderatorene har slått av lyden for denne deltakeren"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Dette telefonnummeret kan ikke brukes. Prøv et annet mobilnummer eller kontakt kundestøtte."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Dette telefonnummeret har allerede vært brukt. Prøv et annet nummer eller kontakt kundestøtte."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Denne bekreftelsesøkten utløp. Gå tilbake til {productName} og start betalingen på nytt."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Denne bekreftelsesøkten er utløpt. Start på nytt."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Dette klarerer alle eksterne lenker og hopper over advarselen for alle domener. Dine eksisterende klarerte domener blir erstattet. Dette er mindre sikkert."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Dette vinduet oppdateres automatisk når vi mottar meldingen din."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Tilpass tonene i HDR-bilder til standard dynamisk område for å redusere maksimal lysstyrke."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "For mange forsøk. Vent litt, og prøv igjen."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Bruk en e-postadresse du har tilgang til. Vi sender en kode dit."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Bruk en annen e-postadresse enn den du har nå."
@@ -37318,17 +37313,17 @@ msgstr "Bekreft at det er deg"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Bekreft telefonnummer"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Bekreft telefonnummer"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Skjema for bekreftelse av telefonnummer"
@@ -38192,7 +38187,7 @@ msgstr "Øk volumet"
msgid "Wait a moment before deleting more messages."
msgstr "Vent litt før du sletter flere meldinger."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Vent litt. Dette vinduet lukkes automatisk når vi mottar meldingen din."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Ventetid mellom meldinger. Medlemmer med «{bypassSlowmodePermissionLabel}» kan omgå dette."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Vent her"
@@ -38368,13 +38363,13 @@ msgstr "Vi kunne ikke lese dette temaet. Det kan være skadet eller ugyldig."
msgid "We couldn't remove that account. Try again."
msgstr "Vi kunne ikke fjerne den kontoen. Prøv igjen."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Vi kunne ikke verifisere dette nummeret automatisk. Kontakt kundestøtte, så vil en person gjennomgå kontoen din."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Vi sender ikke bekreftelses-SMS til dette landet. Prøv et mobilnummer fra et annet land, eller kontakt kundestøtte."
@@ -38469,9 +38464,9 @@ msgstr "Vi sender en bekreftelseskode til e-posten din før du kan endre passord
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Vi sender en bekreftelseskode til e-posten din før du kan se reservekodene dine."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Vi sender en SMS-kode når det er mulig. Nummeret ditt er ikke knyttet til kontoen din. Vi lagrer kun en kryptert markør, uten bruker-ID, for å tillate maksimalt {PHONE_VERIFICATION_LIMIT} bekreftelser i løpet av omtrent {PHONE_VERIFICATION_WINDOW_DAYS} dager."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Vi sender en SMS-kode når den er tilgjengelig. Nummeret ditt er ikke knyttet til kontoen din. Vi beholder kun en kryptert markør, uten bruker-ID, i en begrenset periode."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Økten din i {productName} har utløpt. Logg på igjen for å fortsette
msgid "Your account"
msgstr "Din konto"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Kontoen din fungerer som normalt igjen med en gang, og du trenger ikke telefonnummer nå. Dette er ikke et permanent unntak. Hvis du blir med i et stort eller offentlig fellesskap, kan denne sjekken komme tilbake."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Kontoen din blir normal igjen med en gang, og du trenger ikke telefonnummer nå. Dette er ikke et permanent unntak, og vi kan be om denne bekreftelsen igjen senere."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Kortet ditt oppfyller kravene. Du blir nå sendt videre til betalingssiden."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Mobiloperatøren din sier at dette nummeret ikke er i bruk. Sjekk det og prøv igjen, eller kontakt kundestøtte hvis det er riktig."
@@ -40216,10 +40211,10 @@ msgstr "din nye e-postadresse"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Det nye kallenavnet ditt, eller la det stå tomt for å tilbakestille det."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Nummeret ditt er ikke knyttet til kontoen din. Vi lagrer kun en kryptert markør, uten bruker-ID, for maksimalt {limit} bekreftelser i løpet av omtrent {duration} dager."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Nummeret ditt er ikke knyttet til kontoen din. Vi lagrer kun en kryptert markør, uten bruker-ID, i en begrenset periode."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/pl/messages.po b/fluxer_app/src/features/i18n/locales/pl/messages.po
index 4a31d511f..4a1fc66c9 100644
--- a/fluxer_app/src/features/i18n/locales/pl/messages.po
+++ b/fluxer_app/src/features/i18n/locales/pl/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dni"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Przed weryfikacją telefonu wymagane jest sprawdzenie przeglądarki. Spróbuj ponownie ze strony logowania lub skontaktuj się z pomocą techniczną."
@@ -5240,8 +5240,8 @@ msgstr "Chwilowo mnie nie ma"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Wstecz"
@@ -6451,7 +6451,7 @@ msgstr "Nie można tu przesyłać plików"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Węglowy motyw"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Minutnik"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Kraj"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mail niedostępny"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Aktualizacja adresu e-mail jest obecnie niedostępna. Spróbuj ponownie później lub skontaktuj się z pomocą techniczną."
@@ -13999,7 +13999,7 @@ msgstr "Wprowadź prawidłowy adres URL lub kod szablonu {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Wpisz prawidłowy adres e-mail."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Wprowadź prawidłowy link do wiadomości."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Wprowadź prawidłowy numer telefonu komórkowego."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Wprowadź prawidłowy numer telefonu"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Wpisz {digitCount}-cyfrowy kod wysłany na numer {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Wpisz kod składający się z {MFA_CODE_DIGIT_COUNT} cyfr wysłany na numer {0}."
@@ -16137,7 +16137,7 @@ msgstr "Kup {premiumProductName}, aby dostosować swój tag lub zachować go prz
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Wyślij nowy kod"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Otwórz przeglądarkę, zaloguj się, a następnie wprowadź poniższy kod, aby połączyć swoje konto."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Otwórz wiadomości"
@@ -24047,12 +24047,12 @@ msgstr "Otwórz wiadomości"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Otwórz starą aplikację {PRODUCT_NAME} i wybierz „Połącz nowe urządzenie”, a następnie wpisz poniższy kod."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Otwórz aplikację do SMS-ów w telefonie i utwórz nową wiadomość."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Otwórz aplikację do obsługi wiadomości na telefonie i rozpocznij nową wiadomość tekstową."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Nasz system weryfikacji numerów telefonu jest obecnie niedostępny. Problem leży po naszej stronie, a nie w Twoim numerze. Poczekaj kilka minut i spróbuj ponownie z tym samym numerem."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Numer telefonu"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Numer telefonu jest wymagany"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Numer telefonu zweryfikowany"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Krok: telefon"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Weryfikacja numeru telefonu nie jest dostępna dla tego konta. Użyj innej metody lub skontaktuj się z pomocą techniczną."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Udostępnienia: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Najpierw poproś o nowy kod."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Szukaj społeczności"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Szukaj krajów..."
@@ -29559,17 +29559,17 @@ msgstr "Wysyłaj wiadomości TTS za pomocą /tts. Członkowie, którzy włączyl
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Wyślij kod <0>{0}</0> na numer <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Wyślij kod na numer telefonu poniżej."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Wyślij ten kod"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Cofnąć przypiętą wiadomość w czasie?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Wyślij na numer"
@@ -29606,16 +29606,11 @@ msgstr "Wyślij wiadomość głosową"
msgid "Send:"
msgstr "Wysyłanie:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Wysłanie SMS-a na ten numer jest kosztowne, dlatego potrzebujemy, aby wiadomość SMS trafiła od Ciebie do nas."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Wysłanie SMS-a na ten numer telefonu jest zbyt kosztowne dla {PRODUCT_NAME}, dlatego prosimy o wysłanie SMS-a do nas. Wiemy, że to nie jest idealne rozwiązanie. Możesz też poprosić administratorów tej instancji o usunięcie tego wymogu z Twojego konta."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Wysłanie SMS-a na ten numer telefonu jest zbyt kosztowne dla {PRODUCT_NAME}, dlatego prosimy o wysłanie SMS-a do nas. Wiemy, że to nie jest idealne rozwiązanie. Możesz też napisać na <0>{SUPPORT_EMAIL}</0>, abyśmy usunęli ten wymóg z Twojego konta."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Płynniejszy obraz"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Weryfikacja SMS jest teraz niedostępna. Spróbuj ponownie później lub skontaktuj się z pomocą techniczną."
@@ -31397,7 +31392,7 @@ msgstr "Coś poszło nie tak. Spróbuj ponownie później."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Coś poszło nie tak. Spróbuj ponownie."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Narzędzia zespołu"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Mogą obowiązywać standardowe stawki operatora za wiadomości."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Dziękujemy za pomoc w dbaniu o bezpieczeństwo w {productName}. Rozpatrzymy Twoje zgłoszenie tak szybko, jak to możliwe."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Ten kod nie zadziałał. Sprawdź go i spróbuj ponownie."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Ten kod wygasł. Poproś o nowy kod."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "To nie wygląda na prawidłowy adres URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Ten adres e-mail jest już używany."
@@ -34118,8 +34113,8 @@ msgstr "To Twój ostatni klucz dostępu, a klucze dostępu są Twoim drugim czyn
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "To Twój ostatni klucz dostępu. Po jego usunięciu nie będzie można używać klucza dostępu jako drugiego czynnika uwierzytelniania."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "To nie jest numer komórkowy, więc nie może odbierać naszych SMS-ów. Spróbuj podać numer komórkowy lub skontaktuj się z pomocą techniczną, jeśli uważasz, że to błąd."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Ten pseudonim będzie widoczny tylko w tej społeczności"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Ten numer jest weryfikowany przez wysłanie nam SMS-a. Wróć i ponownie rozpocznij weryfikację telefoniczną, aby otrzymać kod i numer do wysłania SMS-a."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Ten numer wymaga weryfikacji przez wysłanie do nas SMS-a zamiast odebrania SMS-a od nas."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Moderatorzy wyłączyli dźwięk temu uczestnikowi"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Tego numeru telefonu nie można użyć. Spróbuj użyć innego numeru telefonu komórkowego lub skontaktuj się z pomocą techniczną."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Ten numer telefonu został już użyty. Spróbuj użyć innego numeru lub skontaktuj się z pomocą techniczną."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Sesja weryfikacji wygasła. Wróć do {productName} i rozpocznij płatność ponownie."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Sesja weryfikacji wygasła. Zacznij od nowa."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Spowoduje to zaufanie do wszystkich linków zewnętrznych i pominięcie ostrzeżenia dla każdej domeny. Twoje istniejące zaufane domeny zostaną zastąpione. Jest to mniej bezpieczne."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "To okno zaktualizuje się automatycznie po otrzymaniu wiadomości."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Mapuj obrazy HDR do standardowego zakresu, zmniejszając szczytową jasność."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Zbyt wiele prób. Poczekaj chwilę, a następnie spróbuj ponownie."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Użyj adresu e-mail, do którego masz dostęp. Wyślemy tam kod."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Użyj adresu e-mail innego niż bieżący."
@@ -37318,17 +37313,17 @@ msgstr "Potwierdź, że to Ty"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Zweryfikuj numer telefonu"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Zweryfikuj numer telefonu"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formularz weryfikacji numeru telefonu"
@@ -38192,7 +38187,7 @@ msgstr "Zwiększ głośność"
msgid "Wait a moment before deleting more messages."
msgstr "Poczekaj chwilę, zanim usuniesz więcej wiadomości."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Poczekaj chwilę. To okno zamknie się automatycznie, gdy tylko otrzymamy Twoją wiadomość."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Odstęp między wiadomościami. Użytkownicy z uprawnieniem „{bypassSlowmodePermissionLabel}” mogą go obejść."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Poczekaj tutaj"
@@ -38368,13 +38363,13 @@ msgstr "Nie udało nam się odczytać tego motywu. Może być uszkodzony lub nie
msgid "We couldn't remove that account. Try again."
msgstr "Nie udało nam się usunąć tego konta. Spróbuj ponownie."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Nie udało nam się automatycznie zweryfikować tego numeru. Skontaktuj się z pomocą techniczną, a ktoś z zespołu sprawdzi Twoje konto."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Nie wysyłamy wiadomości weryfikacyjnych do tego kraju. Spróbuj użyć numeru telefonu komórkowego z innego kraju lub skontaktuj się z pomocą techniczną."
@@ -38469,9 +38464,9 @@ msgstr "Wyślemy kod weryfikacyjny na Twój adres e-mail, zanim zmienisz hasło.
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Wyślemy kod weryfikacyjny na Twój adres e-mail, zanim będziesz mógł wyświetlić swoje kody zapasowe."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Wyślemy kod SMS, gdy będzie dostępny. Twój numer nie jest połączony z kontem. Przechowujemy tylko zaszyfrowany znacznik, bez identyfikatora użytkownika, aby umożliwić maksymalnie {PHONE_VERIFICATION_LIMIT} weryfikacji w ciągu około {PHONE_VERIFICATION_WINDOW_DAYS} dni."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Wyślemy kod SMS, gdy będzie dostępny. Twój numer nie jest powiązany z Twoim kontem. Przechowujemy tylko zaszyfrowany znacznik, bez identyfikatora użytkownika, przez ograniczony czas."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Twoja sesja {productName} wygasła. Zaloguj się ponownie, aby kontynuow
msgid "Your account"
msgstr "Twoje konto"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Twoje konto od razu wróci do normy i na razie nie będziesz potrzebować numeru telefonu. Nie jest to stałe zwolnienie. Dołączenie do dużej lub publicznej społeczności może ponownie uruchomić tę weryfikację."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Twoje konto natychmiast wróci do normy i nie będziesz już potrzebować numeru telefonu. Nie jest to stałe zwolnienie i możemy poprosić o tę weryfikację ponownie w przyszłości."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Twoja karta spełnia warunki. Przekierowujemy Cię teraz do strony płatności."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Twój operator twierdzi, że ten numer jest wyłączony. Sprawdź go i spróbuj ponownie lub skontaktuj się z pomocą techniczną, jeśli numer jest poprawny."
@@ -40216,10 +40211,10 @@ msgstr "Twój nowy adres e-mail"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Twój nowy pseudonim lub pozostaw puste, aby zresetować."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Twój numer nie jest powiązany z kontem. Przechowujemy tylko zaszyfrowany znacznik, bez identyfikatora użytkownika, dla maksymalnie {limit} weryfikacji w ciągu około {duration} dni."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Twój numer nie jest powiązany z Twoim kontem. Przez ograniczony czas przechowujemy jedynie zaszyfrowany znacznik, bez identyfikatora użytkownika."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po b/fluxer_app/src/features/i18n/locales/pt-BR/messages.po
index 5689897e0..18dd89903 100644
--- a/fluxer_app/src/features/i18n/locales/pt-BR/messages.po
+++ b/fluxer_app/src/features/i18n/locales/pt-BR/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dias"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "É necessária uma verificação no navegador antes da verificação por telefone. Tente novamente na página de login ou entre em contato com o suporte."
@@ -5240,8 +5240,8 @@ msgstr "Ausente no momento"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Voltar"
@@ -6451,7 +6451,7 @@ msgstr "Não é possível enviar arquivos aqui"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Tema carvão"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Contagem regressiva"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "País"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mail indisponível"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "A atualização de e-mail não está disponível no momento. Tente novamente mais tarde ou entre em contato com o suporte."
@@ -13999,7 +13999,7 @@ msgstr "Insira uma URL ou um código de modelo válido do {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Insira um endereço de e-mail válido."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Insira um link de mensagem válido."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Insira um número de celular válido."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Insira um número de telefone válido"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Insira o código de {digitCount} dígitos enviado para {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Insira o código de {MFA_CODE_DIGIT_COUNT} dígitos enviado para {0}."
@@ -16137,7 +16137,7 @@ msgstr "Obtenha o {premiumProductName} para personalizar sua tag ou mantê-la ao
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Obter novo código"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Abra seu navegador, faça login e insira o código abaixo para vincular sua conta."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Abra suas mensagens"
@@ -24047,12 +24047,12 @@ msgstr "Abra suas mensagens"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Abra seu app antigo do {PRODUCT_NAME} e escolha \"Vincular um novo dispositivo\", depois insira o código abaixo."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Abra o app de mensagens do seu celular e crie uma nova mensagem de texto."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Abra o aplicativo de mensagens do celular e comece uma nova mensagem de texto."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Nosso serviço de verificação de número de telefone está indisponível no momento. A falha é nossa, não do seu número. Aguarde alguns minutos e tente o mesmo número novamente."
@@ -24810,21 +24810,21 @@ msgstr "Telefone"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Número de telefone"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Número de telefone é obrigatório"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Número de telefone verificado"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Etapa do telefone"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "A verificação por telefone não está disponível para esta conta. Use outro método ou entre em contato com o suporte."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Republicações: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Primeiro, solicite um novo código."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Buscar comunidades"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Pesquisar países..."
@@ -29559,17 +29559,17 @@ msgstr "Enviar mensagens de texto para fala com /tts. Os membros que ativaram es
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Enviar o código <0>{0}</0> para <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Envie o código para o número de telefone abaixo."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Enviar este código"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Enviar este item fixado de volta no tempo?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Enviar para"
@@ -29606,16 +29606,11 @@ msgstr "Enviar mensagem de voz"
msgid "Send:"
msgstr "Enviar:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Enviar um SMS para este número é caro, então precisamos que você nos envie uma mensagem de texto."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Enviar um SMS para este número de telefone é muito caro para o {PRODUCT_NAME}, então precisamos que você nos envie um SMS. Sabemos que isso não é o ideal. Você também pode pedir aos administradores desta instância que removam essa exigência da sua conta."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Enviar um SMS para este número de telefone é muito caro para o {PRODUCT_NAME}, então precisamos que você nos envie um SMS. Sabemos que isso não é o ideal. Você também pode entrar em contato com <0>{SUPPORT_EMAIL}</0> para que removamos essa exigência da sua conta."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Vídeo mais fluido"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "A verificação por SMS está indisponível no momento. Tente novamente mais tarde ou entre em contato com o suporte."
@@ -31397,7 +31392,7 @@ msgstr "Algo deu errado. Tente novamente mais tarde."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Algo deu errado. Tente novamente."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Controles da equipe"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Sua operadora pode cobrar as tarifas habituais de mensagens."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Obrigado por ajudar a manter o {productName} seguro. Analisaremos sua denúncia o mais rápido possível."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Esse código não funcionou. Verifique e tente novamente."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Esse código expirou. Solicite um novo código."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Parece que este não é um URL válido."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Este e-mail já está em uso."
@@ -34118,8 +34113,8 @@ msgstr "Esta é sua última chave de acesso, e as chaves de acesso são seu segu
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Esta é sua última chave de acesso. Depois que ela for removida, você não poderá mais usar uma chave de acesso como seu segundo fator."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Este não é um número de celular, então não pode receber nossos SMS. Tente um número de celular ou entre em contato com o suporte se achar que isso está incorreto."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Este apelido só ficará visível nesta comunidade"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Este número é verificado enviando uma mensagem de texto para nós. Volte e inicie a verificação por telefone novamente para obter o código e o número para enviar a mensagem."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Para verificar este número, você precisa nos enviar um SMS em vez de receber um nosso."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Os moderadores desativaram o áudio deste participante"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Este número de telefone não pode ser usado. Tente outro número de celular ou entre em contato com o suporte."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Este número de telefone já foi usado. Tente outro número ou entre em contato com o suporte."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Esta sessão de verificação expirou. Volte para o {productName} e inicie a compra novamente."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Esta sessão de verificação expirou. Comece novamente."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Isso fará com que todos os links externos sejam confiáveis e pulará o aviso para todos os domínios. Seus domínios confiáveis existentes serão substituídos. Isso é menos seguro."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Esta janela é atualizada automaticamente depois que recebemos sua mensagem."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Mapeie imagens HDR para o intervalo padrão, reduzindo o pico de brilho."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Muitas tentativas. Espere um pouco e tente novamente."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Use um endereço de e-mail ao qual você tenha acesso. Enviaremos um código para ele."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Use um e-mail diferente do seu atual."
@@ -37318,17 +37313,17 @@ msgstr "Verifique sua identidade"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verificar telefone"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verificar número de telefone"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulário de verificação do número de telefone"
@@ -38192,7 +38187,7 @@ msgstr "Aumentar volume"
msgid "Wait a moment before deleting more messages."
msgstr "Aguarde um momento antes de excluir mais mensagens."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Aguarde um momento. Esta janela fechará automaticamente assim que recebermos sua mensagem."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Intervalo entre mensagens. Membros com a permissão \"{bypassSlowmodePermissionLabel}\" podem ignorá-lo."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Aguarde"
@@ -38368,13 +38363,13 @@ msgstr "Não conseguimos ler este tema. Ele pode estar corrompido ou ser inváli
msgid "We couldn't remove that account. Try again."
msgstr "Não foi possível remover essa conta. Tente novamente."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Não foi possível verificar este número automaticamente. Entre em contato com o suporte e uma pessoa analisará sua conta."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Não enviamos SMS de verificação para este país. Tente um número de celular de outro país ou entre em contato com o suporte."
@@ -38469,9 +38464,9 @@ msgstr "Enviaremos um código de verificação para seu e-mail antes que você p
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Enviaremos um código de verificação para seu e-mail antes que você possa ver seus códigos de recuperação."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Enviaremos um código por SMS quando disponível. Seu número não está vinculado à sua conta. Mantemos apenas um marcador criptografado, sem ID de usuário, para permitir no máximo {PHONE_VERIFICATION_LIMIT} verificações em cerca de {PHONE_VERIFICATION_WINDOW_DAYS} dias."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Enviaremos um código por SMS quando estiver disponível. Seu número não está vinculado à sua conta. Mantemos apenas um marcador criptografado, sem ID de usuário, por tempo limitado."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Sua sessão do {productName} expirou. Faça login novamente para continu
msgid "Your account"
msgstr "Sua conta"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Sua conta volta ao normal imediatamente e você não precisará de um número de telefone agora. Esta não é uma isenção permanente. Entrar em uma comunidade grande ou pública pode trazer essa verificação de volta."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Sua conta volta ao normal imediatamente e você não precisará de um número de telefone agora. Esta não é uma isenção permanente e podemos solicitar essa verificação novamente mais tarde."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Seu cartão é elegível. Redirecionando para a página de pagamento."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Sua operadora informa que este número não está em serviço. Verifique-o e tente novamente, ou entre em contato com o suporte se estiver correto."
@@ -40216,10 +40211,10 @@ msgstr "seu novo e-mail"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Seu novo apelido, ou deixe em branco para redefinir."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Seu número não está vinculado à sua conta. Mantemos apenas um marcador criptografado, sem ID de usuário, para no máximo {limit} verificações em cerca de {duration} dias."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Seu número não está vinculado à sua conta. Mantemos apenas um marcador criptografado, sem ID de usuário, por tempo limitado."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/ro/messages.po b/fluxer_app/src/features/i18n/locales/ro/messages.po
index 945cf1e9b..bd829853c 100644
--- a/fluxer_app/src/features/i18n/locales/ro/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ro/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 zile"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Este necesară o verificare în browser înainte de verificarea telefonică. Încearcă din nou de pe pagina de conectare sau contactează asistența."
@@ -5240,8 +5240,8 @@ msgstr "Plecat acum"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Înapoi"
@@ -6451,7 +6451,7 @@ msgstr "Nu se pot încărca fișiere aici"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Temă cărbune"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Temporizator cu numărătoare inversă"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Țara"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-mail indisponibil"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Actualizarea e-mailului nu este disponibilă momentan. Încearcă din nou mai târziu sau contactează asistența."
@@ -13999,7 +13999,7 @@ msgstr "Introdu un URL sau un cod de șablon {theOtherPlatform} valid."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Introdu o adresă de e-mail validă."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Introdu un link de mesaj valid."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Introdu un număr de telefon mobil valid."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Introdu un număr de telefon valid"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Introdu codul de {digitCount} cifre trimis la {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Introdu codul de {MFA_CODE_DIGIT_COUNT} cifre trimis la {0}."
@@ -16137,7 +16137,7 @@ msgstr "Obține {premiumProductName} pentru a-ți personaliza tagul sau pentru a
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Cere cod nou"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Deschide browserul, conectează-te, apoi introdu codul de mai jos pentru a-ți asocia contul."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Deschide mesajele"
@@ -24047,12 +24047,12 @@ msgstr "Deschide mesajele"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Deschide vechea ta aplicație {PRODUCT_NAME} și alege „Asociază un dispozitiv nou”, apoi introdu codul de mai jos."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Deschide aplicația de mesagerie a telefonului și creează un mesaj text nou."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Deschide aplicația de mesagerie de pe telefon și începe un mesaj text nou."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Verificarea noastră a numerelor de telefon nu funcționează momentan. Problema este la noi, nu la numărul tău. Așteaptă câteva minute și încearcă din nou cu același număr."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Număr de telefon"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Numărul de telefon este obligatoriu"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Număr de telefon verificat"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Pasul telefonului"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Verificarea numărului de telefon nu este disponibilă pentru acest cont. Folosește o altă metodă sau contactează asistența."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Redistribuiri: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Solicită mai întâi un cod nou."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Caută comunități"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Caută țări..."
@@ -29559,17 +29559,17 @@ msgstr "Trimite mesaje text-to-speech cu /tts. Membrii care au activat text-to-s
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Trimite codul <0>{0}</0> la <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Trimite codul la numărul de telefon de mai jos."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Trimite acest cod"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Trimiți acest mesaj fixat înapoi în timp?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Trimite la"
@@ -29606,16 +29606,11 @@ msgstr "Trimite mesaj vocal"
msgid "Send:"
msgstr "Trimitere:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Trimiterea unui SMS la acest număr este costisitoare, așa că trebuie să ne trimiți tu un mesaj."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Trimiterea unui SMS către acest număr de telefon este prea costisitoare pentru {PRODUCT_NAME}, așa că trebuie să ne trimiți tu un SMS. Știm că nu este ideal. Poți cere și administratorilor acestei instanțe să-ți elimine această cerință din cont."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Trimiterea unui SMS către acest număr de telefon este prea costisitoare pentru {PRODUCT_NAME}, așa că trebuie să ne trimiți tu un SMS. Știm că nu este ideal. Poți contacta și <0>{SUPPORT_EMAIL}</0> pentru a-ți elimina această cerință din cont."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Video mai fluid"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Verificarea prin SMS nu este disponibilă momentan. Încearcă din nou mai târziu sau contactează asistența."
@@ -31397,7 +31392,7 @@ msgstr "Ceva nu a mers bine. Încearcă din nou mai târziu."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Ceva nu a mers bine. Încearcă din nou."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Controale pentru personal"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Se pot aplica tarife standard de mesagerie de la operatorul tău."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Îți mulțumim că ne ajuți să păstrăm {productName} în siguranță. Îți vom examina raportul cât mai curând posibil."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Codul nu a funcționat. Verifică-l și încearcă din nou."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Acest cod a expirat. Solicită un cod nou."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Nu pare un URL valid."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Acest e-mail este deja utilizat."
@@ -34118,8 +34113,8 @@ msgstr "Aceasta este ultima ta cheie de acces, iar cheile de acces sunt al doile
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Aceasta este ultima ta cheie de acces. Odată ce o ștergi, nu vei mai putea folosi o cheie de acces ca al doilea factor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Acesta nu este un număr de mobil, deci nu poate primi SMS-ul nostru. Încearcă un număr de mobil sau contactează suportul dacă crezi că este greșit."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Acest pseudonim va fi vizibil doar în această comunitate"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Acest număr se verifică printr-un SMS trimis de tine. Revino și începe din nou verificarea telefonică pentru a obține codul și numărul la care să trimiți mesajul."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Acest număr necesită un SMS trimis de tine, nu unul primit de la noi."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Acestui participant i-a fost dezactivat sunetul de moderatori"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Acest număr de telefon nu poate fi utilizat. Încearcă un alt număr de mobil sau contactează asistența."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Acest număr de telefon a fost deja utilizat. Încearcă un alt număr sau contactează asistența."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Sesiunea de verificare a expirat. Revino la {productName} și începe din nou procesul de plată."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Sesiunea de verificare a expirat. Începe din nou."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Aceasta va acorda încredere tuturor linkurilor externe și va omite avertismentul pentru fiecare domeniu. Domeniile tale de încredere existente vor fi înlocuite. Această opțiune este mai puțin sigură."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Această fereastră se actualizează automat după ce primim mesajul tău."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Mapează imaginile HDR la un interval standard, reducând luminozitatea maximă."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Prea multe încercări. Așteaptă puțin, apoi încearcă din nou."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Folosește o adresă de e-mail la care ai acces. Îți vom trimite un cod acolo."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Folosește o adresă de e-mail diferită de cea actuală."
@@ -37318,17 +37313,17 @@ msgstr "Confirmă că ești tu"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verifică numărul de telefon"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verifică numărul de telefon"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formular de verificare a numărului de telefon"
@@ -38192,7 +38187,7 @@ msgstr "Mărește volumul"
msgid "Wait a moment before deleting more messages."
msgstr "Așteaptă un moment înainte să ștergi mai multe mesaje."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Așteaptă un moment. Această fereastră se va închide automat după ce primim mesajul tău."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Așteaptă între mesaje. Membrii cu permisiunea „{bypassSlowmodePermissionLabel}” pot ocoli această limită."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Așteaptă aici"
@@ -38368,13 +38363,13 @@ msgstr "Nu am putut citi această temă. Poate fi coruptă sau nevalidă."
msgid "We couldn't remove that account. Try again."
msgstr "Nu am putut elimina acest cont. Încearcă din nou."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Nu am putut verifica automat acest număr. Contactează asistența și o persoană va analiza contul tău."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Nu trimitem mesaje de verificare în această țară. Încearcă un număr de mobil din altă țară sau contactează asistența."
@@ -38469,9 +38464,9 @@ msgstr "Îți vom trimite un cod de verificare pe e-mail înainte să-ți poți
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Îți vom trimite un cod de verificare pe e-mail înainte să poți vedea codurile de rezervă."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Vom trimite un cod SMS când va fi disponibil. Numărul tău nu este conectat la contul tău. Păstrăm doar un marcator criptat, fără ID de utilizator, pentru a permite cel mult {PHONE_VERIFICATION_LIMIT} verificări în aproximativ {PHONE_VERIFICATION_WINDOW_DAYS} zile."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Vom trimite un cod SMS când va fi disponibil. Numărul tău nu este legat de contul tău. Păstrăm doar un marcator criptat, fără ID de utilizator, pentru o perioadă limitată."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Sesiunea ta {productName} a expirat. Conectează-te din nou pentru a con
msgid "Your account"
msgstr "Contul tău"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Contul tău revine imediat la normal și nu vei mai avea nevoie de un număr de telefon. Aceasta nu este o scutire permanentă. Alăturarea la o comunitate mare sau publică poate readuce această verificare."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Contul tău revine imediat la normal și nu vei mai avea nevoie de un număr de telefon. Aceasta nu este o scutire permanentă și putem solicita această verificare din nou mai târziu."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Cardul tău este eligibil. Te redirecționăm acum către pagina de plată."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Operatorul tău spune că acest număr nu este activ. Verifică-l și încearcă din nou sau contactează asistența dacă este corect."
@@ -40216,10 +40211,10 @@ msgstr "noul tău e-mail"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Noul tău pseudonim sau lasă gol pentru a-l reseta."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Numărul tău nu este conectat la contul tău. Păstrăm doar un marcator criptat, fără ID de utilizator, pentru cel mult {limit} verificări în aproximativ {duration} zile."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Numărul tău nu este asociat cu contul tău. Păstrăm doar un identificator criptat, fără ID de utilizator, pentru o perioadă limitată."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/ru/messages.po b/fluxer_app/src/features/i18n/locales/ru/messages.po
index af03dad69..cb595b052 100644
--- a/fluxer_app/src/features/i18n/locales/ru/messages.po
+++ b/fluxer_app/src/features/i18n/locales/ru/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 дней"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Перед подтверждением номера телефона требуется проверка в браузере. Повторите попытку со страницы входа или обратитесь в службу поддержки."
@@ -5240,8 +5240,8 @@ msgstr "Сейчас нет на месте"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Назад"
@@ -6451,7 +6451,7 @@ msgstr "Сюда нельзя загружать файлы"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Тема «Уголь»"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Таймер обратного отсчёта"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Страна"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Почта недоступна"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Обновление эл. почты сейчас недоступно. Повторите попытку позже или обратитесь в службу поддержки."
@@ -13999,7 +13999,7 @@ msgstr "Введите допустимый URL-адрес или код шаб
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Введите действительный адрес электронной почты."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Введите действительную ссылку на сообщение."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Введите действительный номер мобильного телефона."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Введите действительный номер телефона"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Введите {digitCount}-значный код, отправленный на номер {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Введите {MFA_CODE_DIGIT_COUNT}-значный код, отправленный на номер {0}."
@@ -16137,7 +16137,7 @@ msgstr "Оформите {premiumProductName}, чтобы настроить с
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Получить новый код"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Откройте браузер, войдите в аккаунт, затем введите код ниже, чтобы привязать свой аккаунт."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Откройте сообщения"
@@ -24047,12 +24047,12 @@ msgstr "Откройте сообщения"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Откройте старое приложение {PRODUCT_NAME} и выберите «Привязать новое устройство», затем введите код ниже."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Откройте приложение для обмена сообщениями на телефоне и создайте новое текстовое сообщение."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Откройте приложение для обмена сообщениями на телефоне и начните новое текстовое сообщение."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Наша проверка номеров телефона сейчас не работает. Дело в нас, а не в вашем номере. Подождите несколько минут и попробуйте тот же номер снова."
@@ -24810,21 +24810,21 @@ msgstr "Телефон"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Номер телефона"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Требуется номер телефона"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Номер телефона подтвержден"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Шаг телефона"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Подтверждение по телефону недоступно для этого аккаунта. Используйте другой способ или обратитесь в поддержку."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Репосты: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Сначала запросите новый код."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Поиск сообществ"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Поиск стран..."
@@ -29559,17 +29559,17 @@ msgstr "Отправлять сообщения с преобразование
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Отправить код <0>{0}</0> на <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Отправьте код на указанный ниже номер телефона."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Отправьте этот код"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Отправить это закрепление в прошлое?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Отправить на"
@@ -29606,16 +29606,11 @@ msgstr "Отправить голосовое сообщение"
msgid "Send:"
msgstr "Отправка:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Отправка SMS на этот номер стоит дорого, поэтому нам нужно, чтобы вы отправили SMS нам."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Отправка SMS на этот номер слишком дорого обходится {PRODUCT_NAME}, поэтому нам нужно, чтобы вы отправили SMS нам. Мы знаем, что это не очень удобно. Вы также можете попросить администраторов этого экземпляра снять это требование с вашего аккаунта."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Отправка SMS на этот номер слишком дорого обходится {PRODUCT_NAME}, поэтому нам нужно, чтобы вы отправили SMS нам. Мы знаем, что это не очень удобно. Вы также можете написать на <0>{SUPPORT_EMAIL}</0>, чтобы мы сняли это требование с вашего аккаунта."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Более плавное видео"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Подтверждение по SMS сейчас недоступно. Повторите попытку позже или обратитесь в службу поддержки."
@@ -31397,7 +31392,7 @@ msgstr "Что-то пошло не так. Повторите попытку п
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Что-то пошло не так. Повторите попытку."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Инструменты сотрудников"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Может взиматься стандартная плата за сообщения согласно тарифу вашего оператора."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Спасибо, что помогаете нам обеспечивать безопасность в {productName}. Мы рассмотрим вашу жалобу как можно скорее."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Этот код не подошёл. Проверьте его и попробуйте ещё раз."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Срок действия кода истёк. Запросите новый код."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Похоже, это недействительная ссылка."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Этот адрес электронной почты уже используется."
@@ -34118,8 +34113,8 @@ msgstr "Это ваш последний ключ доступа, а ключи
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Это ваш последний ключ доступа. После его удаления вы не сможете использовать ключ доступа в качестве второго фактора."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Это не мобильный номер, поэтому он не может получать наши SMS. Попробуйте мобильный номер или свяжитесь с поддержкой, если считаете, что это ошибка."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Этот никнейм будет виден только в этом сообществе"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Этот номер подтверждается отправкой сообщения нам. Вернитесь и начните проверку номера телефона заново, чтобы получить код и номер для отправки сообщения."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Этот номер нужно подтвердить сообщением от вас, а не SMS от нас."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Модераторы отключили звук этому участнику"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Этот номер телефона нельзя использовать. Попробуйте другой номер или обратитесь в службу поддержки."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Этот номер телефона уже использовался. Попробуйте другой номер или обратитесь в службу поддержки."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Срок действия сессии проверки истёк. Вернитесь в {productName} и начните оформление покупки заново."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Срок действия сессии проверки истёк. Начните заново."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Это позволит доверять всем внешним ссылкам и пропускать предупреждение для каждого домена. Ваши существующие доверенные домены будут заменены. Это менее безопасно."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Это окно обновится автоматически, как только мы получим ваше сообщение."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Тональная компрессия HDR-изображений до стандартного диапазона, уменьшающая пиковую яркость."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Слишком много попыток. Подождите немного и повторите попытку."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Используйте электронную почту, к которой у вас есть доступ. Мы отправим туда код."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Используйте адрес электронной почты, отличный от текущего."
@@ -37318,17 +37313,17 @@ msgstr "Подтвердите, что это вы"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Подтвердить телефон"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Подтвердить номер телефона"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Форма подтверждения номера телефона"
@@ -38192,7 +38187,7 @@ msgstr "Увеличить громкость"
msgid "Wait a moment before deleting more messages."
msgstr "Подождите немного, прежде чем удалять другие сообщения."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Подождите. Это окно закроется автоматически, как только мы получим ваше сообщение."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Интервал между сообщениями. Участники с разрешением «{bypassSlowmodePermissionLabel}» могут его обойти."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Подождите"
@@ -38368,13 +38363,13 @@ msgstr "Не удалось прочитать эту тему. Возможно
msgid "We couldn't remove that account. Try again."
msgstr "Не удалось удалить аккаунт. Попробуйте ещё раз."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Не удалось автоматически подтвердить этот номер. Свяжитесь с поддержкой, и ваш аккаунт проверит сотрудник."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Мы не отправляем проверочные SMS в эту страну. Попробуйте использовать номер мобильного телефона из другой страны или обратитесь в службу поддержки."
@@ -38469,9 +38464,9 @@ msgstr "Мы отправим код подтверждения на вашу п
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Мы отправим код подтверждения на вашу электронную почту, прежде чем вы сможете просмотреть резервные коды."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Мы отправим SMS-код, когда это будет возможно. Ваш номер не привязан к аккаунту. Мы храним только зашифрованный маркер без ID пользователя, чтобы разрешить не более {PHONE_VERIFICATION_LIMIT} подтверждений примерно за {PHONE_VERIFICATION_WINDOW_DAYS} дней."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Мы отправим SMS-код, когда он будет доступен. Ваш номер не будет привязан к вашей учетной записи. Мы сохраним только зашифрованный маркер без идентификатора пользователя на ограниченное время."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Срок действия вашей сессии {productName} истё
msgid "Your account"
msgstr "Ваш аккаунт"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Ваш аккаунт сразу вернётся в обычный режим, и номер телефона сейчас не понадобится. Это не постоянное исключение. При вступлении в большое или публичное сообщество эта проверка может появиться снова."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Ваш аккаунт сразу вернется в обычный режим, и номер телефона вам больше не понадобится. Это не постоянное исключение, и мы можем запросить эту проверку позже."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Ваша карта подходит. Перенаправляем вас на страницу оплаты."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Ваш оператор сообщил, что номер не обслуживается. Проверьте его и попробуйте снова или обратитесь в службу поддержки, если номер указан верно."
@@ -40216,10 +40211,10 @@ msgstr "ваш новый адрес эл. почты"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Новый никнейм. Оставьте поле пустым, чтобы сбросить его."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Ваш номер не привязан к аккаунту. Мы храним только зашифрованный маркер без ID пользователя, максимум для {limit} проверок в течение примерно {duration} дней."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Ваш номер не привязан к аккаунту. Мы храним только зашифрованный маркер без идентификатора пользователя в течение ограниченного времени."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po b/fluxer_app/src/features/i18n/locales/sv-SE/messages.po
index ce280f4b9..106c48f20 100644
--- a/fluxer_app/src/features/i18n/locales/sv-SE/messages.po
+++ b/fluxer_app/src/features/i18n/locales/sv-SE/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 dagar"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "En webbläsarkontroll krävs innan telefonverifiering. Försök igen från inloggningssidan eller kontakta supporten."
@@ -5240,8 +5240,8 @@ msgstr "Borta just nu"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Tillbaka"
@@ -6451,7 +6451,7 @@ msgstr "Kan inte ladda upp filer här"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Koltema"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Nedräkningstimer"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Land"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-postadressen är inte tillgänglig"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Det går inte att uppdatera e-postadressen just nu. Försök igen senare eller kontakta supporten."
@@ -13999,7 +13999,7 @@ msgstr "Ange en giltig malladress eller kod för {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Ange en giltig e-postadress."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Ange en giltig meddelandelänk."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Ange ett giltigt mobilnummer."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Ange ett giltigt telefonnummer"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Ange den {digitCount}-siffriga koden som skickats till {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Ange den {MFA_CODE_DIGIT_COUNT}-siffriga koden som skickades till {0}."
@@ -16137,7 +16137,7 @@ msgstr "Skaffa {premiumProductName} för att anpassa din tagg eller behålla den
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Hämta ny kod"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Öppna din webbläsare, logga in och ange sedan koden nedan för att länka ditt konto."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Öppna dina meddelanden"
@@ -24047,12 +24047,12 @@ msgstr "Öppna dina meddelanden"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Öppna din gamla {PRODUCT_NAME}-app, välj Länka en ny enhet och ange sedan koden nedan."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Öppna telefonens meddelandeapp och skapa ett nytt SMS."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Öppna telefonens meddelandeapp och påbörja ett nytt SMS."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Vår kontroll av telefonnummer är nere just nu. Det är vårt fel, inte ditt nummer. Vänta några minuter och försök med samma nummer igen."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefonnummer"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Telefonnummer krävs"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefonnummer verifierat"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Telefonsteg"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Telefonverifiering är inte tillgänglig för det här kontot. Använd en annan metod eller kontakta support."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Återpubliceringar: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Begär en ny kod först."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Sök communities"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Sök länder..."
@@ -29559,17 +29559,17 @@ msgstr "Skicka text-till-tal-meddelanden med /tts. Medlemmar som har aktiverat t
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Skicka koden <0>{0}</0> till <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Skicka koden till telefonnumret nedan."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Skicka den här koden"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Ska den här fästade posten skickas tillbaka i tiden?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Skicka till"
@@ -29606,16 +29606,11 @@ msgstr "Skicka röstmeddelande"
msgid "Send:"
msgstr "Skicka:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Att skicka ett sms till det här numret är dyrt, så vi behöver att du skickar ett sms till oss istället."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Att skicka ett SMS till det här telefonnumret är för dyrt för {PRODUCT_NAME}, så vi behöver att du skickar ett SMS till oss istället. Vi vet att det här inte är optimalt. Du kan också be administratörerna för den här instansen att ta bort det här kravet från ditt konto."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Att skicka ett SMS till det här telefonnumret är för dyrt för {PRODUCT_NAME}, så vi behöver att du skickar ett SMS till oss istället. Vi vet att det här inte är optimalt. Du kan också kontakta <0>{SUPPORT_EMAIL}</0> för att få oss att ta bort det här kravet från ditt konto."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Mjukare video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Sms-verifiering är inte tillgänglig just nu. Försök igen senare eller kontakta supporten."
@@ -31397,7 +31392,7 @@ msgstr "Något gick fel. Försök igen senare."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Något gick fel. Försök igen."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Personalinställningar"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Standardtaxor för meddelanden från din operatör kan tillkomma."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Tack för att du hjälper till att hålla {productName} säkert. Vi granskar din anmälan så snart som möjligt."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Koden fungerade inte. Kontrollera den och försök igen."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Koden har gått ut. Begär en ny kod."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Det där ser inte ut som en giltig URL."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "E-postadressen används redan."
@@ -34118,8 +34113,8 @@ msgstr "Det här är din sista lösennyckel, och lösennycklar är din andra fak
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Det här är din sista lösennyckel. När den är borta kan du inte längre använda en lösennyckel som din andra faktor."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Det här är inte ett mobilnummer, så det kan inte ta emot våra SMS. Prova ett mobilnummer, eller kontakta support om du tror att det är fel."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Det här smeknamnet syns bara i den här communityn"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Det här numret verifieras genom att skicka ett SMS till oss istället. Gå tillbaka och starta telefonverifieringen igen för att få koden och numret att skicka till."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Det här numret måste verifieras genom att du skickar ett SMS till oss i stället för att ta emot ett från oss."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Moderatorerna stängde av den här deltagarens ljud"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Det här telefonnumret kan inte användas. Prova ett annat mobilnummer eller kontakta supporten."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Det här telefonnumret har redan använts. Prova ett annat nummer eller kontakta supporten."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Verifieringssessionen har löpt ut. Gå tillbaka till {productName} och starta kassan igen."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Verifieringssessionen har löpt ut. Börja om."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Detta kommer att lita på alla externa länkar och hoppa över varningen för varje domän. Dina befintliga betrodda domäner kommer att ersättas. Detta är mindre säkert."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Det här fönstret uppdateras automatiskt när vi har tagit emot ditt meddelande."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Tonmappa HDR-bilder till standardomfång, vilket minskar den högsta ljusstyrkan."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "För många försök. Vänta en stund och försök igen."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Använd en e-postadress du har tillgång till. Vi skickar en kod dit."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Använd en annan e-postadress än din nuvarande."
@@ -37318,17 +37313,17 @@ msgstr "Verifiera att det är du"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Verifiera telefonnummer"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Verifiera telefonnummer"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Formulär för att verifiera telefonnummer"
@@ -38192,7 +38187,7 @@ msgstr "Höj volymen"
msgid "Wait a moment before deleting more messages."
msgstr "Vänta en stund innan du tar bort fler meddelanden."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Vänta ett ögonblick. Det här fönstret stängs automatiskt när vi har tagit emot ditt meddelande."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Vänta mellan meddelanden. Medlemmar med behörigheten ”{bypassSlowmodePermissionLabel}” kan kringgå detta."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Vänta här"
@@ -38368,13 +38363,13 @@ msgstr "Vi kunde inte läsa det här temat. Det kan vara skadat eller ogiltigt."
msgid "We couldn't remove that account. Try again."
msgstr "Vi kunde inte ta bort kontot. Försök igen."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Vi kunde inte verifiera numret automatiskt. Kontakta supporten så granskar en person ditt konto."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Vi skickar inte verifierings-SMS till det här landet. Prova ett mobilnummer från ett annat land eller kontakta supporten."
@@ -38469,9 +38464,9 @@ msgstr "Vi skickar en verifieringskod till din e-post innan du kan ändra ditt l
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Vi skickar en verifieringskod till din e-postadress innan du kan se dina reservkoder."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Vi skickar en SMS-kod när det är möjligt. Ditt nummer är inte kopplat till ditt konto. Vi sparar endast en krypterad markör, utan användar-ID, för att tillåta högst {PHONE_VERIFICATION_LIMIT} verifieringar under cirka {PHONE_VERIFICATION_WINDOW_DAYS} dagar."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Vi skickar en SMS-kod när den är tillgänglig. Ditt nummer är inte kopplat till ditt konto. Vi behåller endast en krypterad markör, utan användar-ID, under en begränsad tid."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Din {productName}-session har upphört. Logga in igen för att fortsätt
msgid "Your account"
msgstr "Ditt konto"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Ditt konto fungerar som vanligt igen direkt och du behöver inget telefonnummer nu. Detta är inget permanent undantag. Om du går med i en stor eller offentlig community kan kontrollen återkomma."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Ditt konto återgår till det normala direkt och du behöver ingen telefonnummer nu. Detta är inte ett permanent undantag, och vi kan komma att begära denna kontroll igen senare."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Ditt kort är godkänt. Du omdirigeras nu till betalningssidan."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Din mobiloperatör säger att numret inte är i bruk. Kontrollera det och försök igen, eller kontakta support om det stämmer."
@@ -40216,10 +40211,10 @@ msgstr "din nya e-postadress"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Ditt nya smeknamn, eller lämna tomt för att återställa det."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Ditt nummer är inte kopplat till ditt konto. Vi sparar endast en krypterad markör, utan användar-ID, för högst {limit} verifieringar under cirka {duration} dagar."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Ditt nummer är inte kopplat till ditt konto. Vi sparar bara en krypterad markör, utan användar-ID, under en begränsad tid."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/th/messages.po b/fluxer_app/src/features/i18n/locales/th/messages.po
index 6890c9fbf..f259d8964 100644
--- a/fluxer_app/src/features/i18n/locales/th/messages.po
+++ b/fluxer_app/src/features/i18n/locales/th/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 วัน"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "ต้องมีการตรวจสอบเบราว์เซอร์ก่อนยืนยันเบอร์โทรศัพท์ ลองอีกครั้งจากหน้าลงชื่อเข้าใช้หรือติดต่อฝ่ายสนับสนุน"
@@ -5240,8 +5240,8 @@ msgstr "ไม่อยู่ตอนนี้"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "ย้อนกลับ"
@@ -6451,7 +6451,7 @@ msgstr "อัปโหลดไฟล์ที่นี่ไม่ได้"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "ธีมถ่านหิน"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "ตัวจับเวลาถอยหลัง"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "ประเทศ"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "อีเมลไม่พร้อมใช้งาน"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "ขณะนี้ไม่สามารถอัปเดตอีเมลได้ โปรดลองอีกครั้งในภายหลังหรือติดต่อฝ่ายสนับสนุน"
@@ -13999,7 +13999,7 @@ msgstr "ป้อน URL หรือรหัสเทมเพลต {theOther
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "ป้อนที่อยู่อีเมลที่ถูกต้อง"
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "ป้อนลิงก์ข้อความที่ถูกต้อง"
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "ป้อนหมายเลขโทรศัพท์มือถือที่ถูกต้อง"
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "ป้อนหมายเลขโทรศัพท์ที่ถูกต้อง"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "ป้อนรหัส {digitCount} หลักที่ส่งไปยัง {phoneNumber}"
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "ป้อนรหัส {MFA_CODE_DIGIT_COUNT} หลักที่ส่งไปยัง {0}"
@@ -16137,7 +16137,7 @@ msgstr "รับ {premiumProductName} เพื่อปรับแต่ง
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "ขอรหัสใหม่"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "เปิดเบราว์เซอร์ของคุณ ลงชื่อเข้าใช้ แล้วป้อนรหัสข้างล่างเพื่อเชื่อมโยงบัญชีของคุณ"
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "เปิดข้อความของคุณ"
@@ -24047,12 +24047,12 @@ msgstr "เปิดข้อความของคุณ"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "เปิดแอป {PRODUCT_NAME} เดิมของคุณ แล้วเลือก \"เชื่อมโยงอุปกรณ์ใหม่\" จากนั้นป้อนรหัสด้านล่าง"
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "เปิดแอปข้อความในโทรศัพท์ของคุณ แล้วสร้างข้อความใหม่"
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "เปิดแอปข้อความในโทรศัพท์ของคุณ แล้วเริ่มข้อความใหม่"
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "การตรวจสอบหมายเลขโทรศัพท์ของเราขัดข้องในขณะนี้ เป็นความผิดพลาดของเรา ไม่ใช่หมายเลขของคุณ โปรดรอสักครู่แล้วลองหมายเลขเดิมอีกครั้ง"
@@ -24810,21 +24810,21 @@ msgstr "โทรศัพท์"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "เบอร์โทรศัพท์"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "ต้องระบุเบอร์โทรศัพท์"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "ยืนยันเบอร์โทรศัพท์แล้ว"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "ขั้นตอนโทรศัพท์"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "การยืนยันทางโทรศัพท์ไม่พร้อมใช้งานสำหรับบัญชีนี้ โปรดใช้วิธีอื่นหรือติดต่อฝ่ายสนับสนุน"
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "รีโพสต์: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "โปรดขอรหัสใหม่ก่อน"
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "ค้นหาคอมมูนิตี้"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "ค้นหาประเทศ..."
@@ -29559,17 +29559,17 @@ msgstr "ส่งข้อความแบบอ่านออกเสีย
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "ส่งรหัส <0>{0}</0> ไปที่ <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "ส่งรหัสไปยังหมายเลขโทรศัพท์ด้านล่าง"
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "ส่งรหัสนี้"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "ส่งรายการปักหมุดนี้ย้อนเวลากลับไปไหม"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "ส่งไปที่"
@@ -29606,16 +29606,11 @@ msgstr "ส่งข้อความเสียง"
msgid "Send:"
msgstr "ส่ง:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "การส่ง SMS ไปยังหมายเลขนี้มีค่าใช้จ่ายสูง เราจึงขอให้คุณส่งข้อความหาเราแทน"
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "การส่ง SMS ไปยังเบอร์นี้มีค่าใช้จ่ายสูงเกินไปสำหรับ {PRODUCT_NAME} เราจึงอยากให้คุณส่ง SMS มาให้เราแทน เราทราบว่านี่อาจไม่สะดวก คุณสามารถขอให้ผู้ดูแลระบบของอินสแตนซ์นี้ยกเลิกข้อกำหนดนี้ออกจากบัญชีของคุณได้เช่นกัน"
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "การส่ง SMS ไปยังเบอร์นี้มีค่าใช้จ่ายสูงเกินไปสำหรับ {PRODUCT_NAME} เราจึงอยากให้คุณส่ง SMS มาให้เราแทน เราทราบว่านี่อาจไม่สะดวก คุณสามารถติดต่อ <0>{SUPPORT_EMAIL}</0> เพื่อให้เรายกเลิกข้อกำหนดนี้ออกจากบัญชีของคุณได้"
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "วิดีโอที่ราบรื่นขึ้น"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "ไม่สามารถยืนยัน SMS ได้ในขณะนี้ โปรดลองอีกครั้งในภายหลังหรือติดต่อฝ่ายสนับสนุน"
@@ -31397,7 +31392,7 @@ msgstr "เกิดข้อผิดพลาด โปรดลองอี
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "เกิดข้อผิดพลาด โปรดลองอีกครั้ง"
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "เครื่องมือสำหรับเจ้าหน้าที่"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "อาจมีค่าบริการส่งข้อความตามปกติจากผู้ให้บริการเครือข่ายของคุณ"
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "ขอบคุณที่ช่วยให้ {productName} ปลอดภัย เราจะตรวจสอบรายงานของคุณโดยเร็วที่สุด"
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "รหัสไม่ถูกต้อง โปรดตรวจสอบแล้วลองอีกครั้ง"
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "รหัสหมดอายุแล้ว โปรดขอรหัสใหม่"
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "ดูเหมือนจะไม่ใช่ URL ที่ถูกต้อง"
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "อีเมลนี้ถูกใช้ไปแล้ว"
@@ -34118,8 +34113,8 @@ msgstr "นี่คือพาสคีย์สุดท้ายของค
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "นี่คือพาสคีย์สุดท้ายของคุณ เมื่อลบแล้ว คุณจะไม่สามารถใช้พาสคีย์เป็นการยืนยันชั้นที่สองได้"
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "นี่ไม่ใช่หมายเลขโทรศัพท์มือถือ จึงไม่สามารถรับข้อความของเราได้ โปรดลองใช้หมายเลขโทรศัพท์มือถือ หรือติดต่อฝ่ายสนับสนุนหากคุณคิดว่าข้อมูลนี้ไม่ถูกต้อง"
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "ชื่อเล่นนี้จะแสดงในคอมมูนิตี้นี้เท่านั้น"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "หมายเลขนี้ต้องยืนยันด้วยการส่งข้อความหาเราแทน กลับไปเริ่มการยืนยันทางโทรศัพท์อีกครั้งเพื่อรับรหัสและหมายเลขที่จะส่งข้อความไป"
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "หมายเลขนี้ต้องยืนยันด้วยข้อความแทน SMS จากเรา"
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "ผู้เข้าร่วมรายนี้ถูกผู้ดูแลปิดเสียงทั้งหมด"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "ไม่สามารถใช้หมายเลขโทรศัพท์นี้ได้ โปรดลองใช้หมายเลขโทรศัพท์มือถืออื่นหรือติดต่อฝ่ายสนับสนุน"
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "หมายเลขโทรศัพท์นี้ถูกใช้ไปแล้ว ลองใช้หมายเลขอื่นหรือติดต่อฝ่ายสนับสนุน"
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "เซสชันการยืนยันนี้หมดอายุแล้ว กลับไปที่ {productName} และเริ่มการชำระเงินอีกครั้ง"
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "เซสชันการยืนยันนี้หมดอายุแล้ว โปรดเริ่มใหม่อีกครั้ง"
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "การดำเนินการนี้จะเชื่อถือลิงก์ภายนอกทั้งหมดและข้ามคำเตือนสำหรับทุกโดเมน โดเมนที่เชื่อถืออยู่เดิมของคุณจะถูกแทนที่ ซึ่งมีความปลอดภัยน้อยกว่า"
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "หน้าต่างนี้จะอัปเดตอัตโนมัติหลังจากเราได้รับข้อความของคุณ"
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "ปรับโทนภาพ HDR เป็นช่วงมาตรฐาน ลดความสว่างสูงสุด"
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "พยายามหลายครั้งเกินไป โปรดรอสักครู่แล้วลองอีกครั้ง"
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "ใช้อีเมลที่คุณสามารถเปิดได้ เราจะส่งรหัสไปที่นั่น"
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "ใช้อีเมลที่แตกต่างจากอีเมลปัจจุบันของคุณ"
@@ -37318,17 +37313,17 @@ msgstr "ยืนยันว่าเป็นคุณ"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "ยืนยันเบอร์โทรศัพท์"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "ยืนยันเบอร์โทรศัพท์"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "แบบฟอร์มยืนยันเบอร์โทรศัพท์"
@@ -38192,7 +38187,7 @@ msgstr "เพิ่มระดับเสียง"
msgid "Wait a moment before deleting more messages."
msgstr "รอสักครู่ก่อนลบข้อความอื่น"
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "รอสักครู่ หน้าต่างนี้จะปิดเองเมื่อเราได้รับข้อความของคุณ"
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "เว้นระยะเวลาระหว่างการส่งข้อความ สมาชิกที่มีสิทธิ์ \"{bypassSlowmodePermissionLabel}\" สามารถข้ามได้"
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "รอสักครู่"
@@ -38368,13 +38363,13 @@ msgstr "เราอ่านธีมนี้ไม่ได้ ธีมอ
msgid "We couldn't remove that account. Try again."
msgstr "เราไม่สามารถนำบัญชีนั้นออกได้ โปรดลองอีกครั้ง"
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "เราไม่สามารถยืนยันหมายเลขนี้ได้โดยอัตโนมัติ โปรดติดต่อฝ่ายสนับสนุน แล้วจะมีเจ้าหน้าที่ตรวจสอบบัญชีของคุณ"
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "เราไม่ส่งข้อความยืนยันไปยังประเทศนี้ โปรดลองใช้หมายเลขโทรศัพท์มือถือจากประเทศอื่น หรือติดต่อฝ่ายสนับสนุน"
@@ -38469,9 +38464,9 @@ msgstr "เราจะส่งรหัสยืนยันไปที่อ
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "เราจะส่งรหัสยืนยันไปยังอีเมลของคุณก่อนที่คุณจะดูรหัสสำรองได้"
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "เราจะส่งรหัส SMS ให้เมื่อพร้อมใช้งาน เบอร์ของคุณไม่ได้เชื่อมกับบัญชีของคุณ เราเก็บเพียงเครื่องหมายเข้ารหัสที่ไม่มี ID ผู้ใช้ เพื่อให้ยืนยันตัวตนได้สูงสุด {PHONE_VERIFICATION_LIMIT} ครั้งในประมาณ {PHONE_VERIFICATION_WINDOW_DAYS} วัน"
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "เราจะส่งรหัส SMS เมื่อพร้อมใช้งาน หมายเลขของคุณจะไม่เชื่อมโยงกับบัญชีของคุณ เราจะเก็บเฉพาะเครื่องหมายที่เข้ารหัสไว้เท่านั้น โดยไม่มีรหัสผู้ใช้ และเก็บไว้ในระยะเวลาจำกัด"
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "เซสชัน {productName} ของคุณหมดอายุ
msgid "Your account"
msgstr "บัญชีของคุณ"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "บัญชีของคุณจะกลับมาเป็นปกติทันที และตอนนี้คุณยังไม่ต้องใช้เบอร์โทรศัพท์ นี่ไม่ใช่การยกเว้นถาวร การเข้าร่วมคอมมูนิตี้ขนาดใหญ่หรือคอมมูนิตี้สาธารณะอาจทำให้การตรวจสอบนี้กลับมา"
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "บัญชีของคุณจะกลับมาเป็นปกติทันที และคุณจะไม่ต้องใช้เบอร์โทรศัพท์อีกต่อไป นี่ไม่ใช่การยกเว้นถาวร และเราอาจขอให้คุณยืนยันอีกครั้งในภายหลัง"
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "บัตรของคุณใช้ได้ กำลังนำคุณไปยังหน้าชำระเงิน"
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "ผู้ให้บริการของคุณแจ้งว่าหมายเลขนี้ไม่ได้เปิดใช้งาน โปรดตรวจสอบและลองอีกครั้ง หรือติดต่อฝ่ายสนับสนุนหากหมายเลขถูกต้อง"
@@ -40216,10 +40211,10 @@ msgstr "อีเมลใหม่ของคุณ"
msgid "Your new nickname, or leave blank to reset it."
msgstr "ชื่อเล่นใหม่ของคุณ หรือเว้นว่างไว้เพื่อรีเซ็ต"
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "หมายเลขของคุณไม่ได้เชื่อมโยงกับบัญชีของคุณ เราจะเก็บเพียงเครื่องหมายที่เข้ารหัสไว้โดยไม่มี ID ผู้ใช้ สำหรับการยืนยันไม่เกิน {limit} ครั้งในเวลาประมาณ {duration} วัน"
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "หมายเลขโทรศัพท์ของคุณไม่ได้เชื่อมโยงกับบัญชีของคุณ เราจะเก็บเฉพาะเครื่องหมายที่เข้ารหัสไว้เท่านั้น โดยไม่มีรหัสผู้ใช้ และเก็บไว้เป็นเวลาจำกัด"
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/tr/messages.po b/fluxer_app/src/features/i18n/locales/tr/messages.po
index 314f5b61c..89e47dc2b 100644
--- a/fluxer_app/src/features/i18n/locales/tr/messages.po
+++ b/fluxer_app/src/features/i18n/locales/tr/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 gün"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Telefon doğrulamasından önce tarayıcı kontrolü gerekiyor. Giriş sayfasından tekrar deneyin veya destekle iletişime geçin."
@@ -5240,8 +5240,8 @@ msgstr "Şu an uzakta"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Geri"
@@ -6451,7 +6451,7 @@ msgstr "Buraya dosya yüklenemiyor"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Kömür teması"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Geri sayım sayacı"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Ülke"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "E-posta kullanılamıyor"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "E-posta güncellemesi şu anda kullanılamıyor. Daha sonra tekrar deneyin veya destekle iletişime geçin."
@@ -13999,7 +13999,7 @@ msgstr "Geçerli bir {theOtherPlatform} şablon URL'si veya kodu girin."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Geçerli bir e-posta adresi girin."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Geçerli bir mesaj bağlantısı girin."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Geçerli bir cep telefonu numarası girin."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Geçerli bir telefon numarası girin"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "{phoneNumber} numarasına gönderilen {digitCount} haneli kodu girin."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "{0} numarasına gönderilen {MFA_CODE_DIGIT_COUNT} haneli kodu girin."
@@ -16137,7 +16137,7 @@ msgstr "Etiketinizi özelleştirmek veya kullanıcı adınızı değiştirirken
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Yeni kod al"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Tarayıcınızı açın, oturum açın ve hesabınızı bağlamak için aşağıdaki kodu girin."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Mesajlarınızı açın"
@@ -24047,12 +24047,12 @@ msgstr "Mesajlarınızı açın"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Eski {PRODUCT_NAME} uygulamanızı açın ve Yeni bir cihaz bağla seçeneğini belirleyip aşağıdaki kodu girin."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Telefonunuzun mesajlaşma uygulamasını açın ve yeni bir kısa mesaj oluşturun."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Telefonunuzun mesajlaşma uygulamasını açın ve yeni bir kısa mesaj başlatın."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Telefon numarası kontrolümüz şu anda çalışmıyor. Bu bizim hatamız, numaranızın değil. Birkaç dakika bekleyip aynı numarayı tekrar deneyin."
@@ -24810,21 +24810,21 @@ msgstr "Telefon"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Telefon numarası"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Telefon numarası gerekli"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Telefon numarası doğrulandı"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Telefon adımı"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Bu hesap için telefon doğrulaması kullanılamıyor. Başka bir yöntem kullanın veya destek ekibiyle iletişime geçin."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Yeniden paylaşımlar: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Önce yeni bir kod isteyin."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Toplulukları ara"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Ülkeleri ara..."
@@ -29559,17 +29559,17 @@ msgstr "Metin okuma mesajlarını /tts ile gönderin. Metin okumayı açan üyel
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "<0>{0}</0> kodunu <1>{1}</1> numarasına gönderin"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Kodu aşağıdaki telefon numarasına gönderin."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Bu kodu gönder"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Bu sabitlemeyi zamanda geriye gönderelim mi?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Gönderilecek numara"
@@ -29606,16 +29606,11 @@ msgstr "Sesli mesaj gönder"
msgid "Send:"
msgstr "Gönderme:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Bu numaraya SMS göndermek pahalı olduğundan, bunun yerine bize mesaj göndermeniz gerekiyor."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Bu telefon numarasına SMS göndermek {PRODUCT_NAME} için çok pahalı, bu yüzden bunun yerine sizin bize bir SMS göndermeniz gerekiyor. Bunun ideal olmadığının farkındayız. Bu gereksinimi hesabınızdan kaldırmaları için bu kurulumun yöneticilerine de başvurabilirsiniz."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Bu telefon numarasına SMS göndermek {PRODUCT_NAME} için çok pahalı, bu yüzden bunun yerine sizin bize bir SMS göndermeniz gerekiyor. Bunun ideal olmadığının farkındayız. Bu gereksinimi hesabınızdan kaldırmamız için <0>{SUPPORT_EMAIL}</0> adresiyle de iletişime geçebilirsiniz."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Daha akıcı video"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "SMS doğrulaması şu anda kullanılamıyor. Daha sonra tekrar deneyin veya destekle iletişime geçin."
@@ -31397,7 +31392,7 @@ msgstr "Bir sorun oluştu. Lütfen daha sonra tekrar deneyin."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Bir şeyler ters gitti. Tekrar deneyin."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Personel kontrolleri"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Operatörünüzün standart mesajlaşma ücretleri geçerli olabilir."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "{productName} uygulamasını güvenli tutmaya yardımcı olduğunuz için teşekkür ederiz. Raporunuzu en kısa sürede inceleyeceğiz."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Bu kod çalışmadı. Kontrol edip tekrar deneyin."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Bu kodun süresi doldu. Yeni bir kod isteyin."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Geçerli bir URL gibi görünmüyor."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Bu e-posta adresi zaten kullanımda."
@@ -34118,8 +34113,8 @@ msgstr "Bu son geçiş anahtarınız ve geçiş anahtarları ikinci faktörünü
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Bu son geçiş anahtarınız. Bunu sildikten sonra ikinci faktör olarak geçiş anahtarı kullanamazsınız."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Bu bir mobil numara değil, bu yüzden mesajımızı alamaz. Başka bir mobil numara deneyin veya yanlış olduğunu düşünüyorsanız destek ekibiyle iletişime geçin."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Bu takma ad yalnızca bu toplulukta görünür olacak"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Bu numara bunun yerine bize mesaj göndererek doğrulanır. Kodu ve mesaj atılacak numarayı almak için geri dönüp telefonla doğrulamayı yeniden başlatın."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Bu numaranın, bizden SMS almak yerine bize mesaj göndererek doğrulanması gerekiyor."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Bu katılımcı moderatörler tarafından sağırlaştırıldı"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Bu telefon numarası kullanılamıyor. Başka bir mobil numara deneyin veya destekle iletişime geçin."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Bu telefon numarası zaten kullanılmış. Başka bir numara deneyin veya destekle iletişime geçin."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Bu doğrulama oturumunun süresi doldu. {productName} uygulamasına dönün ve ödeme işlemine yeniden başlayın."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Bu doğrulama oturumunun süresi doldu. Lütfen yeniden başlayın."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Bu işlem, tüm harici bağlantılara güvenecek ve her alan adı için uyarıyı atlayacaktır. Mevcut güvenilir alan adlarınız değiştirilecektir. Bu daha az güvenlidir."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Mesajınızı aldıktan sonra bu pencere otomatik olarak güncellenecektir."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "HDR görüntüleri standart aralığa ton eşleyerek en yüksek parlaklığı azaltın."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Çok fazla deneme yaptınız. Biraz bekleyip tekrar deneyin."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Erişebileceğiniz bir e-posta adresi kullanın. Oraya bir kod göndereceğiz."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Mevcut e-postanızdan farklı bir e-posta kullanın."
@@ -37318,17 +37313,17 @@ msgstr "Kimliğinizi doğrulayın"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Telefonu doğrula"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Telefon numarasını doğrula"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Telefon numarası doğrulama formu"
@@ -38192,7 +38187,7 @@ msgstr "Sesi artır"
msgid "Wait a moment before deleting more messages."
msgstr "Daha fazla mesaj silmeden önce biraz bekleyin."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Biraz bekleyin. Mesajınızı aldığımızda bu pencere otomatik olarak kapanacaktır."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Mesajlar arasında bekleme süresi. \"{bypassSlowmodePermissionLabel}\" iznine sahip üyeler bunu atlayabilir."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Burada bekleyin"
@@ -38368,13 +38363,13 @@ msgstr "Bu temayı okuyamadık. Bozuk veya geçersiz olabilir."
msgid "We couldn't remove that account. Try again."
msgstr "Bu hesabı kaldıramadık. Lütfen tekrar deneyin."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Bu numarayı otomatik olarak doğrulayamadık. Destek ekibiyle iletişime geçin, bir kişi hesabınızı inceleyecektir."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Bu ülkeye doğrulama SMS'leri göndermiyoruz. Başka bir ülkenin mobil numarasını deneyin veya destek ekibimizle iletişime geçin."
@@ -38469,9 +38464,9 @@ msgstr "Parolanızı değiştirmeden önce e-postanıza bir doğrulama kodu gön
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Yedek kodlarınızı görüntüleyebilmeniz için önce e-postanıza bir doğrulama kodu göndereceğiz."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Mümkün olduğunda bir SMS kodu göndereceğiz. Numaranız hesabınıza bağlı değil. Yaklaşık {PHONE_VERIFICATION_WINDOW_DAYS} gün içinde en fazla {PHONE_VERIFICATION_LIMIT} doğrulamaya izin vermek için kullanıcı kimliği olmadan yalnızca şifrelenmiş bir işaretçi tutarız."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Uygun olduğunda SMS kodu göndereceğiz. Numaranız hesabınıza bağlı değil. Yalnızca sınırlı bir süre için şifrelenmiş bir işaret tutuyoruz, kullanıcı kimliği olmadan."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "{productName} oturumunuzun süresi doldu. Bu uygulamaya yetki vermeye de
msgid "Your account"
msgstr "Hesabınız"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Hesabınız hemen normale döner ve artık telefon numarasına ihtiyacınız olmaz. Bu kalıcı bir muafiyet değildir. Büyük veya herkese açık bir topluluğa katılmak bu kontrolü tekrar getirebilir."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Hesabınız hemen normale döner ve artık telefon numarasına ihtiyacınız olmaz. Bu kalıcı bir muafiyet değildir ve bu kontrolü daha sonra tekrar isteyebiliriz."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Kartınız uygun. Şimdi ödeme sayfasına yönlendiriliyorsunuz."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Operatörünüz bu numaranın kullanımda olmadığını belirtiyor. Kontrol edip tekrar deneyin veya doğruysa destek ekibimizle iletişime geçin."
@@ -40216,10 +40211,10 @@ msgstr "yeni e-postanız"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Yeni takma adınız veya sıfırlamak için boş bırakın."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Numaranız hesabınıza bağlı değil. Kullanıcı kimliği olmadan yalnızca şifrelenmiş bir işaretleyiciyi, yaklaşık {duration} gün içinde en fazla {limit} doğrulama için saklarız."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Numaranız hesabınıza bağlı değil. Yalnızca sınırlı bir süre için şifrelenmiş bir işaretleyici saklıyoruz, kullanıcı kimliği olmadan."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/uk/messages.po b/fluxer_app/src/features/i18n/locales/uk/messages.po
index 5b8cebb50..b7e25ceb7 100644
--- a/fluxer_app/src/features/i18n/locales/uk/messages.po
+++ b/fluxer_app/src/features/i18n/locales/uk/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 днів"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Перед підтвердженням номера телефону потрібна перевірка в браузері. Спробуйте ще раз зі сторінки входу або зверніться до служби підтримки."
@@ -5240,8 +5240,8 @@ msgstr "Зараз відсутній(-я)"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Назад"
@@ -6451,7 +6451,7 @@ msgstr "Сюди не можна завантажити файли"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Тема «Вугілля»"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Таймер зворотного відліку"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Країна"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Електронна пошта недоступна"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Оновлення електронної пошти зараз недоступне. Спробуйте пізніше або зверніться до служби підтримки."
@@ -13999,7 +13999,7 @@ msgstr "Введіть дійсну URL-адресу або код шаблон
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Введіть дійсну адресу електронної пошти."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Введіть дійсне посилання на повідомлення."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Введіть дійсний номер мобільного телефону."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Введіть дійсний номер телефону"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Введіть {digitCount}-значний код, надісланий на номер {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Введіть {MFA_CODE_DIGIT_COUNT}-значний код, надісланий на номер {0}."
@@ -16137,7 +16137,7 @@ msgstr "Отримайте {premiumProductName}, щоб налаштувати
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Отримати новий код"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Відкрийте браузер, увійдіть, а потім введіть код нижче, щоб зв'язати свій обліковий запис."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Відкрийте повідомлення"
@@ -24047,12 +24047,12 @@ msgstr "Відкрийте повідомлення"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Відкрийте свій старий застосунок {PRODUCT_NAME} і виберіть «Підключити новий пристрій», а потім введіть код нижче."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Відкрийте застосунок для обміну повідомленнями на телефоні та створіть нове текстове повідомлення."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Відкрийте застосунок для обміну повідомленнями на телефоні та почніть нове текстове повідомлення."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Наша перевірка номерів телефону зараз не працює. Це проблема на нашому боці, а не з вашим номером. Зачекайте кілька хвилин і спробуйте ще раз із тим самим номером."
@@ -24810,21 +24810,21 @@ msgstr "Телефон"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Номер телефону"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Потрібен номер телефону"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Номер телефону підтверджено"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Крок телефону"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Підтвердження номера телефону недоступне для цього облікового запису. Скористайтеся іншим способом або зверніться до служби підтримки."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Репости: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Спершу запитайте новий код."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Пошук спільнот"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Пошук країн..."
@@ -29559,17 +29559,17 @@ msgstr "Надсилати повідомлення з озвученням те
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Надішліть код <0>{0}</0> на <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Надішліть код на вказаний нижче номер телефону."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Надіслати цей код"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Надіслати це закріплене повідомлення назад у минуле?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Надіслати на"
@@ -29606,16 +29606,11 @@ msgstr "Надіслати голосове повідомлення"
msgid "Send:"
msgstr "Надсилання:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Надсилання SMS на цей номер коштує дорого, тому просимо вас натомість написати нам."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Надсилання SMS на цей номер телефону занадто дороге для {PRODUCT_NAME}, тому нам потрібно, щоб ви надіслали SMS нам. Ми знаємо, що це не ідеально. Ви також можете попросити адміністраторів цього екземпляра зняти цю вимогу з вашого облікового запису."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Надсилання SMS на цей номер телефону занадто дороге для {PRODUCT_NAME}, тому нам потрібно, щоб ви надіслали SMS нам. Ми знаємо, що це не ідеально. Ви також можете зв'язатися з <0>{SUPPORT_EMAIL}</0>, щоб ми зняли цю вимогу з вашого облікового запису."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Плавніше відео"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Підтвердження через SMS наразі недоступне. Спробуйте пізніше або зверніться до служби підтримки."
@@ -31397,7 +31392,7 @@ msgstr "Щось пішло не так. Спробуйте пізніше."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Щось пішло не так. Спробуйте ще раз."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Керування для персоналу"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Може стягуватися стандартна плата за повідомлення від вашого оператора."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Дякуємо, що допомагаєте зробити {productName} безпечним. Ми розглянемо вашу скаргу якомога швидше."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Цей код не спрацював. Перевірте його та спробуйте ще раз."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Термін дії цього коду закінчився. Запитайте новий код."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Це не схоже на дійсну URL-адресу."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Ця електронна адреса вже використовується."
@@ -34118,8 +34113,8 @@ msgstr "Це ваш останній ключ доступу, а ключі до
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Це ваш останній ключ доступу. Після його видалення ви не зможете використовувати ключ доступу як другий фактор."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Це не номер мобільного телефону, тому він не може отримувати наші SMS. Спробуйте вказати номер мобільного телефону або зверніться до служби підтримки, якщо вважаєте, що це помилка."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Цей псевдонім буде видно лише в цій спільноті"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Цей номер підтверджується надсиланням нам SMS. Поверніться та знову почніть підтвердження номера телефону, щоб отримати код і номер, на який надіслати SMS."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Цей номер потрібно підтвердити, надіславши нам SMS, а не отримавши код від нас."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Модератори вимкнули звук цьому учаснику"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Цей номер телефону не можна використовувати. Спробуйте інший мобільний номер або зверніться до служби підтримки."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Цей номер телефону вже використовувався. Спробуйте інший номер або зверніться до служби підтримки."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Термін дії сеансу перевірки закінчився. Поверніться до {productName} і почніть оформлення замовлення знову."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Термін дії цього сеансу перевірки закінчився. Почніть знову."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Це дозволить довіряти всім зовнішнім посиланням і пропускати попередження для кожного домену. Ваші наявні довірені домени буде замінено. Це менш безпечно."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Це вікно автоматично оновиться після отримання вашого повідомлення."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Перетворювати HDR-зображення у стандартний діапазон, зменшуючи пікову яскравість."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Забагато спроб. Зачекайте трохи, потім спробуйте ще раз."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Використовуйте електронну адресу, до якої маєте доступ. Ми надішлемо туди код."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Використовуйте електронну адресу, яка відрізняється від поточної."
@@ -37318,17 +37313,17 @@ msgstr "Підтвердьте, що це ви"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Підтвердити номер телефону"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Підтвердити номер телефону"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Форма підтвердження номера телефону"
@@ -38192,7 +38187,7 @@ msgstr "Збільшити гучність"
msgid "Wait a moment before deleting more messages."
msgstr "Зачекайте мить, перш ніж видаляти інші повідомлення."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Зачекайте. Це вікно автоматично закриється, щойно ми отримаємо ваше повідомлення."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Час між повідомленнями. Учасники з дозволом «{bypassSlowmodePermissionLabel}» можуть це обійти."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Зачекайте тут"
@@ -38368,13 +38363,13 @@ msgstr "Не вдалося прочитати цю тему. Можливо, в
msgid "We couldn't remove that account. Try again."
msgstr "Не вдалося видалити обліковий запис. Спробуйте ще раз."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Не вдалося автоматично підтвердити цей номер. Зверніться до служби підтримки, і людина перегляне ваш обліковий запис."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Ми не надсилаємо повідомлення з кодом підтвердження в цю країну. Спробуйте мобільний номер з іншої країни або зверніться до служби підтримки."
@@ -38469,9 +38464,9 @@ msgstr "Ми надішлемо код підтвердження на вашу
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Ми надішлемо код підтвердження на вашу електронну пошту, перш ніж ви зможете переглянути резервні коди."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Ми надішлемо SMS-код, коли це буде можливо. Ваш номер не прив'язаний до вашого облікового запису. Ми зберігаємо лише зашифрований маркер без ідентифікатора користувача, щоб дозволити щонайбільше {PHONE_VERIFICATION_LIMIT} перевірок приблизно за {PHONE_VERIFICATION_WINDOW_DAYS} днів."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Ми надішлемо SMS-код, коли він буде доступний. Ваш номер не буде пов’язано з вашим обліковим записом. Ми зберігаємо лише зашифрований маркер без ідентифікатора користувача протягом обмеженого часу."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Термін дії вашої сесії {productName} закінчив
msgid "Your account"
msgstr "Ваш обліковий запис"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Ваш обліковий запис одразу почне працювати як зазвичай, і номер телефону зараз не знадобиться. Це не постійний виняток. Приєднання до великої або публічної спільноти може знову активувати цю перевірку."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Ваш обліковий запис одразу повернеться до норми, і телефонний номер вам більше не знадобиться. Це не постійне звільнення, і ми можемо попросити пройти цю перевірку знову пізніше."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Ваша картка підходить. Перенаправляємо вас на сторінку оплати."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Ваш оператор повідомив, що цей номер не обслуговується. Перевірте його та спробуйте ще раз, або зверніться до служби підтримки, якщо номер правильний."
@@ -40216,10 +40211,10 @@ msgstr "ваша нова електронна адреса"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Ваш новий псевдонім або залиште порожнім, щоб скинути його."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Ваш номер не прив'язаний до облікового запису. Ми зберігаємо лише зашифрований маркер без ідентифікатора користувача, максимум для {limit} перевірок протягом приблизно {duration} днів."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Ваш номер не пов’язаний з вашим обліковим записом. Ми зберігаємо лише зашифрований маркер без ідентифікатора користувача протягом обмеженого часу."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/vi/messages.po b/fluxer_app/src/features/i18n/locales/vi/messages.po
index 965d83940..62b4eb3d4 100644
--- a/fluxer_app/src/features/i18n/locales/vi/messages.po
+++ b/fluxer_app/src/features/i18n/locales/vi/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 ngày"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "Cần xác minh trình duyệt trước khi xác minh số điện thoại. Hãy thử lại từ trang đăng nhập hoặc liên hệ bộ phận hỗ trợ."
@@ -5240,8 +5240,8 @@ msgstr "Đang vắng mặt"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "Quay lại"
@@ -6451,7 +6451,7 @@ msgstr "Không thể tải tệp lên ở đây"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "Giao diện Than"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "Đồng hồ đếm ngược"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "Quốc gia"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "Email không khả dụng"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "Hiện không thể cập nhật email. Vui lòng thử lại sau hoặc liên hệ bộ phận hỗ trợ."
@@ -13999,7 +13999,7 @@ msgstr "Nhập URL mẫu hoặc mã mẫu hợp lệ của {theOtherPlatform}."
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "Nhập địa chỉ email hợp lệ."
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "Nhập liên kết tin nhắn hợp lệ."
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "Nhập số điện thoại di động hợp lệ."
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "Nhập số điện thoại hợp lệ"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "Nhập mã gồm {digitCount} chữ số đã gửi đến {phoneNumber}."
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "Nhập mã gồm {MFA_CODE_DIGIT_COUNT} chữ số đã gửi đến {0}."
@@ -16137,7 +16137,7 @@ msgstr "Nâng cấp lên {premiumProductName} để tùy chỉnh thẻ hoặc gi
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "Lấy mã mới"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "Mở trình duyệt, đăng nhập, sau đó nhập mã bên dưới để liên kết tài khoản của bạn."
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "Mở tin nhắn của bạn"
@@ -24047,12 +24047,12 @@ msgstr "Mở tin nhắn của bạn"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "Mở ứng dụng {PRODUCT_NAME} cũ của bạn và chọn Liên kết thiết bị mới, sau đó nhập mã bên dưới."
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "Mở ứng dụng nhắn tin trên điện thoại của bạn và tạo tin nhắn văn bản mới."
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "Mở ứng dụng nhắn tin trên điện thoại và bắt đầu một tin nhắn văn bản mới."
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "Hệ thống kiểm tra số điện thoại của chúng tôi hiện đang gặp sự cố. Lỗi này là do chúng tôi, không phải do số của bạn. Hãy đợi vài phút rồi thử lại chính số đó."
@@ -24810,21 +24810,21 @@ msgstr "Điện thoại"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "Số điện thoại"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "Cần có số điện thoại"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "Đã xác minh số điện thoại"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "Bước điện thoại"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "Xác minh số điện thoại không khả dụng cho tài khoản này. Hãy dùng phương thức khác hoặc liên hệ bộ phận hỗ trợ."
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "Lượt đăng lại: <0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "Yêu cầu mã mới trước."
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "Tìm cộng đồng"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "Tìm kiếm quốc gia..."
@@ -29559,17 +29559,17 @@ msgstr "Gửi tin nhắn chuyển văn bản thành giọng nói bằng lệnh /
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "Gửi mã <0>{0}</0> đến <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "Gửi mã đến số điện thoại bên dưới."
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "Gửi mã này"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "Gửi ghim này về quá khứ?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "Gửi đến"
@@ -29606,16 +29606,11 @@ msgstr "Gửi tin nhắn thoại"
msgid "Send:"
msgstr "Gửi:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "Gửi SMS đến số này rất tốn kém, vì vậy thay vào đó bạn cần nhắn tin cho chúng tôi."
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "Việc gửi SMS đến số điện thoại này quá tốn kém đối với {PRODUCT_NAME}, vì vậy bạn cần gửi SMS cho chúng tôi. Chúng tôi biết điều này không lý tưởng. Bạn cũng có thể nhờ quản trị viên của máy chủ này gỡ bỏ yêu cầu này khỏi tài khoản của bạn."
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "Việc gửi SMS đến số điện thoại này quá tốn kém đối với {PRODUCT_NAME}, vì vậy bạn cần gửi SMS cho chúng tôi. Chúng tôi biết điều này không lý tưởng. Bạn cũng có thể liên hệ <0>{SUPPORT_EMAIL}</0> để chúng tôi gỡ bỏ yêu cầu này khỏi tài khoản của bạn."
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "Video mượt hơn"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "Xác minh SMS hiện không khả dụng. Vui lòng thử lại sau hoặc liên hệ với bộ phận hỗ trợ."
@@ -31397,7 +31392,7 @@ msgstr "Đã xảy ra lỗi. Vui lòng thử lại sau."
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "Đã xảy ra lỗi. Vui lòng thử lại."
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "Điều khiển dành cho nhân viên"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "Có thể áp dụng cước phí nhắn tin tiêu chuẩn từ nhà mạng của bạn."
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "Cảm ơn bạn đã giúp giữ cho {productName} an toàn. Chúng tôi sẽ xem xét báo cáo của bạn sớm nhất có thể."
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "Mã đó không đúng. Hãy kiểm tra lại và thử lại."
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "Mã đó đã hết hạn. Hãy yêu cầu mã mới."
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "Đây không phải là một URL hợp lệ."
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "Email này đã được sử dụng."
@@ -34118,8 +34113,8 @@ msgstr "Đây là khóa truy cập cuối cùng của bạn và khóa truy cập
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "Đây là khóa truy cập cuối cùng của bạn. Khi khóa này bị xóa, bạn sẽ không thể sử dụng khóa truy cập làm yếu tố thứ hai nữa."
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "Đây không phải là số di động nên không nhận được tin nhắn của chúng tôi. Hãy thử một số di động, hoặc liên hệ bộ phận hỗ trợ nếu bạn cho rằng có nhầm lẫn."
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "Biệt danh này sẽ chỉ hiển thị trong cộng đồng này"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "Số này phải được xác minh bằng cách nhắn tin cho chúng tôi. Hãy quay lại và bắt đầu lại phần xác minh số điện thoại để nhận mã và số cần nhắn tin đến."
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "Số này cần được xác minh bằng cách bạn nhắn tin đến cho chúng tôi, thay vì nhận SMS từ chúng tôi."
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "Người tham gia này đã bị người điều hành tắt tiếng nghe"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "Không thể sử dụng số điện thoại này. Hãy thử số di động khác hoặc liên hệ bộ phận hỗ trợ."
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "Số điện thoại này đã được sử dụng. Hãy thử số khác hoặc liên hệ bộ phận hỗ trợ."
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "Phiên xác minh này đã hết hạn. Quay lại {productName} và bắt đầu thanh toán lại."
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "Phiên xác minh này đã hết hạn. Vui lòng thử lại."
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "Thao tác này sẽ tin cậy tất cả các liên kết bên ngoài và bỏ qua cảnh báo cho mọi miền. Các miền đáng tin cậy hiện có của bạn sẽ bị thay thế. Điều này kém an toàn hơn."
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "Cửa sổ này sẽ tự động cập nhật sau khi chúng tôi nhận được tin nhắn của bạn."
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "Ánh xạ tông màu ảnh HDR về dải tiêu chuẩn, giảm độ sáng tối đa."
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "Đã thử quá nhiều lần. Vui lòng đợi một lát rồi thử lại."
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "Dùng địa chỉ email mà bạn truy cập được. Chúng tôi sẽ gửi mã đến đó."
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "Sử dụng email khác với email hiện tại của bạn."
@@ -37318,17 +37313,17 @@ msgstr "Xác minh đó là bạn"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "Xác minh số điện thoại"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "Xác minh số điện thoại"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "Biểu mẫu xác minh số điện thoại"
@@ -38192,7 +38187,7 @@ msgstr "Tăng âm lượng"
msgid "Wait a moment before deleting more messages."
msgstr "Đợi một lát trước khi xóa thêm tin nhắn."
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "Đợi một chút. Cửa sổ này sẽ tự động đóng khi chúng tôi nhận được tin nhắn của bạn."
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "Chờ giữa các tin nhắn. Thành viên có quyền \"{bypassSlowmodePermissionLabel}\" có thể bỏ qua giới hạn này."
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "Đợi ở đây"
@@ -38368,13 +38363,13 @@ msgstr "Không đọc được chủ đề này. Có thể chủ đề bị lỗ
msgid "We couldn't remove that account. Try again."
msgstr "Chúng tôi không thể xóa tài khoản đó. Vui lòng thử lại."
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "Chúng tôi không thể xác minh số này một cách tự động. Hãy liên hệ bộ phận hỗ trợ, sẽ có người xem xét tài khoản của bạn."
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "Chúng tôi không gửi tin nhắn xác minh đến quốc gia này. Vui lòng thử số di động từ quốc gia khác hoặc liên hệ bộ phận hỗ trợ."
@@ -38469,9 +38464,9 @@ msgstr "Chúng tôi sẽ gửi mã xác minh đến email của bạn trước k
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "Chúng tôi sẽ gửi một mã xác minh đến email của bạn trước khi bạn có thể xem mã dự phòng của mình."
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "Chúng tôi sẽ gửi mã SMS khi có thể. Số điện thoại của bạn không được liên kết với tài khoản của bạn. Chúng tôi chỉ lưu một mã đánh dấu được mã hóa, không có ID người dùng, để cho phép tối đa {PHONE_VERIFICATION_LIMIT} lần xác minh trong khoảng {PHONE_VERIFICATION_WINDOW_DAYS} ngày."
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Chúng tôi sẽ gửi mã SMS khi có sẵn. Số của bạn không được liên kết với tài khoản của bạn. Chúng tôi chỉ lưu giữ một mã đánh dấu được mã hóa, không có ID người dùng, trong một thời gian giới hạn."
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "Phiên {productName} của bạn đã hết hạn. Vui lòng đăng nh
msgid "Your account"
msgstr "Tài khoản của bạn"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "Tài khoản của bạn sẽ trở lại bình thường ngay lập tức và bạn chưa cần số điện thoại vào lúc này. Đây không phải là miễn trừ vĩnh viễn. Tham gia một cộng đồng lớn hoặc công khai có thể khiến bước kiểm tra này quay lại."
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "Tài khoản của bạn sẽ trở lại bình thường ngay lập tức và bạn sẽ không cần số điện thoại nữa. Đây không phải là miễn trừ vĩnh viễn và chúng tôi có thể yêu cầu kiểm tra lại sau."
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "Thẻ của bạn đủ điều kiện. Đang chuyển bạn đến trang thanh toán."
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "Nhà mạng cho biết số này không còn được sử dụng. Vui lòng kiểm tra lại rồi thử lại, hoặc liên hệ bộ phận hỗ trợ nếu số này là chính xác."
@@ -40216,10 +40211,10 @@ msgstr "email mới của bạn"
msgid "Your new nickname, or leave blank to reset it."
msgstr "Biệt danh mới của bạn, hoặc để trống để đặt lại."
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "Số điện thoại của bạn chưa được liên kết với tài khoản. Chúng tôi chỉ lưu trữ một điểm đánh dấu được mã hóa, không có ID người dùng, cho tối đa {limit} lần xác minh trong khoảng {duration} ngày."
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "Số của bạn không được liên kết với tài khoản của bạn. Chúng tôi chỉ lưu giữ một mã hóa được mã hóa, không có ID người dùng, trong một thời gian giới hạn."
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po b/fluxer_app/src/features/i18n/locales/zh-CN/messages.po
index e09d76812..b27608814 100644
--- a/fluxer_app/src/features/i18n/locales/zh-CN/messages.po
+++ b/fluxer_app/src/features/i18n/locales/zh-CN/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 天"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "电话验证前需要进行浏览器检查。请从登录页面重试,或联系支持团队。"
@@ -5240,8 +5240,8 @@ msgstr "当前离开"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "返回"
@@ -6451,7 +6451,7 @@ msgstr "无法在此上传文件"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "煤炭主题"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "倒计时"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "国家/地区"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "邮箱不可用"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "暂时无法更新邮箱。请稍后重试或联系支持团队。"
@@ -13999,7 +13999,7 @@ msgstr "请输入有效的 {theOtherPlatform} 模板网址或代码。"
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "请输入有效的电子邮件地址。"
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "请输入有效的消息链接。"
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "请输入有效的手机号码。"
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "请输入有效的电话号码"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "输入发送到 {phoneNumber} 的 {digitCount} 位验证码。"
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "输入发送至 {0} 的 {MFA_CODE_DIGIT_COUNT} 位验证码。"
@@ -16137,7 +16137,7 @@ msgstr "获取 {premiumProductName} 以自定义你的标签,或在更改用
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "获取新验证码"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "打开浏览器,登录后输入以下代码以关联你的账号。"
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "打开短信应用"
@@ -24047,12 +24047,12 @@ msgstr "打开短信应用"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "打开你的旧版 {PRODUCT_NAME} 应用,选择“关联新设备”,然后输入下方的验证码。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "打开手机短信应用,创建一条新短信。"
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "打开手机短信应用,然后开始一条新短信。"
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "我们的电话号码验证服务暂时不可用。这是我们的问题,与你的号码无关。请等几分钟后用同一个号码重试。"
@@ -24810,21 +24810,21 @@ msgstr "手机"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "手机号"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "需要手机号"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "手机号已验证"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "手机步骤"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "此账号无法进行手机验证。请使用其他方式或联系支持团队。"
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "转发:<0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "请先请求新验证码。"
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "搜索社区"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "搜索国家/地区…"
@@ -29559,17 +29559,17 @@ msgstr "使用 /tts 发送文本转语音消息。开启了文本转语音的成
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "将验证码 <0>{0}</0> 发送到 <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "将验证码发送到以下手机号。"
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "发送此验证码"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "要把这条置顶消息送回过去吗?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "发送至"
@@ -29606,16 +29606,11 @@ msgstr "发送语音消息"
msgid "Send:"
msgstr "发送:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "向此号码发送短信费用较高,因此需要你改为向我们发送短信。"
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "向此手机号发送短信对 {PRODUCT_NAME} 来说费用太高,因此需要你改为向我们发送短信。我们知道这不太理想。你也可以请此实例的管理员为你的账号取消此项要求。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "向此手机号发送短信对 {PRODUCT_NAME} 来说费用太高,因此需要你改为向我们发送短信。我们知道这不太理想。你也可以联系 <0>{SUPPORT_EMAIL}</0>,让我们为你的账号取消此项要求。"
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "更流畅的视频"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "短信验证暂时不可用。请稍后重试或联系支持团队。"
@@ -31397,7 +31392,7 @@ msgstr "出错了。请稍后重试。"
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "出错了。请重试。"
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "员工工具"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "你的运营商可能会收取标准短信费用。"
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "感谢你帮助维护 {productName} 的安全。我们会尽快审核你的举报。"
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "验证码无效。请检查后重试。"
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "验证码已过期。请申请新验证码。"
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "网址格式不正确。"
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "该邮箱已被占用。"
@@ -34118,8 +34113,8 @@ msgstr "这是你的最后一个通行密钥,而通行密钥是你的第二重
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "这是你的最后一个通行密钥。删除后,你将无法再使用通行密钥作为第二重验证。"
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "这不是手机号码,无法接收我们的短信。请改用手机号码。如果你认为这是误判,请联系支持团队。"
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "此昵称仅在此社区内可见"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "此号码需要改为由你发短信给我们来验证。请返回并重新开始手机验证,以获取验证码和接收短信的号码。"
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "此号码需要由你主动发短信来验证,而不是接收我们发送的短信。"
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "该参与者已被管理员设为拒听"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "此电话号码无法使用。请尝试其他手机号码或联系支持团队。"
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "此电话号码已被使用。请尝试其他号码或联系支持团队。"
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "验证会话已过期。请返回 {productName} 重新开始结账。"
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "此验证会话已过期。请重新开始。"
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "这将信任所有外部链接,并跳过所有域名的警告。你现有的受信任域名将被替换。这样安全性较低。"
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "收到你的消息后,此窗口会自动更新。"
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "将 HDR 图像色调映射到标准范围,降低峰值亮度。"
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "尝试次数过多。请稍等片刻,然后重试。"
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "请使用你可以正常接收邮件的邮箱。我们会向该邮箱发送验证码。"
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "请使用与当前邮箱不同的地址。"
@@ -37318,17 +37313,17 @@ msgstr "验证你的身份"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "验证手机号"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "验证手机号"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "验证手机号表单"
@@ -38192,7 +38187,7 @@ msgstr "提高音量"
msgid "Wait a moment before deleting more messages."
msgstr "请稍后再删除其他消息。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "请稍候。收到你的消息后,此窗口将自动关闭。"
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "消息之间的等待时间。拥有“{bypassSlowmodePermissionLabel}”权限的成员可以绕过此限制。"
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "请稍候"
@@ -38368,13 +38363,13 @@ msgstr "无法读取此主题。它可能已损坏或无效。"
msgid "We couldn't remove that account. Try again."
msgstr "无法移除该账号。请重试。"
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "我们无法自动验证此号码。请联系支持团队,我们会安排专人审核你的账号。"
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "我们不向该国家发送验证短信。请尝试使用其他国家的手机号码,或联系支持团队。"
@@ -38469,9 +38464,9 @@ msgstr "修改密码前,我们会向你的邮箱发送验证码。"
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "查看备用码前,我们会向你的邮箱发送验证码。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "可用时,我们会发送短信验证码。你的号码不会关联到你的账号。我们仅保留一个加密标记,其中不含用户 ID,以便在大约 {PHONE_VERIFICATION_WINDOW_DAYS} 天内最多允许 {PHONE_VERIFICATION_LIMIT} 次验证。"
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "代码将在可用时通过短信发送。您的号码不会与您的账户关联。我们仅在有限时间内保留一个加密标记,不包含用户 ID。"
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "你的 {productName} 会话已过期。请重新登录以继续授权此
msgid "Your account"
msgstr "你的账号"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "你的账号会立即恢复正常,现在也不需要提供手机号。这不是永久豁免。加入大型或公开社区可能会再次触发此检查。"
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "您的账号会立即恢复正常,届时您将不再需要手机号。这不是永久豁免,我们之后仍可能要求进行此验证。"
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "你的银行卡符合条件。正在将你跳转到付款页面。"
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "你的运营商称此号码未开通。请检查后重试,如果号码无误,请联系支持团队。"
@@ -40216,10 +40211,10 @@ msgstr "你的新邮箱"
msgid "Your new nickname, or leave blank to reset it."
msgstr "你的新昵称,留空则重置。"
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "你的手机号不会关联到你的账号。我们只保留一个加密标记,不含用户 ID,用于在大约 {duration} 天内最多 {limit} 次验证。"
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "您的号码未关联到您的账号。我们仅在有限时间内保留一个加密标记,不包含用户 ID。"
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po b/fluxer_app/src/features/i18n/locales/zh-TW/messages.po
index 5e960498e..f3e054ac5 100644
--- a/fluxer_app/src/features/i18n/locales/zh-TW/messages.po
+++ b/fluxer_app/src/features/i18n/locales/zh-TW/messages.po
@@ -2396,7 +2396,7 @@ msgid "7 days"
msgstr "7 天"
#. Required-action error when the API requires a captcha for phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:581
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
msgid "A browser check is required before phone verification. Try again from the sign-in page or contact support."
msgstr "電話驗證前需要進行瀏覽器檢查。請從登入頁面重試,或聯絡客服。"
@@ -5240,8 +5240,8 @@ msgstr "目前離開中"
#: src/features/guild/components/modals/add_guild_modal/TemplateImportForm.tsx:396
#: src/features/moderation/components/report_modal/IARModal.tsx:86
#: src/features/moderation/components/report/ReportStepDetails.tsx:312
-#: src/features/user/components/modals/PhoneAddModal.tsx:420
-#: src/features/user/components/modals/PhoneAddModal.tsx:439
+#: src/features/user/components/modals/PhoneAddModal.tsx:417
+#: src/features/user/components/modals/PhoneAddModal.tsx:436
msgid "Back"
msgstr "返回"
@@ -6451,7 +6451,7 @@ msgstr "無法在這裡上傳檔案"
#: src/features/user/components/modals/PasswordChangeModal.tsx:226
#: src/features/user/components/modals/PasswordChangeModal.tsx:237
#: src/features/user/components/modals/PasswordChangeModal.tsx:255
-#: src/features/user/components/modals/PhoneAddModal.tsx:401
+#: src/features/user/components/modals/PhoneAddModal.tsx:398
#: src/features/user/components/modals/tabs/AuthorizedAppsTab.tsx:174
#: src/features/voice/components/EntranceSoundTrimmerModal.tsx:33
#: src/features/voice/components/modals/CameraPreviewModal.tsx:846
@@ -8294,7 +8294,7 @@ msgstr "煤炭主題"
#. Label for an inbound phone verification code shown in the required-action modal.
#: src/features/auth/components/modals/MfaTotpDisableModal.tsx:26
#: src/features/auth/components/modals/MfaTotpEnableModal.tsx:36
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
#: src/features/invite/components/InviteListItem.tsx:77
#: src/features/moderation/components/report/ReportBreadcrumbs.tsx:29
msgid "Code"
@@ -10299,7 +10299,7 @@ msgstr "倒數計時器"
#. Form field label for the country selector in the phone verification step.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:92
-#: src/features/user/components/modals/PhoneAddModal.tsx:59
+#: src/features/user/components/modals/PhoneAddModal.tsx:57
msgid "Country"
msgstr "國家/地區"
@@ -13350,7 +13350,7 @@ msgid "Email unavailable"
msgstr "無法取得電子郵件"
#. Required-action error shown when email update cannot continue.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
msgid "Email update is unavailable right now. Try again later or contact support."
msgstr "目前無法更新電子郵件。請稍後再試,或聯絡客服。"
@@ -13999,7 +13999,7 @@ msgstr "請輸入有效的 {theOtherPlatform} 範本網址或代碼。"
#. Inline validation error on the email step of the DSA report flow when the email is malformed.
#. Required-action form error for an invalid email address.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
#: src/features/moderation/components/pages/ReportPage.tsx:59
msgid "Enter a valid email address."
msgstr "請輸入有效的電子郵件地址。"
@@ -14010,14 +14010,14 @@ msgid "Enter a valid message link."
msgstr "請輸入有效的訊息連結。"
#. Required-action form error for an invalid phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:522
msgid "Enter a valid mobile phone number."
msgstr "請輸入有效的行動電話號碼。"
#. Form validation error shown when the entered phone number cannot be parsed.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:108
-#: src/features/user/components/modals/PhoneAddModal.tsx:47
+#: src/features/user/components/modals/PhoneAddModal.tsx:45
msgid "Enter a valid phone number"
msgstr "請輸入有效的電話號碼"
@@ -14101,7 +14101,7 @@ msgid "Enter the {digitCount}-digit code sent to {phoneNumber}."
msgstr "請輸入傳送至 {phoneNumber} 的 {digitCount} 位數驗證碼。"
#. placeholder {0}: getE164PhoneNumber(phoneNumber, selectedCountry) ?? formattedPhone
-#: src/features/user/components/modals/PhoneAddModal.tsx:376
+#: src/features/user/components/modals/PhoneAddModal.tsx:373
msgid "Enter the {MFA_CODE_DIGIT_COUNT}-digit code sent to {0}."
msgstr "請輸入傳送到 {0} 的 {MFA_CODE_DIGIT_COUNT} 位數驗證碼。"
@@ -16137,7 +16137,7 @@ msgstr "取得 {premiumProductName} 即可自訂您的標籤,或在變更使
#. Button in the required-action modal. Requests a new inbound SMS challenge code.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:202
-#: src/features/user/components/modals/PhoneAddModal.tsx:427
+#: src/features/user/components/modals/PhoneAddModal.tsx:424
msgid "Get new code"
msgstr "取得新驗證碼"
@@ -24039,7 +24039,7 @@ msgid "Open your browser, sign in, then enter the code below to link your accoun
msgstr "開啟您的瀏覽器,登入後輸入以下代碼,即可連結您的帳號。"
#. Required-action modal carousel step title for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
msgid "Open your messages"
msgstr "開啟您的訊息"
@@ -24047,12 +24047,12 @@ msgstr "開啟您的訊息"
msgid "Open your old {PRODUCT_NAME} app and choose Link a new device, then enter the code below."
msgstr "開啟您的舊版 {PRODUCT_NAME} 應用程式,選擇「連結新裝置」,然後輸入下方的代碼。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:327
+#: src/features/user/components/modals/PhoneAddModal.tsx:324
msgid "Open your phone's messaging app and create a new text message."
msgstr "開啟手機的訊息應用程式,然後建立新簡訊。"
#. Required-action modal body for the first inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:450
msgid "Open your phone's messaging app and start a new text message."
msgstr "開啟手機訊息應用程式,然後開始新的簡訊。"
@@ -24223,7 +24223,7 @@ msgid "OTP"
msgstr "OTP"
#. Required-action form error when our own phone lookup provider is unavailable and we fail closed. Must blame us, not the number, and must invite retrying the same number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:558
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:554
msgid "Our phone number check is down right now. This is on us, not your number. Wait a few minutes and try the same number again."
msgstr "我們的電話號碼驗證目前無法使用。這是我們的問題,不是您的號碼有問題。請稍等幾分鐘,再用同一個號碼試一次。"
@@ -24810,21 +24810,21 @@ msgstr "電話"
#. Form field label for the phone number input.
#. Short label in the phone add modal. Keep it concise.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:100
-#: src/features/user/components/modals/PhoneAddModal.tsx:67
+#: src/features/user/components/modals/PhoneAddModal.tsx:65
msgid "Phone number"
msgstr "電話號碼"
#. Form validation error shown when the phone number field is empty.
#. Label in the phone add modal.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:116
-#: src/features/user/components/modals/PhoneAddModal.tsx:43
+#: src/features/user/components/modals/PhoneAddModal.tsx:41
msgid "Phone number is required"
msgstr "請輸入電話號碼"
#. Toast shown after phone verification succeeds.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
-#: src/features/user/components/modals/PhoneAddModal.tsx:180
-#: src/features/user/components/modals/PhoneAddModal.tsx:185
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/user/components/modals/PhoneAddModal.tsx:178
+#: src/features/user/components/modals/PhoneAddModal.tsx:183
msgid "Phone number verified"
msgstr "電話號碼已驗證"
@@ -24839,7 +24839,7 @@ msgid "Phone step"
msgstr "電話步驟"
#. Required-action error when the account is not eligible to add phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
msgid "Phone verification is not available for this account. Use another method or contact support."
msgstr "此帳號無法使用電話驗證。請使用其他方式或聯絡客服。"
@@ -27319,7 +27319,7 @@ msgid "Reposts: <0>{countLabel}</0>"
msgstr "轉發:<0>{countLabel}</0>"
#. Required-action form error when the user submits before a code exists.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
msgid "Request a new code first."
msgstr "請先要求新驗證碼。"
@@ -28793,7 +28793,7 @@ msgid "Search communities"
msgstr "搜尋社群"
#. Button or menu action label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:63
+#: src/features/user/components/modals/PhoneAddModal.tsx:61
msgid "Search countries..."
msgstr "搜尋國家…"
@@ -29559,17 +29559,17 @@ msgstr "使用 /tts 傳送文字轉語音訊息。開啟文字轉語音的成員
#. placeholder {0}: inboundChallenge.challenge_code
#. placeholder {1}: inboundChallenge.our_number
-#: src/features/user/components/modals/PhoneAddModal.tsx:335
+#: src/features/user/components/modals/PhoneAddModal.tsx:332
msgid "Send the code <0>{0}</0> to <1>{1}</1>"
msgstr "將驗證碼 <0>{0}</0> 傳送至 <1>{1}</1>"
#. Required-action modal body for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:462
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
msgid "Send the code to the phone number below."
msgstr "將驗證碼傳送至以下電話號碼。"
#. Required-action modal carousel step title for the second inbound phone verification instruction.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:458
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:454
msgid "Send this code"
msgstr "傳送此驗證碼"
@@ -29579,7 +29579,7 @@ msgid "Send this pin back in time?"
msgstr "將此釘選訊息送回過去?"
#. Label for the destination phone number in an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:466
msgid "Send to"
msgstr "傳送至"
@@ -29606,16 +29606,11 @@ msgstr "傳送語音訊息"
msgid "Send:"
msgstr "傳送:"
-#. Required-action modal explanation for an inbound phone verification challenge due to SMS cost.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
-msgid "Sending an SMS to this number is expensive, so we need you to text us instead."
-msgstr "傳送簡訊到此號碼的費用較高,因此我們需要您改為傳送簡訊給我們。"
-
-#: src/features/user/components/modals/PhoneAddModal.tsx:304
+#: src/features/user/components/modals/PhoneAddModal.tsx:301
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also ask the administrators of this instance to lift this requirement from your account."
msgstr "由於傳送簡訊到此電話號碼的費用對 {PRODUCT_NAME} 來說太高了,因此我們需要您改為傳送簡訊給我們。我們知道這不太理想。您也可以請此實例的管理員免除您帳號的此項要求。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:310
+#: src/features/user/components/modals/PhoneAddModal.tsx:307
msgid "Sending an SMS to this phone number is too expensive for {PRODUCT_NAME}, so we need you to send us an SMS instead. We know this isn't ideal. You can also contact <0>{SUPPORT_EMAIL}</0> to have us lift this requirement from your account."
msgstr "由於傳送簡訊到此電話號碼的費用對 {PRODUCT_NAME} 來說太高了,因此我們需要您改為傳送簡訊給我們。我們知道這不太理想。您也可以聯絡 <0>{SUPPORT_EMAIL}</0>,要求我們免除您帳號的此項要求。"
@@ -31202,7 +31197,7 @@ msgid "Smoother video"
msgstr "畫面更流暢"
#. Required-action error when the SMS provider cannot send or verify a code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:538
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
msgid "SMS verification is unavailable right now. Try again later or contact support."
msgstr "目前無法進行簡訊驗證。請稍後再試或聯絡客服。"
@@ -31397,7 +31392,7 @@ msgstr "發生錯誤。請稍後再試。"
#. Inline error in the web deep-link prompt when opening the desktop app fails.
#. Toast error shown when the mature content check request fails unexpectedly.
#: src/features/auth/components/modals/MatureContentCheckModal.tsx:18
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:585
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:580
#: src/features/auth/flow/DesktopDeepLinkPrompt.tsx:31
msgid "Something went wrong. Try again."
msgstr "發生錯誤。請再試一次。"
@@ -31737,7 +31732,7 @@ msgid "Staff controls"
msgstr "員工控制項"
#. Required-action modal notice for inbound phone verification.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:482
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
msgid "Standard messaging rates from your carrier may apply."
msgstr "您的電信業者可能會收取標準訊息費率。"
@@ -33165,12 +33160,12 @@ msgid "Thank you for helping keep {productName} safe. We'll review your report a
msgstr "感謝您協助維護 {productName} 的安全。我們會盡快審核您的檢舉。"
#. Required-action form error for an invalid verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:486
msgid "That code didn't work. Check it and try again."
msgstr "驗證碼有誤。請檢查後再試一次。"
#. Required-action form error for an expired verification code.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:494
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:490
msgid "That code expired. Request a new code."
msgstr "驗證碼已過期。請取得新的驗證碼。"
@@ -33198,7 +33193,7 @@ msgid "That doesn't look like a valid URL."
msgstr "這看起來不是有效的網址。"
#. Required-action form error when a new email is already used by another account.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:510
msgid "That email is already in use."
msgstr "該電子郵件已被使用。"
@@ -34118,8 +34113,8 @@ msgstr "這是您最後一個通行金鑰,而通行金鑰是您的第二道驗
msgid "This is your last passkey. Once it's gone you won't be able to use a passkey as your second factor."
msgstr "這是您最後一個通行金鑰。刪除後,您將無法再以通行金鑰作為第二道驗證。"
-#. Required-action form error for landline, toll-free, premium, shared-cost, UAN, voicemail and pager lines. Do not name which line type the provider returned.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:570
+#. Required-action form error when the number is not a mobile line. Do not name the line type.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:566
msgid "This isn't a mobile number, so it can't receive our text. Try a mobile number, or contact support if you think that's wrong."
msgstr "這不是手機號碼,無法接收我們的簡訊。請嘗試輸入手機號碼,或若您認為有誤,請聯絡客服。"
@@ -34200,12 +34195,12 @@ msgid "This nickname will only be visible in this community"
msgstr "這個暱稱只會在此社群中顯示"
#. Required-action form error when a number must use the inbound text-in challenge and the current step cannot start one. Do not say why the number was routed there.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:552
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:548
msgid "This number is verified by texting us instead. Go back and start phone verification again to get the code and the number to text."
msgstr "這個號碼是透過傳送簡訊驗證的。請返回並重新開始電話驗證,以取得驗證碼和要傳送簡訊的號碼。"
#. Required-action modal explanation for an inbound phone verification challenge.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:446
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:442
msgid "This number needs text-in verification instead of an SMS from us."
msgstr "此號碼需要透過文字訊息驗證,而非我們傳送的簡訊。"
@@ -34230,12 +34225,12 @@ msgid "This participant was deafened by moderators"
msgstr "此參與者遭管理員設為耳機靜音"
#. Required-action form error when the backend rejects a phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:526
msgid "This phone number cannot be used. Try another mobile number or contact support."
msgstr "此電話號碼無法使用。請嘗試其他手機號碼或聯絡客服。"
#. Required-action form error when the backend rejects a reused phone number.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:534
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:530
msgid "This phone number has already been used. Try another number or contact support."
msgstr "此電話號碼已被使用。請嘗試其他號碼或聯絡客服。"
@@ -34387,7 +34382,7 @@ msgid "This verification session expired. Return to {productName} and start chec
msgstr "此驗證工作階段已過期。請返回 {productName} 並重新開始結帳。"
#. Required-action form error when an email-change ticket or proof is invalid or expired.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:498
msgid "This verification session expired. Start again."
msgstr "此驗證工作階段已過期。請重新開始。"
@@ -34485,7 +34480,7 @@ msgid "This will trust all external links and skip the warning for every domain.
msgstr "這會信任所有外部連結,並略過所有網域的警告。您現有的信任網域將會被取代。此設定較不安全。"
#. Required-action modal body after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:478
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
msgid "This window updates automatically after we receive your message."
msgstr "我們收到您的訊息後,此視窗會自動更新。"
@@ -34792,7 +34787,7 @@ msgid "Tone-map HDR images to standard range, reducing peak brightness."
msgstr "將 HDR 影像色調對應至標準範圍,降低峰值亮度。"
#. Required-action error shown for rate limits.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:506
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:502
msgid "Too many attempts. Wait a bit, then try again."
msgstr "嘗試次數過多。請稍候再試。"
@@ -36632,7 +36627,7 @@ msgid "Use an email address you can access. We will send a code there."
msgstr "請使用您能正常收信的電子郵件地址。我們會將驗證碼寄送到該地址。"
#. Required-action form error when the new email matches the current account email.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:518
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:514
msgid "Use an email that is different from your current one."
msgstr "請使用與您目前不同的電子郵件地址。"
@@ -37318,17 +37313,17 @@ msgstr "驗證是您本人操作"
#. Primary button in the required-action modal. Sends or submits phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:178
#: src/features/channel/components/barriers/BarrierComponents.tsx:269
-#: src/features/user/components/modals/PhoneAddModal.tsx:408
+#: src/features/user/components/modals/PhoneAddModal.tsx:405
msgid "Verify phone"
msgstr "驗證電話號碼"
#. Short label in the phone add modal. Keep it concise.
-#: src/features/user/components/modals/PhoneAddModal.tsx:55
+#: src/features/user/components/modals/PhoneAddModal.tsx:53
msgid "Verify phone number"
msgstr "驗證電話號碼"
#. Label in the phone add modal.
-#: src/features/user/components/modals/PhoneAddModal.tsx:51
+#: src/features/user/components/modals/PhoneAddModal.tsx:49
msgid "Verify phone number form"
msgstr "驗證電話號碼表單"
@@ -38192,7 +38187,7 @@ msgstr "提高音量"
msgid "Wait a moment before deleting more messages."
msgstr "請稍候再刪除其他訊息。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:352
+#: src/features/user/components/modals/PhoneAddModal.tsx:349
msgid "Wait a moment. This window will close automatically once we receive your message."
msgstr "請稍候,收到您的訊息後此視窗將自動關閉。"
@@ -38202,7 +38197,7 @@ msgid "Wait between messages. Members with \"{bypassSlowmodePermissionLabel}\" c
msgstr "訊息之間的間隔時間。擁有「{bypassSlowmodePermissionLabel}」權限的成員可以略過此限制。"
#. Required-action modal carousel step title after the user sends an inbound phone verification text.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:474
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:470
msgid "Wait here"
msgstr "請在此等候"
@@ -38368,13 +38363,13 @@ msgstr "我們無法讀取此主題。它可能已損壞或無效。"
msgid "We couldn't remove that account. Try again."
msgstr "我們無法移除該帳號。請再試一次。"
-#. Required-action form error for phone attempts blocked by a fraud signal. Deliberately non-specific. Never name the signal, the score or the threshold.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:576
+#. Required-action form error when a phone attempt cannot be verified automatically and needs a support review. Keep it non-specific.
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:571
msgid "We couldn't verify this number automatically. Contact support and a person will review your account."
msgstr "我們無法自動驗證此號碼。請聯絡客服,將由專人審核您的帳號。"
#. Required-action form error when the phone number's country is on the SMS send ban list. Must not imply the number itself is invalid.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:546
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:542
msgid "We don't send verification texts to this country. Try a mobile number from another country, or contact support."
msgstr "我們不向此國家/地區傳送驗證簡訊。請嘗試使用其他國家的手機號碼,或聯絡客服。"
@@ -38469,9 +38464,9 @@ msgstr "我們會傳送驗證碼到您的電子郵件,以便您變更密碼。
msgid "We'll send a verification code to your email before you can view your backup codes."
msgstr "我們會在您查看備用碼前,將驗證碼寄送到您的電子郵件。"
-#: src/features/user/components/modals/PhoneAddModal.tsx:286
-msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about {PHONE_VERIFICATION_WINDOW_DAYS} days."
-msgstr "我們會在簡訊驗證碼可用時傳送給您。您的電話號碼未連結到您的帳號。我們只會保留一個加密標記,不含使用者 ID,以允許在約 {PHONE_VERIFICATION_WINDOW_DAYS} 天內最多進行 {PHONE_VERIFICATION_LIMIT} 次驗證。"
+#: src/features/user/components/modals/PhoneAddModal.tsx:284
+msgid "We'll send an SMS code when available. Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "我們會在號碼可用時傳送 SMS 驗證碼。您的號碼不會連結到您的帳號。我們只會保留一個加密標記,不含使用者 ID,並在有限的時間內刪除。"
#: src/features/user/components/modals/EmailChangeModal.tsx:189
msgid "We'll verify your current email and then your new email with one-time codes."
@@ -39976,10 +39971,10 @@ msgstr "您的 {productName} 工作階段已過期。請重新登入以繼續授
msgid "Your account"
msgstr "您的帳號"
-#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because whether the check returns depends on account age and instance settings the user cannot see.
+#. First line of the set-aside confirmation in the required-action modal. Always shown. Says can rather than will, because the check may or may not come back.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:316
-msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption. Joining a large or public community can bring this check back."
-msgstr "您的帳號會立即恢復正常,而且現在不需要電話號碼。這並非永久豁免。加入大型或公開社群可能會再次觸發此檢查。"
+msgid "Your account goes back to normal right away and you will not need a phone number now. This is not a permanent exemption, and we can ask for this check again later."
+msgstr "您的帳號會立即恢復正常,且您暫時不需要電話號碼。這並非永久豁免,我們之後仍可能要求您再次進行驗證。"
#: src/features/connection/components/pages/ConnectionCallbackPage.tsx:29
msgid "Your account has been linked successfully. You can now close this tab and return to the app."
@@ -40044,7 +40039,7 @@ msgid "Your card is eligible. Redirecting you to the payment page now."
msgstr "您的卡片符合資格。正在將您重新導向至付款頁面。"
#. Required-action form error when the carrier lookup says the number does not exist. Leaves room for the lookup to be wrong.
-#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:564
+#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:560
msgid "Your carrier says this number isn't in service. Check it and try again, or contact support if it's correct."
msgstr "您的電信業者表示此號碼未啟用。請檢查號碼後再試一次,或若號碼正確,請聯絡客服。"
@@ -40216,10 +40211,10 @@ msgstr "您的新電子郵件"
msgid "Your new nickname, or leave blank to reset it."
msgstr "您的新暱稱,留空則重設。"
-#. Required-action modal privacy note for phone verification. limit and duration are inserted by code.
+#. Required-action modal privacy note for phone verification.
#: src/features/auth/components/modals/required_action/RequiredActionDescriptors.ts:421
-msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for at most {limit} verifications in about {duration} days."
-msgstr "您的號碼不會連結到您的帳號。我們只保留加密標記,不含使用者 ID,僅限約 {duration} 天內最多 {limit} 次驗證。"
+msgid "Your number is not linked to your account. We keep only an encrypted marker, with no user ID, for a limited time."
+msgstr "您的號碼未連結至您的帳戶。我們僅會暫時保留一個加密標記,不含使用者 ID。"
#: src/features/premium/components/pages/PremiumCallbackPage.tsx:152
msgid "Your payment was canceled. You can now close this tab and return to the app."
diff --git a/fluxer_app/src/features/user/commands/UserCommands.ts b/fluxer_app/src/features/user/commands/UserCommands.ts
index 010aa6bbb..99b022516 100644
--- a/fluxer_app/src/features/user/commands/UserCommands.ts
+++ b/fluxer_app/src/features/user/commands/UserCommands.ts
@@ -52,17 +52,8 @@ export interface InboundPhoneChallengeResponse {
expires_at: string;
}
-export type PhoneInboundChallengeReason =
- | 'voip'
- | 'canadian'
- | 'unknown_line_type'
- | 'expensive_destination'
- | 'account_forced'
- | 'behavioural_risk';
-
export interface PhoneSendVerificationInboundChallengeResponse extends InboundPhoneChallengeResponse {
channel: 'inbound_challenge';
- reason: PhoneInboundChallengeReason;
}
export type PhoneVerificationSendChannel = 'sms' | 'inbound_challenge';
diff --git a/fluxer_app/src/features/user/components/modals/PhoneAddModal.tsx b/fluxer_app/src/features/user/components/modals/PhoneAddModal.tsx
index 366091f8e..10e6d9dbc 100644
--- a/fluxer_app/src/features/user/components/modals/PhoneAddModal.tsx
+++ b/fluxer_app/src/features/user/components/modals/PhoneAddModal.tsx
@@ -4,8 +4,6 @@ import * as Modal from '@app/features/app/components/dialogs/Modal';
import {ExternalLink} from '@app/features/app/components/shared/ExternalLink';
import {
MFA_CODE_DIGIT_COUNT,
- PHONE_VERIFICATION_LIMIT,
- PHONE_VERIFICATION_WINDOW_DAYS,
PRODUCT_NAME,
SUPPORT_EMAIL,
SUPPORT_EMAIL_MAILTO,
@@ -285,8 +283,7 @@ export const PhoneAddModal = observer(() => {
<p className={styles.footerText} data-flx="user.phone-add-modal.footer-text">
<Trans>
We'll send an SMS code when available. Your number is not linked to your account. We keep only an
- encrypted marker, with no user ID, to allow at most {PHONE_VERIFICATION_LIMIT} verifications in about{' '}
- {PHONE_VERIFICATION_WINDOW_DAYS} days.
+ encrypted marker, with no user ID, for a limited time.
</Trans>
</p>
}
diff --git a/fluxer_common/src/config.rs b/fluxer_common/src/config.rs
index 74fe343df..441115f87 100644
--- a/fluxer_common/src/config.rs
+++ b/fluxer_common/src/config.rs
@@ -9,10 +9,8 @@ pub enum GeoipSourceConfig {
},
S3 {
maxmind_db_path: String,
- maxmind_asn_db_path: Option<String>,
s3_bucket: String,
s3_key: String,
- s3_asn_key: Option<String>,
},
}
@@ -82,33 +80,10 @@ fn parse_geoip_s3_source_config(raw_value: &str, service_name: &str) -> GeoipSou
}
let maxmind_db_path =
geoip_runtime_path(&resolve_geoip_download_path(&url, raw_value), service_name);
- let s3_asn_key = url
- .query_pairs()
- .find(|(key, _)| key == "asn_key")
- .map(|(_, value)| value.into_owned());
- let maxmind_asn_db_path = s3_asn_key.as_ref().map(|asn_key| {
- let configured_path = url
- .query_pairs()
- .find(|(key, _)| key == "asn_download_path")
- .map(|(_, value)| require_absolute_path(value.as_ref(), "asn_download_path", raw_value))
- .unwrap_or_else(|| {
- let directory = Path::new(&maxmind_db_path)
- .parent()
- .map(Path::to_path_buf)
- .unwrap_or_default();
- directory
- .join(Path::new(asn_key).file_name().unwrap_or_default())
- .to_string_lossy()
- .into_owned()
- });
- geoip_runtime_path(&configured_path, service_name)
- });
GeoipSourceConfig::S3 {
maxmind_db_path,
- maxmind_asn_db_path,
s3_bucket,
s3_key,
- s3_asn_key,
}
}
@@ -357,19 +332,15 @@ mod tests {
#[test]
fn parses_s3_geoip_source() {
let source = parse_geoip_source_config(
- "s3://geoip/GeoLite2-City.mmdb?download_path=/tmp/city.mmdb&asn_key=GeoLite2-ASN.mmdb",
+ "s3://geoip/GeoLite2-City.mmdb?download_path=/tmp/city.mmdb",
"test_svc",
);
assert_eq!(
source,
GeoipSourceConfig::S3 {
maxmind_db_path: "/tmp/fluxer/geoip/test_svc/city.mmdb".to_owned(),
- maxmind_asn_db_path: Some(
- "/tmp/fluxer/geoip/test_svc/GeoLite2-ASN.mmdb".to_owned()
- ),
s3_bucket: "geoip".to_owned(),
s3_key: "GeoLite2-City.mmdb".to_owned(),
- s3_asn_key: Some("GeoLite2-ASN.mmdb".to_owned()),
}
);
}
diff --git a/fluxer_common/src/geoip.rs b/fluxer_common/src/geoip.rs
index 5aa30ae30..a95d79970 100644
--- a/fluxer_common/src/geoip.rs
+++ b/fluxer_common/src/geoip.rs
@@ -181,19 +181,14 @@ fn prepare_geoip_database(
GeoipSourceConfig::Filesystem { maxmind_db_path } => Ok(maxmind_db_path.clone()),
GeoipSourceConfig::S3 {
maxmind_db_path,
- maxmind_asn_db_path,
s3_bucket,
s3_key,
- s3_asn_key,
} => {
let s3 = s3_config.ok_or_else(|| {
anyhow::anyhow!("GeoIP is configured for S3 mode, but S3 configuration is missing")
})?;
require_s3_config(s3)?;
download_s3_object(s3, s3_bucket, s3_key, Path::new(maxmind_db_path))?;
- if let (Some(asn_key), Some(asn_path)) = (s3_asn_key, maxmind_asn_db_path) {
- download_s3_object(s3, s3_bucket, asn_key, Path::new(asn_path))?;
- }
tracing::info!(
maxmind_db_path,
s3_bucket,
diff --git a/fluxer_docs/scripts/VerifyDocsCoverage.ts b/fluxer_docs/scripts/VerifyDocsCoverage.ts
index eefda12cd..4cf921c91 100644
--- a/fluxer_docs/scripts/VerifyDocsCoverage.ts
+++ b/fluxer_docs/scripts/VerifyDocsCoverage.ts
@@ -126,7 +126,7 @@ const OUT_OF_BAND_CREDENTIAL = new Map<string, OutOfBandRoute>([
'POST /webhooks/twilio/sms',
{
reason:
- 'installed only when config.sms.enabled, and then only when the inbound webhook token and public URL are both set, so a default or self-hosted instance never registers it',
+ 'a provider callback that is forwarded untouched to the internal event bus and answers 500 while that bus is unavailable',
documentedIn: null,
},
],
@@ -208,7 +208,7 @@ const EXEMPTION_RULES: ReadonlyArray<ExemptionRule> = [
name: 'out-of-band credential',
justification:
'no ordinary client holds the credential. Each entry states its guard, and three are covered in prose',
- anchors: [{file: 'fluxer_api/src/api/app/ControllerRegistry.ts', anchor: 'if (config.sms.enabled) {'}],
+ anchors: [{file: 'fluxer_api/src/api/app/ControllerRegistry.ts', anchor: 'installSmsWebhookForwarder(routes'}],
covers: (shape) => OUT_OF_BAND_CREDENTIAL.has(shape),
},
];
@@ -1699,7 +1699,7 @@ console.log('unthrottled routes and global bucket claims');
failures += section('rate limit prose disagreements', problems);
}
-console.log('error registry and abuse signal weights');
+console.log('error registry');
{
const errorsPage = await readFile(path.join(DOCS_ROOT, 'http-api/errors.md'), 'utf8');
const documentedCodes = new Set<string>();
@@ -1732,20 +1732,6 @@ console.log('error registry and abuse signal weights');
}
}
- const banner = await readFile(path.join(REPO_ROOT, 'fluxer_api/src/api/middleware/AbusiveIpAutoBanner.ts'), 'utf8');
- const weights = new Map<string, string>();
- for (const rule of banner.matchAll(/if \(status === (\d{3})\) return ([\d.]+);/gu)) {
- weights.set(rule[1], rule[2]);
- }
- for (const [status, weight] of weights) {
- if (status === '404') {
- continue;
- }
- if (!errorsPage.includes(`A ${status} weighs ${weight}`) && !errorsPage.includes(`a ${status} weighs ${weight}`)) {
- problems.push(`errors.md does not state that a ${status} weighs ${weight}`);
- }
- }
-
const documentedRegistryCodes = [...registryCodes].filter((c) => documentedCodes.has(c)).length;
const UNDOCUMENTED_VALIDATION_CODES = new Set(['EMAIL_DOMAIN_CANNOT_RECEIVE_MAIL']);
const expectedEntries = registryCodes.size + validationCodes.size - UNDOCUMENTED_VALIDATION_CODES.size;
@@ -1765,7 +1751,6 @@ console.log('error registry and abuse signal weights');
);
}
console.log(` registry codes: ${registryCodes.size.toString()}, documented: ${documentedRegistryCodes.toString()}`);
- console.log(` abuse signal weights compared: ${weights.size.toString()}`);
failures += section('error registry disagreements', problems);
}
diff --git a/fluxer_docs/scripts/VerifyDocsStyle.ts b/fluxer_docs/scripts/VerifyDocsStyle.ts
index b9f4e7276..438823b4c 100644
--- a/fluxer_docs/scripts/VerifyDocsStyle.ts
+++ b/fluxer_docs/scripts/VerifyDocsStyle.ts
@@ -270,11 +270,11 @@ const ACCEPTED_TABLE_FINDINGS = new Map<string, Readonly<Partial<Record<TableRul
['admin-api/bulk-jobs.mdx', {'table-fit': 1}],
['admin-api/discovery.mdx', {'table-identifier': 1}],
['admin-api/guilds.mdx', {'table-identifier': 3}],
- ['admin-api/index.mdx', {'table-fit': 1, 'table-identifier': 3}],
+ ['admin-api/index.mdx', {'table-identifier': 3}],
['admin-api/instance.mdx', {'table-identifier': 8}],
['admin-api/messages.mdx', {'table-identifier': 1}],
['admin-api/reports.mdx', {'table-fit': 1, 'table-identifier': 2}],
- ['admin-api/users.mdx', {'table-fit': 1, 'table-identifier': 1}],
+ ['admin-api/users.mdx', {'table-fit': 1, 'table-identifier': 3}],
['admin-api/voice.mdx', {'table-identifier': 3}],
['gateway/event-filtering.md', {'table-cell': 2}],
['gateway/events.md', {'table-identifier': 1}],
diff --git a/fluxer_docs/src/content/docs/admin-api/blocklists.mdx b/fluxer_docs/src/content/docs/admin-api/blocklists.mdx
index 57cbd8adf..6899808e4 100644
--- a/fluxer_docs/src/content/docs/admin-api/blocklists.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/blocklists.mdx
@@ -6,49 +6,42 @@ description: The safety blocklists, their value forms, and the operations that m
import RouteHeader from '@/components/RouteHeader.astro';
-Fluxer has nine blocklists for account access and user content. Each defines its accepted values, matching rules and metadata. Fluxer normalises a value when it adds the value and again when it checks the value.
+Fluxer has eight blocklists for account access and user content. Each defines its accepted values, matching rules and metadata. Fluxer normalises a value when it adds the value and again when it checks the value.
-Each list has its own [Admin ACLs](/admin-api/#acl-registry). A read needs the selected list's `check` permission, an addition or an update needs its `add` permission, and a removal needs its `remove` permission. An account holding `ban:ip:add` writes to the `ip` list and to no other. Every operation records the audit reason on the [Admin audit entries](/admin-api/#admin-audit-entry-object) it produces, and each read produces one entry. An entry about one list has a target type built from the list name with each hyphen written as an underscore, so `url-domain` entries use `url_domain`. `email-domain-suspicious` is the one exception and uses `email_domain`.
+Each list has its own [Admin ACLs](/admin-api/#acl-registry). A read needs the selected list's `check` permission, an addition or an update needs its `add` permission, and a removal needs its `remove` permission. An account holding `ban:ip:add` writes to the `ip` list and to no other. Every operation records the audit reason on the [Admin audit entries](/admin-api/#admin-audit-entry-object) it produces, and each read produces one entry. An entry about one list has a target type built from the list name with each hyphen written as an underscore, so `url-domain` entries use `url_domain`.
-Fluxer builds each permission name from `ban:`, the list name with each hyphen written as an underscore, and the verb, so the `url-domain` list uses `ban:url_domain:check`, `ban:url_domain:add`, and `ban:url_domain:remove`. The `email-domain-suspicious` list is the one exception and uses `suspicious_email_domain:check`, `suspicious_email_domain:add`, and `suspicious_email_domain:remove`.
-
-:::note[The Admin API exposes no other blocklist]
-Fluxer synchronises disposable email domains from external feeds every six hours when `FLUXER_BLOCKLIST_FEEDS_ENABLED` is on. No operation on this page reads or writes them.
-:::
+Fluxer builds each permission name from `ban:`, the list name with each hyphen written as an underscore, and the verb, so the `url-domain` list uses `ban:url_domain:check`, `ban:url_domain:add`, and `ban:url_domain:remove`.
## Blocklist types
-`ip`, `email`, and `email-domain-suspicious` gate account access and registration. `phrase`, `url`, `url-domain`, `file-sha`, `avatar-hash`, and `profile-substring` gate what an account may post, link, upload, or display. `email` and `email-domain-suspicious` store nothing but the value. An `ip` row also stores a ban kind, a reason, an expiry, and its creation time.
+`ip` and `email` gate account access and registration. `phrase`, `url`, `url-domain`, `file-sha`, `avatar-hash`, and `profile-substring` gate what an account may post, link, upload, or display. `email` stores nothing but the value. An `ip` row also stores a ban kind, a reason, an expiry, and its creation time.
| Value | Description |
| --- | --- |
| ip<sup>1</sup> | IPv4 addresses, IPv6 addresses, and CIDR ranges denied service |
| email<sup>2</sup> | Exact email addresses blocked from registration and from being set on an account |
-| email-domain-suspicious<sup>2</sup> <sup>3</sup> | Email domains that allow registration and require the new account to verify a phone number first |
-| phrase<sup>4</sup> | Phrases blocked from content |
-| url<sup>5</sup> | Absolute `http` and `https` URLs blocked from being posted |
-| url-domain<sup>6</sup> | Domains blocked from being linked |
-| file-sha<sup>7</sup> | SHA-256 hashes blocked from being uploaded |
-| avatar-hash<sup>8</sup> | Avatar hashes blocked from being set |
-| profile-substring<sup>4</sup> <sup>9</sup> | Substrings blocked from one named profile field |
+| phrase<sup>3</sup> | Phrases blocked from content |
+| url<sup>4</sup> | Absolute `http` and `https` URLs blocked from being posted |
+| url-domain<sup>5</sup> | Domains blocked from being linked |
+| file-sha<sup>6</sup> | SHA-256 hashes blocked from being uploaded |
+| avatar-hash<sup>7</sup> | Avatar hashes blocked from being set |
+| profile-substring<sup>3</sup> <sup>8</sup> | Substrings blocked from one named profile field |
<sup>1</sup> Fluxer refuses an address with 400 `IP_BAN_DECLINED` when it is on the instance exemption list, or when IP lookup data shows that a single address is on a mobile carrier network, and records both refusals in the Admin audit log
<sup>2</sup> Stored lowercased, so a mixed-case value does not create a second row
-<sup>3</sup> Fluxer never shows the list to the account holder, who sees only the verified-phone gate. A domain must match `^[a-zA-Z0-9][a-zA-Z0-9\-.]*\.[a-zA-Z]{2,}$`
+<sup>3</sup> Canonicalised by NFKC normalisation, removal of control, format and variation-selector characters, lowercasing, and trimming. When Fluxer matches a value, it also normalises inserted whitespace, punctuation, and compatibility characters
-<sup>4</sup> Canonicalised by NFKC normalisation, removal of control, format and variation-selector characters, lowercasing, and trimming. When Fluxer matches a value, it also normalises inserted whitespace, punctuation, and compatibility characters
+<sup>4</sup> Canonicalised before storage. A value Fluxer cannot canonicalise returns 400 `INVALID_FORM_BODY` naming `url`
-<sup>5</sup> Canonicalised before storage. A value Fluxer cannot canonicalise returns 400 `INVALID_FORM_BODY` naming `url`
+<sup>5</sup> Stored lowercased and matched against the lowercased hostname of a submitted URL. `match_subdomains` is stored on the row and defaults to true, and the hostname match is exact whatever its value
-<sup>6</sup> Stored lowercased and matched against the lowercased hostname of a submitted URL. `match_subdomains` is stored on the row and defaults to true, and the hostname match is exact whatever its value
+<sup>6</sup> Stored as lowercase hexadecimal
-<sup>7</sup> Stored as lowercase hexadecimal
+<sup>7</sup> Stored as the 8-character hash with any `a_` animation prefix stripped and the rest lowercased, so the animated and static forms of one avatar are the same row
-<sup>8</sup> Stored as the 8-character hash with any `a_` animation prefix stripped and the rest lowercased, so the animated and static forms of one avatar are the same row
-
-<sup>9</sup> The only scoped list. Scope and substring together identify a row, so the same substring can be stored once per [scope](#profile-substring-scopes)
+<sup>8</sup> The only scoped list. Scope and substring together identify a row, so the same substring can be stored once per [scope](#profile-substring-scopes)
The fields and the operations a list accepts differ from list to list. Read the `fields` array and the `supports_` flags of a [blocklist object](#blocklist-object) before writing to a list.
@@ -109,9 +102,9 @@ One entry of the blocklist catalogue returned by [List blocklists](#list-blockli
| supports_bulk_delete<sup>5</sup> | boolean | Whether [Bulk remove blocklist entries](#bulk-remove-blocklist-entries) is accepted |
| supports_update<sup>6</sup> | boolean | Whether [Update blocklist entry](#update-blocklist-entry) is accepted |
-<sup>1</sup> `ip` names `ip`, `email` names `email`, `email-domain-suspicious` and `url-domain` name `domain`, `phrase` names `phrase`, `url` names `url`, `file-sha` names `sha256_hex`, `avatar-hash` names `hashes`, and `profile-substring` names `substrings`
+<sup>1</sup> `ip` names `ip`, `email` names `email`, `url-domain` names `domain`, `phrase` names `phrase`, `url` names `url`, `file-sha` names `sha256_hex`, `avatar-hash` names `hashes`, and `profile-substring` names `substrings`
-<sup>2</sup> Empty for `ip`, `email`, `email-domain-suspicious`, and `phrase`. `url` names `category`, `severity`, `source_url`, and `notes`. `url-domain` adds `match_subdomains`, `file-sha` adds `content_type`, and `avatar-hash` adds `reason`. `profile-substring` names `scope`, `reason`, and `notes`
+<sup>2</sup> Empty for `ip`, `email`, and `phrase`. `url` names `category`, `severity`, `source_url`, and `notes`. `url-domain` adds `match_subdomains`, `file-sha` adds `content_type`, and `avatar-hash` adds `reason`. `profile-substring` names `scope`, `reason`, and `notes`
<sup>3</sup> True only for `profile-substring`
@@ -172,7 +165,7 @@ One stored row of one blocklist. Every field is present on every entry, and a fi
<sup>7</sup> Non-null only on `ip`. An address added through [Add blocklist entry](#add-blocklist-entry) is written as a permanent ban, so it reads back with the reason `platform_admin_enforcement` and a null `expires_at`
-<sup>8</sup> Both null on `email`, `email-domain-suspicious`, and `phrase`, which store nothing but the value. `created_by_user_id` is also null on `ip`
+<sup>8</sup> Both null on `email` and `phrase`, which store nothing but the value. `created_by_user_id` is also null on `ip`
:::note[The audit entry records the accepted reason]
An `avatar-hash` or `profile-substring` write accepts `reason`, and both lists then report `reason` as null in this object.
@@ -224,7 +217,6 @@ The body of [Add blocklist entry](#add-blocklist-entry) has one shape per blockl
| --- | --- | --- |
| ip | ip | IPv4 address, IPv6 address, or CIDR range of 1 through 45 characters |
| email | email | Email address of 1 through 254 characters |
-| email-domain-suspicious | domain | Domain of 1 through 253 characters matching `^[a-zA-Z0-9][a-zA-Z0-9\-.]*\.[a-zA-Z]{2,}$` |
| phrase | phrase | Phrase of 1 through 500 characters |
| url | url | Absolute `http` or `https` URL of 1 through 2048 characters |
| url-domain | domain | Domain of 1 through 253 characters |
@@ -375,13 +367,13 @@ Every write is an upsert on the canonical value. An omitted optional field is wr
A body field the selected blocklist does not accept is stripped and never produces that 400. A `url` Fluxer cannot canonicalise returns 400 `INVALID_FORM_BODY` naming `url` in the `errors` array.
-Fluxer refuses to add an `ip` with 400 `IP_BAN_DECLINED` when the address is on the instance exemption list, and when a single address is classified as a high blast-radius mobile or carrier network. Fluxer runs that carrier network check only for a single address, so the check never refuses a CIDR range. When the IP lookup for the check fails, Fluxer treats the address as low risk and writes it.
+Fluxer refuses to add an `ip` with 400 `IP_BAN_DECLINED` when the address is on the instance exemption list, and when a single address is classified as a high blast-radius mobile or carrier network. Fluxer runs that carrier network check only for a single address, so the check never refuses a CIDR range. When the IP lookup for the check fails, Fluxer writes the address.
The response has no body, so it does not report the canonical form that was stored. Read it back with [List blocklist entries](#list-blocklist-entries).
### Side effects
-Fluxer checks later requests against the written rows. For every list except `email` and `email-domain-suspicious`, other nodes see the rows after a short propagation delay. No Gateway Dispatch is emitted.
+Fluxer checks later requests against the written rows. For every list except `email`, other nodes see the rows after a short propagation delay. No Gateway Dispatch is emitted.
Fluxer records one [Admin audit entry](/admin-api/#admin-audit-entry-object) per written value, with that value in its metadata. It records an entry for a refused `ip` too, under the action `ban_ip_skipped_exempt` or `ban_ip_skipped_cgnat`, before it returns the 400.
@@ -518,9 +510,8 @@ Reports whether one value is currently blocked by the selected blocklist and ret
| --- | --- |
| ip<sup>3</sup> <sup>4</sup> | The address itself, any stored CIDR range containing it, and any stored address the instance treats as the same origin |
| email | Exact match on the lowercased address |
-| email-domain-suspicious<sup>5</sup> | Exact match on the lowercased domain |
| phrase | Normalised phrase matching, so a disguised form of a stored phrase still reads as blocked |
-| url<sup>6</sup> | Exact match on the canonicalised URL |
+| url<sup>5</sup> | Exact match on the canonicalised URL |
| url-domain | Exact match on the lowercased hostname |
| file-sha | Exact match on the lowercased hexadecimal digest |
| avatar-hash | Exact match after the `a_` prefix is stripped and the hash is lowercased |
@@ -530,9 +521,7 @@ Reports whether one value is currently blocked by the selected blocklist and ret
<sup>4</sup> Two addresses are the same origin when they share a decision key, which is the exact address for IPv4 and the `/64` prefix for IPv6
-<sup>5</sup> A domain that the instance account policy marks as exempt from reputation checks reads as not blocked even while a row exists
-
-<sup>6</sup> This check does not read the `url-domain` list, so a URL that a stored domain blocks reads as not blocked. Check the hostname separately
+<sup>5</sup> This check does not read the `url-domain` list, so a URL that a stored domain blocks reads as not blocked. Check the hostname separately
### Response
@@ -543,7 +532,7 @@ Reports whether one value is currently blocked by the selected blocklist and ret
A value with no row and no covering match returns 200 with `banned` false, so this operation never reports whether a specific row exists. Use [List blocklist entries](#list-blocklist-entries) for that.
-For every list except `email` and `email-domain-suspicious`, a row written on another node becomes visible here after a short propagation delay.
+For every list except `email`, a row written on another node becomes visible here after a short propagation delay.
### Side effects
@@ -658,7 +647,7 @@ Removal is idempotent. A value with no stored row returns 204 and still records
### Side effects
-The removed row stops affecting subsequent blocklist decisions. For every list except `email` and `email-domain-suspicious`, other nodes stop applying it after a short propagation delay. A value can remain blocked by another matching row, such as a single address covered by a stored CIDR range. No Gateway Dispatch is emitted.
+The removed row stops affecting subsequent blocklist decisions. For every list except `email`, other nodes stop applying it after a short propagation delay. A value can remain blocked by another matching row, such as a single address covered by a stored CIDR range. No Gateway Dispatch is emitted.
The removal records one [Admin audit entry](/admin-api/#admin-audit-entry-object), with the canonical value in its metadata.
diff --git a/fluxer_docs/src/content/docs/admin-api/bulk-jobs.mdx b/fluxer_docs/src/content/docs/admin-api/bulk-jobs.mdx
index 91efb6a4b..e190dd094 100644
--- a/fluxer_docs/src/content/docs/admin-api/bulk-jobs.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/bulk-jobs.mdx
@@ -154,11 +154,11 @@ Every task writes one summary Admin audit entry when it finishes, with the actio
`update_user_flags` writes one `update_flags` entry for each account and dispatches [User Update](/gateway/events/#user-update) to the account's sessions. A change to a publicly visible flag also dispatches [Guild Member Update](/gateway/events/#guild-member-update) to every guild the account is in.
-`update_suspicious_activity_flags` rewrites each account's verification requirements and dispatches [User Update](/gateway/events/#user-update). No [Guild Member Update](/gateway/events/#guild-member-update) follows. The task writes one `update_suspicious_activity_flags` entry for each account, with the audit reason, and records a risk outcome when the requirements become non-empty. An unknown flag name fails the job before any account is changed.
+`update_suspicious_activity_flags` rewrites each account's verification requirements and dispatches [User Update](/gateway/events/#user-update). No [Guild Member Update](/gateway/events/#guild-member-update) follows. The task writes one `update_suspicious_activity_flags` entry for each account, with the audit reason. An unknown flag name fails the job before any account is changed.
`update_guild_features` writes one `update_features` entry for each guild, dispatches [Guild Update](/gateway/events/#guild-update), and reindexes the guild for search. Fluxer reconciles a guild that already has a discovery application record against the new feature set, so gaining `DISCOVERABLE` approves the record and losing it marks the record removed. A guild with no discovery record is left alone.
-`add_guild_members` bypasses the ban check and the deferred phone verification check that a normal join runs for an account without a verified phone. The task suppresses the join system message, records the join source as an Admin force add, and dispatches [Guild Member Add](/gateway/events/#guild-member-add) to the guild and [Guild Create](/gateway/events/#guild-create) to the added account's sessions. The task still enforces the per-account guild cap and the guild member cap, so an account at either ceiling is counted as failed. An account that is already a member is left unchanged and counted as successful, with no second membership and no Dispatch. Adding a bot account also records a `BOT_ADD` guild audit log entry attributed to the acting Admin.
+`add_guild_members` bypasses the ban check that a normal join runs. The task suppresses the join system message, records the join source as an Admin force add, and dispatches [Guild Member Add](/gateway/events/#guild-member-add) to the guild and [Guild Create](/gateway/events/#guild-create) to the added account's sessions. The task still enforces the per-account guild cap and the guild member cap, so an account at either ceiling is counted as failed. An account that is already a member is left unchanged and counted as successful, with no second membership and no Dispatch. Adding a bot account also records a `BOT_ADD` guild audit log entry attributed to the acting Admin.
`delete_user_messages` deletes every message each account wrote, across every channel. It writes one `delete_all_user_messages` entry for each account, with the audit reason, the account, and the deleted message count, and reports progress after every account.
diff --git a/fluxer_docs/src/content/docs/admin-api/guilds.mdx b/fluxer_docs/src/content/docs/admin-api/guilds.mdx
index 925f4d6f0..2690383ed 100644
--- a/fluxer_docs/src/content/docs/admin-api/guilds.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/guilds.mdx
@@ -527,7 +527,7 @@ Fluxer checks only the Admin ACL. The acting account needs no membership and no
### Side effects
-Fluxer creates the membership with the Admin force-add join source and restores a communication timeout still in force from a previous membership. The guild ban list is not checked, so a banned user can be admitted. The [deferred phone gate](/admin-api/instance/#deferred-phone-gate-object) does not run. The per-user guild limit and the guild member limit are still enforced.
+Fluxer creates the membership with the Admin force-add join source and restores a communication timeout still in force from a previous membership. The guild ban list is not checked, so a banned user can be admitted. The per-user guild limit and the guild member limit are still enforced.
[Guild Member Add](/gateway/events/#guild-member-add) fires to the guild, and the user's sessions are joined to the guild on the main Gateway. When the guild's members are already indexed for search, Fluxer adds the new member to guild member search. The ordinary join system message is created, and with it a [Message Create](/gateway/events/#message-create) Dispatch, unless the guild sets `SUPPRESS_JOIN_NOTIFICATIONS` or has no `system_channel_id`, or its `system_channel_id` names a channel that no longer exists. A bot target also records a `BOT_ADD` entry in the guild's own [audit log](/http-api/guild-audit-logs/#audit-actions).
diff --git a/fluxer_docs/src/content/docs/admin-api/index.mdx b/fluxer_docs/src/content/docs/admin-api/index.mdx
index 52f397c03..9201c256a 100644
--- a/fluxer_docs/src/content/docs/admin-api/index.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/index.mdx
@@ -228,9 +228,8 @@ An entry has no request method, request path, status, duration, IP address, or f
| system<sup>2</sup> | API process that served the request |
| voice_region<sup>2</sup> | Voice region |
| voice_server<sup>2</sup> | Voice server registration |
-| ip<sup>2</sup> | IP blocklist entry or suspicious IP marker |
+| ip<sup>2</sup> | IP blocklist entry |
| email<sup>2</sup> | Exact email blocklist entry |
-| email_domain<sup>2</sup> | Suspicious email domain entry |
| phrase<sup>2</sup> | Phrase blocklist entry |
| url<sup>2</sup> | Exact URL blocklist entry |
| url_domain<sup>2</sup> | URL domain blocklist entry |
@@ -312,7 +311,6 @@ An entry with any other action has `access` set to `write`.
| Value | Description |
| --- | --- |
| NCMEC Report | An attachment was submitted through the NCMEC reporting integration |
-| add_suspicious_email_domain | A domain was added to the suspicious email domain list |
| approve_discovery_application | A discovery application was approved |
| approve_registration | A pending registration was approved |
| auto_resolve_reports_on_deletion | Reports against an account were resolved automatically as part of its deletion |
@@ -357,11 +355,6 @@ An entry with any other action has `access` set to `write`.
| force_add_to_guild | An account was added to a guild while bypassing the ban check |
| generate_gift_codes | Gift codes were generated |
| kick_member | A member was removed from a guild |
-| mark_suspicious_ip | An IP address was marked as suspicious |
-| mark_suspicious_ip_skipped_high_blast_radius | IP intelligence reports the address as a mobile, anycast, satellite, or education network, so no marker was written |
-| mark_suspicious_ip_skipped_invalid | The address could not be parsed, so no marker was written |
-| mark_suspicious_ip_skipped_ipinfo_unavailable | IP intelligence was unavailable, so no marker was written |
-| mark_suspicious_ip_skipped_trusted_commercial_privacy_provider | The address belongs to a trusted commercial privacy provider, so no marker was written |
| purge_asset | A stored media asset was purged |
| purge_guild_emoji_asset | A guild emoji asset was purged |
| purge_guild_sticker_asset | A guild sticker asset was purged |
@@ -375,7 +368,6 @@ An entry with any other action has `access` set to `write`.
| remove_discovery_listing | A guild was removed from discovery |
| remove_relationship | One relationship was removed from an account |
| remove_relationships_by_category | Every relationship in one category was removed from an account |
-| remove_suspicious_email_domain | A domain was removed from the suspicious email domain list |
| resend_verification_email | An email verification message was requested again for an account |
| resolve_report | A report was updated or resolved |
| revoke_admin_api_key | An Admin API key was revoked |
@@ -530,9 +522,6 @@ The registry is returned in this order by [List ACLs](#list-acls). A value outsi
| ban:email:add | Adds and updates `email` [blocklist](/admin-api/blocklists/) entries |
| ban:email:check | Reads the `email` blocklist |
| ban:email:remove | Removes `email` blocklist entries |
-| suspicious_email_domain:add | Adds and updates `email-domain-suspicious` blocklist entries |
-| suspicious_email_domain:check | Reads the `email-domain-suspicious` blocklist |
-| suspicious_email_domain:remove | Removes `email-domain-suspicious` blocklist entries |
| ban:phrase:add | Adds and updates `phrase` blocklist entries |
| ban:phrase:check | Reads the `phrase` blocklist |
| ban:phrase:remove | Removes `phrase` blocklist entries |
diff --git a/fluxer_docs/src/content/docs/admin-api/instance.mdx b/fluxer_docs/src/content/docs/admin-api/instance.mdx
index cc9d24fc7..9a5fcf305 100644
--- a/fluxer_docs/src/content/docs/admin-api/instance.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/instance.mdx
@@ -338,7 +338,6 @@ Community, direct message, premium and gating policy for the whole deployment.
| services | object | Operator overrides for `gif_enabled`, `youtube_enabled`, and `bluesky_enabled`. Each is nullable, and null means no override |
| services_resolved<sup>2</sup> | object | The same keys as concrete booleans, resolved from the override and the provider's own availability |
| services_available<sup>3</sup> | object | Provider availability for `gif`, `youtube`, and `bluesky`, with no operator override applied |
-| deferred_phone_gate | [deferred phone gate](#deferred-phone-gate-object) object | Delayed phone verification policy |
<sup>1</sup> The lock is set each time direct messages are re-enabled. [Update instance configuration](#update-instance-configuration) clears it when the policy object has `direct_messages_locked` set to false
@@ -355,18 +354,6 @@ Community, direct message, premium and gating policy for the whole deployment.
A self-hosted deployment issues gift codes and sells premium only in `mirror`.
-## Deferred phone gate object
-
-A rule for accounts whose phone verification requirement was deferred. When such an account joins a guild within `window_hours` of registration, and the guild has the `DISCOVERABLE` feature or more than `member_threshold` members, Fluxer refuses the join until the account verifies a phone.
-
-### Structure
-
-| Field | Type | Description |
-| --- | --- | --- |
-| enabled | boolean | Whether the delayed phone requirement is applied (default false) |
-| window_hours | number | Hours after registration in which the requirement can be applied (default 6) |
-| member_threshold | number | Guild member count above which the requirement is applied (default 50) |
-
## Instance integrations object
Every provider reports its stored settings, a `_set` boolean in place of each secret, and the availability resolved from the stored settings and the deployment configuration.
@@ -701,14 +688,11 @@ Fluxer skips URL validation while the merged configuration leaves single sign-on
| direct_messages_locked?<sup>2</sup> | boolean | Whether the direct message setting stays locked |
| premium_mode? | string | [Premium mode](#premium-modes) |
| services? | object | Nullable `gif_enabled`, `youtube_enabled`, and `bluesky_enabled` overrides |
-| deferred_phone_gate?<sup>3</sup> | object | `enabled`, `window_hours`, and `member_threshold` |
<sup>1</sup> Setting `single_community_enabled` to true adopts the already designated guild when one still exists. When none is designated or the designated guild was deleted, it creates a community using `single_community_name` or the configured product name. When the stored guild ID is not a valid ID, or the guild lookup fails for a reason other than an unknown guild, the operation fails and Fluxer creates no community. On a deployment whose setup is already complete, enabling it while no guild is designated fails with 400 `INSTANCE_POLICY_TRANSITION_NOT_ALLOWED`, as does enabling it when the acting Admin account cannot be resolved. Setting it to false only clears the flag and leaves the guild in place
<sup>2</sup> The setting can be changed only while `direct_messages_locked` is false, and a change attempted after the lock is set fails with 400 `INSTANCE_POLICY_TRANSITION_NOT_ALLOWED` unless the same request sets `direct_messages_locked` to false. Re-enabling direct messages sets the lock again
-<sup>3</sup> `window_hours` is a positive number up to 8760 and `member_threshold` is a positive integer up to 1000000. An omitted key keeps its stored value
-
`direct_messages_locked` accepts only false, and a body that sets it to true fails with 400 `INVALID_FORM_BODY`.
On a self-hosted deployment, billing and the `everyone` premium mode exclude each other. A body that would leave billing switched on in `everyone` fails with 400 `INVALID_FORM_BODY` and writes nothing, whether it enables billing or switches the premium mode.
diff --git a/fluxer_docs/src/content/docs/admin-api/jobs.mdx b/fluxer_docs/src/content/docs/admin-api/jobs.mdx
index 11458a9d2..ab043fb12 100644
--- a/fluxer_docs/src/content/docs/admin-api/jobs.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/jobs.mdx
@@ -11,7 +11,7 @@ These routes list recorded background jobs and request cancellation. Create jobs
Reads require `jobs:view` and cancellation requires `jobs:cancel`. Every operation on this page shares the `admin:jobs:view` bucket. The three reads record no [Admin audit entry](/admin-api/#admin-audit-entry-object), and cancellation records one.
:::note[Job updates vary by task]
-Mention processing, link previews, message delete audit log batching, payment reconciliation when a user connects, and every scheduled task except `syncDisposableEmailDomains`, `syncUrlBlocklists` and `syncFileShaBlocklists` run with no job record and never appear here. Fluxer deletes a job record about 90 days after the job was queued. A job also runs with no record when Fluxer fails to write that record. When a later write of status, progress or attempts fails, Fluxer logs the failure and the job continues, so the stored values can be behind the real run. Use the [archive routes](/admin-api/archives/) to track archive progress and failures.
+Mention processing, link previews, message delete audit log batching, payment reconciliation when a user connects, and every scheduled task except `syncUrlBlocklists` and `syncFileShaBlocklists` run with no job record and never appear here. Fluxer deletes a job record about 90 days after the job was queued. A job also runs with no record when Fluxer fails to write that record. When a later write of status, progress or attempts fails, Fluxer logs the failure and the job continues, so the stored values can be behind the real run. Use the [archive routes](/admin-api/archives/) to track archive progress and failures.
:::
## Admin job object
@@ -261,7 +261,7 @@ Returns false for a missing or terminal job. Repeating a request for a queued or
### Side effects
-Sets `cancel_requested` to true for a queued or running job. `sendSystemDm`, `syncDisposableEmailDomains`, `bulkBanFileShas`, `bulkDeleteMessagesForUsers`, and the tasks queued by [Bulk jobs](/admin-api/bulk-jobs/) check for the request while they run and stop at the next check. Other tasks run to the end. Completed work is not undone. A status of `cancelled` means the task stopped because of the request.
+Sets `cancel_requested` to true for a queued or running job. `sendSystemDm`, `bulkBanFileShas`, `bulkDeleteMessagesForUsers`, and the tasks queued by [Bulk jobs](/admin-api/bulk-jobs/) check for the request while they run and stop at the next check. Other tasks run to the end. Completed work is not undone. A status of `cancelled` means the task stopped because of the request.
The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `cancel_job`, target type `bulk_job`, target ID equal to `job_id`, and metadata key `cancelled`. The entry uses target type `bulk_job` for every task type, and Fluxer records it when `cancelled` is false too.
diff --git a/fluxer_docs/src/content/docs/admin-api/users.mdx b/fluxer_docs/src/content/docs/admin-api/users.mdx
index b718a7d8e..bdd13e9f1 100644
--- a/fluxer_docs/src/content/docs/admin-api/users.mdx
+++ b/fluxer_docs/src/content/docs/admin-api/users.mdx
@@ -51,12 +51,15 @@ When the caller lacks `user:view:email`, `user:view:dob`, or `user:view:ip`, Flu
| premium_grace_ends_at | ?ISO8601 timestamp | The time the payment grace period ends, or null when no grace period is running |
| premium_lifetime_sequence | ?integer | The sequence number of the lifetime purchase, or null when the account holds none |
| suspicious_activity_flags | integer | [Suspicious activity flags](#suspicious-activity-flags) |
-| phone_verification_deferred<sup>5</sup> | boolean | Whether a stored phone requirement is deferred until the account joins a discoverable or large community |
+| phone_verification_deferred<sup>5</sup> | boolean | Whether a stored phone requirement is deferred and not enforced |
| temp_banned_until<sup>6</sup> | ?ISO8601 timestamp | The time the ban expires, or null when no ban stands |
| pending_deletion_at | ?ISO8601 timestamp | The time the scheduled deletion runs, or null when none is scheduled |
| pending_bulk_message_deletion_at<sup>7</sup> | ?ISO8601 timestamp | The time the account's own scheduled bulk message deletion runs |
| deletion_reason_code | ?integer | [Deletion reason](#deletion-reasons) |
| deletion_public_reason | ?string | The reason shown to the account holder, or null when none was supplied |
+| deletion_audit_log_reason | ?string | The private reason stored with the pending deletion, and null without `audit_log:view` |
+| deletion_scheduled_by | ?snowflake | The ID of the account that scheduled the pending deletion, or null when it was not recorded |
+| deletion_scheduled_at | ?ISO8601 timestamp | The time the pending deletion was scheduled, or null when it was not recorded |
| acls<sup>8</sup> | array[string] | Effective [Admin ACLs](/admin-api/#acl-registry), with at most 111 entries |
| traits<sup>9</sup> | array[string] | The free-form operator labels set on the account, with at most 100 entries |
| has_totp<sup>10</sup> | boolean | Whether a TOTP authenticator is registered |
@@ -151,7 +154,7 @@ The `flags` field of the [Admin user object](#admin-user-object) is a 64-bit bit
| 1 &lt;&lt; 53 | APP_STORE_REVIEWER | Account belongs to an app store reviewer |
| 1 &lt;&lt; 57 | STAFF_HIDDEN | Staff status is hidden from public flags |
| 1 &lt;&lt; 60 | AGE_VERIFIED_ADULT | Account has verified its age as an adult through card verification |
-| 1 &lt;&lt; 61 | FORCE_INBOUND_PHONE_VERIFICATION | Account is forced through inbound phone verification regardless of prefix |
+| 1 &lt;&lt; 61 | FORCE_INBOUND_PHONE_VERIFICATION | Account is forced through inbound phone verification |
| 1 &lt;&lt; 62 | NOT_SUSPICIOUS | Account is permanently exempt from automatic suspicious activity flagging |
## Premium flags
@@ -198,7 +201,7 @@ A 32-bit bitfield of verification requirements applied to an account. [Update su
<sup>3</sup> Deferrable alongside `REQUIRE_VERIFIED_PHONE`. [Update user phone verification](#update-user-phone-verification) leaves it set
-Bit `1 << 16` sits outside this registry. It defers a phone requirement until the account joins a discoverable or large community, and the [Admin user object](#admin-user-object) reports it as `phone_verification_deferred`. [Update suspicious activity flags](#update-suspicious-activity-flags) and [Disable user for suspicious activity](#disable-user-for-suspicious-activity) bound `flags` only as a non-negative 32-bit integer, and neither masks the submitted value, so a request with that bit sets it directly.
+Bit `1 << 16` sits outside this registry. It defers a phone requirement so it is stored but not enforced, and the [Admin user object](#admin-user-object) reports it as `phone_verification_deferred`. [Update suspicious activity flags](#update-suspicious-activity-flags) and [Disable user for suspicious activity](#disable-user-for-suspicious-activity) bound `flags` only as a non-negative 32-bit integer, and neither masks the submitted value, so a request with that bit sets it directly.
## Deletion reasons
@@ -1258,13 +1261,13 @@ The operation sets verification requirements without disabling the account. [Dis
| 200 | response body | Flags were replaced |
| 404 | [error response](/admin-api/#error-response) | `UNKNOWN_USER`, because the account does not exist |
-The stored deferral bit `1 << 16` is preserved only when it was already set and the submitted value sets the same `REQUIRE_VERIFIED_PHONE` and `REQUIRE_REVERIFIED_PHONE` bits as the stored value, with at least one of them set. Any other submitted value clears the deferral bit, so any phone requirement in the submitted value stops waiting for a guild join.
+The stored deferral bit `1 << 16` is preserved only when it was already set and the submitted value sets the same `REQUIRE_VERIFIED_PHONE` and `REQUIRE_REVERIFIED_PHONE` bits as the stored value, with at least one of them set. Any other submitted value clears the deferral bit, so any phone requirement in the submitted value is enforced immediately.
[Bulk jobs](/admin-api/bulk-jobs/) applies the same change to up to 1,000 accounts as a queued `update_suspicious_activity_flags` task.
### Side effects
-[User Update](/gateway/events/#user-update) is emitted to the account's own sessions. Fluxer records a `challenged` risk outcome against the account when the write changes the set and leaves at least one registry flag set.
+[User Update](/gateway/events/#user-update) is emitted to the account's own sessions.
The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `update_suspicious_activity_flags`, target type `user`, and a metadata key `flags` with the submitted value. A preserved deferral bit makes that value differ from the flags the account ends up with.
@@ -1315,7 +1318,7 @@ Fluxer adds the `DISABLED_SUSPICIOUS_ACTIVITY` [account flag](#account-flags), s
The account is marked with `DISABLED_SUSPICIOUS_ACTIVITY`, its suspicious activity flags are replaced, and its password hash is set to null. Every authentication session is then deleted, so the account is signed out on every device.
-Fluxer records a `disabled_suspicious` risk outcome, together with a `challenged` outcome when the submitted `flags` is non-zero. Fluxer emails the account holder when the account has an email address.
+Fluxer emails the account holder when the account has an email address.
[User Update](/gateway/events/#user-update) is emitted after the sessions have already been deleted, so no connection of the account remains to receive it. The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `disable_suspicious_activity`, target type `user`, and a metadata key `flags`.
@@ -1426,11 +1429,49 @@ The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-obje
100 requests per minute for each authenticated user, on the `admin:user:modify` bucket.
+## Add a note to a user ban
+
+<RouteHeader method="POST" path="/v1/admin/users/{user_id}/ban/notes" />
+
+Appends a note to the ban that currently stands on the account. Requires `user:temp_ban`. The ban entry and earlier notes are never changed.
+
+### Path parameters
+
+| Field | Type | Description |
+| --- | --- | --- |
+| user_id | snowflake | The ID of the target account |
+
+### JSON body
+
+| Field | Type | Description |
+| --- | --- | --- |
+| ban_audit_log_id<sup>1</sup> | snowflake | The ID of the `temp_ban` audit entry of the current ban |
+| note | string | The note (1-512 characters) |
+
+<sup>1</sup> The entry must target this account, and its `banned_until` metadata must equal the current `temp_banned_until`
+
+### Response
+
+| Status | Body | Condition |
+| --- | --- | --- |
+| 204 | none | The note was recorded |
+| 400 | [error response](/admin-api/#error-response) | `INVALID_FORM_BODY`, because `ban_audit_log_id` does not name a ban of this account |
+| 404 | [error response](/admin-api/#error-response) | `UNKNOWN_USER`, because the account does not exist |
+| 409 | [error response](/admin-api/#error-response) | `CONFLICT`, because the named ban is no longer the current ban |
+
+### Side effects
+
+The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `annotate_ban`, target type `user`, the note as `audit_log_reason`, and a metadata key `ban_audit_log_id`. The `X-Audit-Log-Reason` header is not read.
+
+### Rate limit
+
+100 requests per minute for each authenticated user, on the `admin:user:modify` bucket.
+
## Schedule user deletion
<RouteHeader method="PUT" path="/v1/admin/users/{user_id}/deletion" auditReason />
-Creates or replaces an account deletion schedule and returns the resulting account. Requires `user:delete`. A schedule cannot be changed once erasure starts.
+Creates an account deletion schedule and returns the resulting account. Requires `user:delete`. A pending schedule is replaced only when the request names it in `replace_pending_deletion_at`, and a schedule cannot be changed once erasure starts.
Fluxer raises the submitted delay to the minimum for the [deletion reason](#deletion-reasons), so a request for one day under any reason other than `USER_REQUESTED` is stored as 60 days.
@@ -1449,6 +1490,7 @@ The `X-Audit-Log-Reason` value is also stored on the account as the private dele
| reason_code<sup>1</sup> | integer | [Deletion reason](#deletion-reasons) |
| public_reason?<sup>2</sup> | string | Statement of reasons shown to the account holder (at most 512 characters) |
| days_until_deletion?<sup>3</sup> | integer | Requested whole-day delay (1-365, default 60) |
+| replace_pending_deletion_at?<sup>4</sup> | ISO8601 timestamp | The `pending_deletion_at` of the schedule this request replaces |
<sup>1</sup> Required, and validated against the [deletion reason](#deletion-reasons) registry. `USER_REQUESTED` selects the 14-day minimum, and every other value selects the 60-day minimum
@@ -1456,6 +1498,8 @@ The `X-Audit-Log-Reason` value is also stored on the account as the private dele
<sup>3</sup> The stored deadline is the request instant plus the greater of this value and the minimum for the reason code. There is no absolute-timestamp field
+<sup>4</sup> Required when the account already has a pending deletion, including one the caller scheduled. It must equal the current `pending_deletion_at`
+
### Response body
| Field | Type | Description |
@@ -1468,21 +1512,21 @@ The `X-Audit-Log-Reason` value is also stored on the account as the private dele
| --- | --- | --- |
| 200 | response body | The deletion schedule was stored |
| 404 | [error response](/admin-api/#error-response) | `UNKNOWN_USER`, because the account does not exist |
-| 409 | [error response](/admin-api/#error-response) | `CONFLICT`, because erasure has started or the deletion state changed during the request |
+| 409 | [error response](/admin-api/#error-response) | `CONFLICT`, because a pending deletion was not named, erasure has started, or the deletion state changed |
`user:delete` also allows scheduling deletion of the acting Admin or an account with broader permissions.
### Side effects
-The account can no longer authenticate, and its existing authentication sessions are deleted. Erasure is scheduled for the resulting deadline.
+The account can no longer authenticate, and its existing authentication sessions and OAuth2 access and refresh tokens are deleted. The acting Admin and the time are stored as `deletion_scheduled_by` and `deletion_scheduled_at`. Erasure is scheduled for the resulting deadline.
Fluxer cancels a Stripe subscription on the account without proration and refunds the charge behind its latest invoice as fraudulent. When the cancellation or refund fails, Fluxer logs the failure and still keeps the deletion schedule.
The account holder is emailed the deadline and the supplied `public_reason` when the account has an email address.
-For every reason other than `USER_REQUESTED`, Fluxer also blocks the account's email address. It marks the account's last active IP address, its authorised IP addresses, and the IP addresses of its active and terminated sessions as suspicious, and it resolves the pending reports against the account. These enforcement steps are best-effort and can fail without cancelling the deletion schedule.
+For every reason other than `USER_REQUESTED`, Fluxer also blocks the account's email address and resolves the pending reports against the account. These enforcement steps are best-effort and can fail without cancelling the deletion schedule.
-[User Update](/gateway/events/#user-update) is emitted after the sessions have already been deleted. The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `schedule_deletion`, target type `user`, and the metadata keys `days` and `reason_code`. The identifier bans record their own blocklist entries, and when Fluxer resolves at least one report, it records a second entry with action `auto_resolve_reports_on_deletion` and a metadata key `resolved_count`.
+[User Update](/gateway/events/#user-update) is emitted after the sessions have already been deleted. The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `schedule_deletion`, target type `user`, and the metadata keys `days`, `reason_code`, and `pending_deletion_at`. A replacement adds `replaced_pending_deletion_at`, `replaced_scheduled_by`, `replaced_scheduled_at`, and `replaced_reason_code` for the schedule it replaced. The identifier bans record their own blocklist entries, and when Fluxer resolves at least one report, it records a second entry with action `auto_resolve_reports_on_deletion` and a metadata key `resolved_count`.
### Rate limit
@@ -1492,7 +1536,7 @@ For every reason other than `USER_REQUESTED`, Fluxer also blocks the account's e
<RouteHeader method="DELETE" path="/v1/admin/users/{user_id}/deletion" auditReason />
-Cancels a scheduled deletion and returns the resulting account. Requires `user:delete`. Erasure cannot be cancelled once it starts.
+Cancels the scheduled deletion named in the request and returns the resulting account. Requires `user:delete`. Erasure cannot be cancelled once it starts.
:::caution[Cancellation does not undo enforcement]
Clearing the deadline permits the account to authenticate again, but it does not restore deleted sessions, reinstate a cancelled subscription, lift the email and IP blocklist entries the schedule wrote, or reopen the reports it resolved.
@@ -1504,6 +1548,15 @@ Clearing the deadline permits the account to authenticate again, but it does not
| --- | --- | --- |
| user_id | snowflake | The ID of the target account |
+### JSON body
+
+| Field | Type | Description |
+| --- | --- | --- |
+| expected_pending_deletion_at<sup>1</sup> | ISO8601 timestamp | The `pending_deletion_at` of the deletion being cancelled |
+| notify_user? | boolean | Whether to email the account holder (default false) |
+
+<sup>1</sup> Required. It must equal the current `pending_deletion_at`, so a cancel written against one schedule never clears a different one
+
### Response body
| Field | Type | Description |
@@ -1514,17 +1567,18 @@ Clearing the deadline permits the account to authenticate again, but it does not
| Status | Body | Condition |
| --- | --- | --- |
-| 200 | response body | The deletion was cancelled, or no deletion was scheduled |
+| 200 | response body | The deletion was cancelled |
+| 400 | [error response](/admin-api/#error-response) | `NO_PENDING_DELETION`, because no deletion is scheduled |
| 404 | [error response](/admin-api/#error-response) | `UNKNOWN_USER`, because the account does not exist |
-| 409 | [error response](/admin-api/#error-response) | `CONFLICT`, because erasure has started or the deletion state changed during the request |
+| 409 | [error response](/admin-api/#error-response) | `CONFLICT`, because a different deletion is pending, erasure has started, or the deletion state changed |
### Side effects
-The deletion schedule and reasons are cleared, allowing the account to authenticate again unless another restriction applies.
+The deletion schedule, its reasons, and the recorded scheduler are cleared, allowing the account to authenticate again unless another restriction applies.
-Fluxer emails the account holder when the account has an email address. The email quotes the `X-Audit-Log-Reason` value verbatim and falls back to the literal text `deletion canceled` when the header is absent or resolves to null.
+When `notify_user` is true and the account has an email address, Fluxer emails the account holder. The email never includes the `X-Audit-Log-Reason` value.
-[User Update](/gateway/events/#user-update) is emitted to the account's own sessions. The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `cancel_deletion`, target type `user`, and no metadata.
+[User Update](/gateway/events/#user-update) is emitted to the account's own sessions. The operation records one [Admin audit entry](/admin-api/#admin-audit-entry-object) with action `cancel_deletion`, target type `user`, the metadata keys `cancelled_pending_deletion_at`, `cancelled_scheduled_by`, `cancelled_scheduled_at`, and `cancelled_reason_code` for the cancelled schedule, and `notify_user`.
### Rate limit
diff --git a/fluxer_docs/src/content/docs/http-api/applications.mdx b/fluxer_docs/src/content/docs/http-api/applications.mdx
index d6ef36553..6ecf6890f 100644
--- a/fluxer_docs/src/content/docs/http-api/applications.mdx
+++ b/fluxer_docs/src/content/docs/http-api/applications.mdx
@@ -294,7 +294,7 @@ An unclaimed account cannot create an application. An account is unclaimed while
| X-Captcha-Token?<sup>1</sup> | string | The CAPTCHA proof for the request |
| X-Captcha-Type?<sup>2</sup> | string | The CAPTCHA provider to verify against, either `hcaptcha` or `turnstile` |
-<sup>1</sup> A missing proof returns 400 `CAPTCHA_REQUIRED` and a rejected proof returns 400 `INVALID_CAPTCHA`. Fluxer skips verification when CAPTCHA is disabled for the instance, when the account has the CAPTCHA exemption flag, or when the instance's account policy grants the caller's email address the CAPTCHA exemption capability, as described by [CAPTCHA handling](/topics/captcha/)
+<sup>1</sup> A missing proof returns 400 `CAPTCHA_REQUIRED` and a rejected proof returns 400 `INVALID_CAPTCHA`. Fluxer skips verification when CAPTCHA is disabled for the instance, when the account has the CAPTCHA exemption flag, or when the caller's email address is on an exempt domain, as described by [CAPTCHA handling](/topics/captcha/)
<sup>2</sup> Fluxer verifies against the instance's configured provider when the header is absent
diff --git a/fluxer_docs/src/content/docs/http-api/authentication.mdx b/fluxer_docs/src/content/docs/http-api/authentication.mdx
index 083e48dcb..b71395c21 100644
--- a/fluxer_docs/src/content/docs/http-api/authentication.mdx
+++ b/fluxer_docs/src/content/docs/http-api/authentication.mdx
@@ -536,7 +536,7 @@ Registration verifies [CAPTCHA](/topics/captcha/) when CAPTCHA is enabled. It pe
| registration_url_code?<sup>6</sup> | ?string | The administrator-issued registration URL code (1-256 characters) |
| theme? | string | The initial theme preference, one of `dark`, `dark_legacy`, `coal`, `light`, or `system` |
-<sup>1</sup> Omitting the email address creates an unclaimed account, which has no recovery path until it is claimed. An address whose domain has no usable DNS records, or whose top-level domain is blocked by account policy, returns the field code `INVALID_EMAIL_ADDRESS`, and an address already in use returns `EMAIL_ALREADY_IN_USE`
+<sup>1</sup> Omitting the email address creates an unclaimed account, which has no recovery path until it is claimed. An address whose domain has no usable DNS records, or whose top-level domain the instance blocks, returns the field code `INVALID_EMAIL_ADDRESS`, and an address already in use returns `EMAIL_ALREADY_IN_USE`
<sup>2</sup> Omitting the username derives one from `global_name` when that value produces a permitted username, and otherwise allocates a generated username, in both cases with a server-allocated discriminator
@@ -548,7 +548,7 @@ Registration verifies [CAPTCHA](/topics/captcha/) when CAPTCHA is enabled. It pe
<sup>6</sup> A code supplied on an instance with administrator registration URLs disabled, and a code that does not resolve, both return 400 `REGISTRATION_URL_INVALID`. A valid code overrides the closed registration mode and replaces the instance approval mode with its own approval setting
-Fluxer resolves the region from the client IP address, and an age below the minimum for that region returns the field code `MUST_BE_MINIMUM_AGE`. That minimum is 13 years unless account policy sets a different minimum for the region, and the applied minimum appears only in the localised message.
+Fluxer resolves the region from the client IP address, and an age below the minimum for that region returns the field code `MUST_BE_MINIMUM_AGE`. That minimum is 13 years unless the region sets a different minimum, and the applied minimum appears only in the localised message.
Registration returns 403 `REGISTRATION_CLOSED` when the instance is closed and no valid registration URL was supplied. A username whose discriminator space is exhausted returns the field code `TOO_MANY_USERS_WITH_THIS_USERNAME`. A username or display name containing a blocked substring returns 403 `CONTENT_BLOCKED`.
@@ -573,9 +573,9 @@ There is no retry key. A repeated request with the same values creates a second
### Side effects
-The operation applies the instance's registration, email-domain, breached-password, and regional policies before creating the account, and its risk policy can set suspicious activity flags on the created account. It records the accepted terms and privacy policy, authorises the registering client IP address, and sends an email verification message when the instance sends email. An instance that sends no email marks the address verified at creation instead.
+The operation applies the instance's registration, email-domain, breached-password, and regional policies before creating the account. It records the accepted terms and privacy policy, authorises the registering client IP address, and sends an email verification message when the instance sends email. An instance that sends no email marks the address verified at creation instead.
-Registration accepts the `invite_code` from the body, or the instance's configured auto-join invite when the body has none. On an instance with single-community mode enabled, the account also joins the community guild. Each join emits [Guild Member Add](/gateway/events/#guild-member-add) to the affected guild's sessions. Registration policy can suppress invite admission.
+Registration accepts the `invite_code` from the body, or the instance's configured auto-join invite when the body has none. On an instance with single-community mode enabled, the account also joins the community guild. Each join emits [Guild Member Add](/gateway/events/#guild-member-add) to the affected guild's sessions.
Approval mode registration creates no guild membership and no authentication session, and the account cannot sign in until an administrator approves it. Every other successful registration creates one session and returns its token.
diff --git a/fluxer_docs/src/content/docs/http-api/discovery.mdx b/fluxer_docs/src/content/docs/http-api/discovery.mdx
index b849adca6..d6365f899 100644
--- a/fluxer_docs/src/content/docs/http-api/discovery.mdx
+++ b/fluxer_docs/src/content/docs/http-api/discovery.mdx
@@ -353,13 +353,11 @@ A pending, rejected, removed, or absent application fails with 400 `DISCOVERY_NO
| 400 | [error response](/http-api/#error-response) | The caller already holds the maximum number of guilds and the request returns `MAX_GUILDS` |
| 400 | [error response](/http-api/#error-response) | The guild is full and the request returns `MAX_GUILD_MEMBERS` |
| 403 | [error response](/http-api/#error-response) | Caller is a bot, presents a bearer credential, or holds a revoked account and the request returns `ACCESS_DENIED` |
-| 403<sup>1</sup> | [error response](/http-api/#error-response) | The account has an outstanding required action and the request returns `ACCOUNT_SUSPICIOUS_ACTIVITY` |
+| 403 | [error response](/http-api/#error-response) | The account has an outstanding required action and the request returns `ACCOUNT_SUSPICIOUS_ACTIVITY` |
| 403 | [error response](/http-api/#error-response) | The guild has the invites-disabled feature and the request returns `INVITES_DISABLED` |
| 403 | [error response](/http-api/#error-response) | The caller is banned from the guild directly or by address and the request returns `USER_BANNED_FROM_GUILD` or `USER_IP_BANNED_FROM_GUILD` |
| 404 | [error response](/http-api/#error-response) | The approved application names a guild whose record no longer exists and the request returns `UNKNOWN_GUILD` |
-<sup>1</sup> An account without a verified phone number can have a phone requirement that Fluxer holds back until the account joins a guild. At join time Fluxer checks that requirement against the target guild. An account that passes the account-wide check can therefore still receive `ACCOUNT_SUSPICIOUS_ACTIVITY` here
-
:::note[A guild that never existed returns 400, not 404]
A guild with no approved listing returns `DISCOVERY_NOT_DISCOVERABLE`.
:::
diff --git a/fluxer_docs/src/content/docs/http-api/errors.md b/fluxer_docs/src/content/docs/http-api/errors.md
index 22d8c1654..56cee02b2 100644
--- a/fluxer_docs/src/content/docs/http-api/errors.md
+++ b/fluxer_docs/src/content/docs/http-api/errors.md
@@ -110,7 +110,7 @@ Fluxer answers an unrecognised failure with 500 `INTERNAL_SERVER_ERROR` and a ge
## Client errors as an abuse signal
-Repeated invalid requests or credentials can trigger a temporary IP ban. A `4xx` answer to a request with no authenticated user adds to that signal, weighted by status. A 429 weighs 3, a 401 weighs 0.75, a 403 weighs 0.5, and every other 4xx weighs 0.25. One request adds at most one signal, and a request from a private or exempt address adds none. Stop using a rejected credential. Change a rejected request before sending it again, and after a 429 wait `retry_after` before the next attempt.
+Repeated invalid requests or credentials can trigger a temporary IP ban. Stop using a rejected credential. Change a rejected request before sending it again, and after a 429 wait `retry_after` before the next attempt.
:::caution[An automatic ban answers every request for 24 hours]
A temporary ban lasts 24 hours by default. Requests from the banned address return 403 `GLOBAL_IP_TEMPORARILY_BANNED`. Use `expires_at` from the response when available.
diff --git a/fluxer_docs/src/content/docs/http-api/gifts.mdx b/fluxer_docs/src/content/docs/http-api/gifts.mdx
index a1bcc3ffe..72275eefa 100644
--- a/fluxer_docs/src/content/docs/http-api/gifts.mdx
+++ b/fluxer_docs/src/content/docs/http-api/gifts.mdx
@@ -134,7 +134,7 @@ One redemption can be in flight for a code across the whole deployment, and a se
| X-Captcha-Token?<sup>1</sup> | string | The proof issued by the CAPTCHA provider |
| X-Captcha-Type?<sup>2</sup> | string | The CAPTCHA provider, either `hcaptcha` or `turnstile` |
-<sup>1</sup> A missing proof returns 400 `CAPTCHA_REQUIRED` and a rejected proof returns 400 `INVALID_CAPTCHA`. Verification is skipped when CAPTCHA is disabled, when the account has the exemption flag, or when the account's email address has the `captcha_exempt` account policy capability, as described by [CAPTCHA handling](/topics/captcha/)
+<sup>1</sup> A missing proof returns 400 `CAPTCHA_REQUIRED` and a rejected proof returns 400 `INVALID_CAPTCHA`. Verification is skipped when CAPTCHA is disabled, when the account has the exemption flag, or when the account's email address is on an exempt domain, as described by [CAPTCHA handling](/topics/captcha/)
<sup>2</sup> Any other value, including an omitted header, falls back to the instance's configured provider
diff --git a/fluxer_docs/src/content/docs/http-api/invites.mdx b/fluxer_docs/src/content/docs/http-api/invites.mdx
index d98af2828..419c069c9 100644
--- a/fluxer_docs/src/content/docs/http-api/invites.mdx
+++ b/fluxer_docs/src/content/docs/http-api/invites.mdx
@@ -220,7 +220,6 @@ Accepting an exhausted invite returns 404 `UNKNOWN_INVITE` and makes the code st
| 403 | [error response](/http-api/#error-response) | Instant invites are temporarily disabled for the guild and the request returns `FEATURE_TEMPORARILY_DISABLED` |
| 403 | [error response](/http-api/#error-response) | The caller is banned by account or email address and the request returns `USER_BANNED_FROM_GUILD` |
| 403 | [error response](/http-api/#error-response) | The caller is banned by network address and the request returns `USER_IP_BANNED_FROM_GUILD` |
-| 403 | [error response](/http-api/#error-response) | A deferred phone verification requirement becomes due and the request returns `ACCOUNT_SUSPICIOUS_ACTIVITY` |
| 404 | [error response](/http-api/#error-response) | The named guild no longer exists and the request returns `UNKNOWN_GUILD` |
| 404 | [error response](/http-api/#error-response) | The target channel no longer exists and the request returns `UNKNOWN_CHANNEL` |
| 404 | [error response](/http-api/#error-response) | The code resolves to no record, the record is exhausted, a guild invite names no guild, or a group direct message invite names no channel or a channel that no longer exists, each returning `UNKNOWN_INVITE` |
diff --git a/fluxer_docs/src/content/docs/http-api/premium.mdx b/fluxer_docs/src/content/docs/http-api/premium.mdx
index 0ace4a1d7..9e33783da 100644
--- a/fluxer_docs/src/content/docs/http-api/premium.mdx
+++ b/fluxer_docs/src/content/docs/http-api/premium.mdx
@@ -835,7 +835,7 @@ The route requires a lifetime entitlement, so an account whose premium type is n
A join emits [Guild Create](/gateway/events/#guild-create), [Guild Member Add](/gateway/events/#guild-member-add) and, when the guild has a system channel and does not suppress join notifications, [Message Create](/gateway/events/#message-create). The role grant that follows emits [Guild Member Update](/gateway/events/#guild-member-update). An account that already belongs to the guild produces that Dispatch alone.
-The operation is idempotent. For an account that already belongs to the guild, Fluxer grants the Visionary role again and changes nothing else. The join bypasses the guild ban check and the join risk gate, so a banned account is added anyway.
+The operation is idempotent. For an account that already belongs to the guild, Fluxer grants the Visionary role again and changes nothing else. The join bypasses the guild ban check, so a banned account is added anyway.
Both size ceilings still apply. An account already at its maximum number of guilds receives 400 `MAX_GUILDS`, and a Visionary guild at its member ceiling receives 400 `MAX_GUILD_MEMBERS`. Neither check runs for an account that already belongs to the guild.
diff --git a/fluxer_docs/src/content/docs/http-api/users.mdx b/fluxer_docs/src/content/docs/http-api/users.mdx
index c1c650fd0..5ac78483b 100644
--- a/fluxer_docs/src/content/docs/http-api/users.mdx
+++ b/fluxer_docs/src/content/docs/http-api/users.mdx
@@ -179,7 +179,7 @@ The private representation of the current account, returned by [Get current user
<sup>15</sup> The value drives the 24-hour cooldown on changing the default voice activity sharing state
-<sup>16</sup> The array is empty when the account has no stored suspicious activity flag, when it has no email address, or when the account policy exempts its email address from required actions
+<sup>16</sup> The array is empty when the account has no stored suspicious activity flag, when it has no email address, or when its email address is on an exempt domain
<sup>17</sup> A bot account is always permitted, and a user account is permitted only when its recorded date of birth places it at 18 years or older
diff --git a/fluxer_docs/src/content/docs/http-api/users/email-and-password.mdx b/fluxer_docs/src/content/docs/http-api/users/email-and-password.mdx
index 175fc8285..db1352c28 100644
--- a/fluxer_docs/src/content/docs/http-api/users/email-and-password.mdx
+++ b/fluxer_docs/src/content/docs/http-api/users/email-and-password.mdx
@@ -449,7 +449,7 @@ This operation replaces the email address only. Nothing on the path revokes a cr
### Side effects
-Fluxer replaces the account email, marks it verified, and removes every email-clearable suspicious activity flag, which can empty `required_actions` and restore ordinary access. The new address is also checked against the instance contact policy, and that check can add suspicious activity flags. The bounced marker is not cleared, so an account that has it recovers through [bounced email recovery](#bounced-email-recovery).
+Fluxer replaces the account email, marks it verified, and removes every email-clearable suspicious activity flag, which can empty `required_actions` and restore ordinary access. The bounced marker is not cleared, so an account that has it recovers through [bounced email recovery](#bounced-email-recovery).
For an ordinary change from an existing address, Fluxer sends a revert email to the original address so its holder can use [Revert an email change](/http-api/authentication/#revert-an-email-change). Fluxer deletes the email token, records the contact change in the account's contact change log, and emits [User Update](/gateway/events/#user-update). No public member field changes, so no [Guild Member Update](/gateway/events/#guild-member-update) follows.
diff --git a/fluxer_docs/src/content/docs/http-api/users/phone-verification.mdx b/fluxer_docs/src/content/docs/http-api/users/phone-verification.mdx
index 48daddadf..53fb67b9d 100644
--- a/fluxer_docs/src/content/docs/http-api/users/phone-verification.mdx
+++ b/fluxer_docs/src/content/docs/http-api/users/phone-verification.mdx
@@ -29,25 +29,20 @@ An account can qualify even when its [required actions](/http-api/users/#require
## Deferred phone requirement
-At registration, an instance can defer a new account's phone requirement. The [deferred phone gate](/admin-api/instance/#deferred-phone-gate-object) policy sets the window after registration in which a qualifying join makes the requirement due, and the member count above which a guild is a qualifying one. A guild with the `DISCOVERABLE` [feature](/http-api/guilds/#guild-features) qualifies at any member count.
+An account can hold a phone requirement together with a marker that defers it. A deferred requirement is absent from the [required actions](/http-api/users/#required-actions) array and restricts nothing. An account whose deferred requirement was later made due owes `REQUIRE_VERIFIED_PHONE` or `REQUIRE_REVERIFIED_PHONE`, and every ordinary user route refuses it with 403 `ACCOUNT_SUSPICIOUS_ACTIVITY`.
-A deferred requirement is absent from the [required actions](/http-api/users/#required-actions) array and restricts nothing. An attempt to join a qualifying guild inside the window makes it due, and [Accept invite](/http-api/invites/#accept-invite) refuses that attempt with 403 `ACCOUNT_SUSPICIOUS_ACTIVITY`. The account then owes `REQUIRE_VERIFIED_PHONE` or `REQUIRE_REVERIFIED_PHONE`, and every ordinary user route refuses it with the same code.
+[Get phone gate escape preview](#get-phone-gate-escape-preview) and [Run phone gate escape](#run-phone-gate-escape) set a due requirement aside again without verifying a number and without leaving any guild. Both admit an account the rest of the API refuses. The escape is available only while all of these hold.
-[Get phone gate escape preview](#get-phone-gate-escape-preview) and [Run phone gate escape](#run-phone-gate-escape) set that requirement aside again without verifying a number. Both admit an account the rest of the API refuses. The escape is available only while all of these hold.
-
-- The instance has the deferred phone gate enabled.
- The account holds no verified phone.
- The account owes `REQUIRE_VERIFIED_PHONE` or `REQUIRE_REVERIFIED_PHONE`.
- The account does not owe `REQUIRE_INBOUND_PHONE_VERIFICATION`.
-- The requirement became due through a qualifying join and has not been deferred again.
+- The requirement was deferred before it became due, and it has not been deferred again.
- The account has at least one visible required action.
## Number representation
The `phone` field is a number already in canonical E.164 form. Fluxer strips control and formatting characters, trims the value, and then matches it against `^\+[1-9]\d{1,14}$`. A value that fails returns 400 `INVALID_FORM_BODY` with one [validation error](/http-api/#validation-error-object) entry whose `path` is `phone` and whose `code` is `PHONE_NUMBER_INVALID_FORMAT`.
-A number whose leading characters appear on the instance's banned prefix list is refused with 400 `INVALID_PHONE_NUMBER`. The list holds a built-in set of country prefixes plus operator additions, and one entry blocks every number that starts with it.
-
:::note[Only the verified state is exposed]
A successful verification sets a boolean on the account. The `phone` field of the [user object](/http-api/users/#user-object) is always null, and no route returns the submitted number.
:::
@@ -67,48 +62,15 @@ Keep phone numbers, verification codes, and challenge codes out of logs, analyti
<sup>2</sup> Requesting this value always yields an inbound challenge, and neither the lookup provider nor the outbound SMS provider is contacted
-## Provider lookup verdicts
-
-Outbound SMS requires the number to pass the following checks. Fluxer evaluates the rows in order and uses the verdict of the first row whose condition matches. A number routed directly to an inbound challenge does not need this lookup.
-
-| Order | Condition | Verdict |
-| --- | --- | --- |
-| 1 | The lookup could not be done<sup>1</sup> | Refused with `INVALID_PHONE_NUMBER` |
-| 2 | The provider reports the number as invalid | Refused with `INVALID_PHONE_NUMBER` |
-| 3 | The line type is `fixedVoip` or `nonFixedVoip` | Inbound, reason `voip` |
-| 4 | The number starts with `+1` and its numbering plan area is Canadian | Inbound, reason `canadian` |
-| 5 | The line type is absent or `unknown` | Inbound, reason `unknown_line_type` |
-| 6 | The line type is `landline`, `tollFree`, `premium`, `sharedCost`, `uan`, `voicemail`, or `pager` | Refused with `INVALID_PHONE_NUMBER` |
-| 7 | The line type is anything other than `mobile` or `personal`<sup>2</sup> | Refused with `INVALID_PHONE_NUMBER` |
-| 8 | The SMS pumping risk score reaches the threshold for the reported country<sup>3</sup> | Refused with `INVALID_PHONE_NUMBER` |
-| 9 | No rule above matched | Accepted for outbound SMS |
+## Number checks
-<sup>1</sup> An instance whose lookup provider is unavailable or unconfigured refuses every number
-
-<sup>2</sup> `mobile` and `personal` are the only accepted line types
-
-<sup>3</sup> The threshold is 100 for `US` and `CA`, 70 for `GB`, `DE`, `FR`, `IT`, `ES`, `NL`, `SE`, `NO`, `DK`, `FI`, `AU`, `NZ`, `JP`, `KR`, `CH`, `AT`, `BE`, `IE`, and `PT`, and 35 for every other country and for a lookup reporting no country
-
-Only [Send phone verification](#send-phone-verification) converts an inbound verdict into a challenge. [Verify phone code](#verify-phone-code) refuses the same verdicts with 400 `INVALID_PHONE_NUMBER`.
+Outbound SMS requires the number to pass a line check with the instance's phone provider. A number the provider cannot reach, or one on a line type that cannot receive a code, is refused with 400 `INVALID_PHONE_NUMBER`. Some numbers that pass are routed to an inbound challenge instead. A number the check cannot be run for is refused.
## Inbound challenge reason values
-A reason explains why the attempt could not complete over outbound SMS.
-
| Value | Description |
| --- | --- |
-| voip | Provider lookup classified the destination as a VoIP line |
-| canadian<sup>1</sup> | The destination is a Canadian numbering plan area |
-| unknown_line_type | Provider lookup reported no line type or an unknown line type |
-| expensive_destination<sup>2</sup> | The configured inbound-required prefix policy matches the destination |
-| account_forced<sup>3</sup> | The account has the flag that forces inbound verification |
-| behavioural_risk | Phone attempt risk controls forced this attempt onto the inbound channel |
-
-<sup>1</sup> Determined from the numbering plan area of a `+1` number, and evaluated after the VoIP rule, so a Canadian VoIP number reports `voip` instead
-
-<sup>2</sup> Also reported when the caller explicitly requests the `inbound_challenge` channel. The prefix policy itself applies only while the account holds no verified phone
-
-<sup>3</sup> Reported in preference to `expensive_destination` when both would apply
+| verification_required | The instance requires inbound verification for this attempt |
## SMS delivery object
@@ -132,7 +94,7 @@ The instructions for texting a code to Fluxer, returned by [Send phone verificat
| challenge_code<sup>1</sup> | string | The code the user texts to `our_number` |
| our_number | string | The Fluxer E.164 number that receives the code |
| expires_at<sup>2</sup> | ISO8601 timestamp | The moment the challenge stops being redeemable |
-| reason | string | The [inbound challenge reason](#inbound-challenge-reason-values) that forced this channel |
+| reason | string | The [inbound challenge reason](#inbound-challenge-reason-values), always `verification_required` |
<sup>1</sup> Six decimal digits
@@ -146,7 +108,7 @@ The instructions for texting a code to Fluxer, returned by [Send phone verificat
"challenge_code": "418207",
"our_number": "+15550000000",
"expires_at": "2026-03-04T18:15:00.000Z",
- "reason": "voip"
+ "reason": "verification_required"
}
```
@@ -196,8 +158,8 @@ What [Run phone gate escape](#run-phone-gate-escape) would do for the current ac
| Field | Type | Description |
| --- | --- | --- |
| available | boolean | Whether the escape is open to this account right now |
-| guilds | array[[phone gate escape guild](#phone-gate-escape-guild-object) object] | The qualifying guilds the escape leaves, empty while `available` is false |
-| owned_guilds | array[[phone gate escape guild](#phone-gate-escape-guild-object) object] | The qualifying guilds the account owns, which the escape keeps |
+| guilds | array[[phone gate escape guild](#phone-gate-escape-guild-object) object] | Always empty, the escape leaves no guild |
+| owned_guilds | array[[phone gate escape guild](#phone-gate-escape-guild-object) object] | Always empty, the escape leaves no guild |
## Send phone verification
@@ -205,17 +167,9 @@ What [Run phone gate escape](#run-phone-gate-escape) would do for the current ac
Starts verification of the submitted number. Requires an account satisfying [eligibility](#eligibility). Returns an [SMS delivery](#sms-delivery-object) object or an [inbound challenge](#inbound-challenge-object) object on success.
-Several independent policies can force the inbound channel, and each one overrides a requested `sms`. Fluxer routes the attempt inbound before it contacts the lookup and SMS providers when any of these holds.
-
-- The caller asks for `inbound_challenge`.
-- The account has the flag that forces inbound verification.
-- The configured inbound-required prefix policy matches the number while the account holds no verified phone.
-
-An attempt that survives that step passes through phone attempt risk controls keyed by account, by client IP address, and by /24 network. A hard block returns 429 `PHONE_RATE_LIMIT_EXCEEDED` with a `Retry-After` of 86400. A captcha decision returns 400 `CAPTCHA_REQUIRED`, and this route reads no [CAPTCHA](/topics/captcha/) solution header, so the attempt cannot be retried with a solution. An inbound decision returns a challenge with the `behavioural_risk` reason.
+The instance can route the attempt to an inbound challenge instead of outbound SMS, and that overrides a requested `sms`. Requesting `inbound_challenge` always yields a challenge.
-When the SMS provider throttles an earlier send or code check for the same account or number, Fluxer records a cooldown. A request during that cooldown returns 429 `PHONE_RATE_LIMIT_EXCEEDED`. The destination is then resolved through [provider lookup](#provider-lookup-verdicts). A number that has already completed verification twice is refused with 400 `PHONE_ALREADY_USED`.
-
-Further controls bound outbound delivery to 3 sends per 6 hours for each account and 3 sends per 5 days for each number. Either denial returns 429 `PHONE_RATE_LIMIT_EXCEEDED`. The provider can also refuse the send. An invalid destination returns 400 `INVALID_PHONE_NUMBER`, and a throttle returns 429 `PHONE_RATE_LIMIT_EXCEEDED`. Every other refusal, an unreachable provider included, returns 400 `SMS_VERIFICATION_UNAVAILABLE`. On an instance where the inbound flow or its receiving number is unconfigured, an attempt routed inbound returns the same code.
+The number then passes the [number checks](#number-checks). A number that has reached its verification limit is refused with 400 `PHONE_ALREADY_USED`. Sends are limited for each account and for each number, and a denial returns 429 `PHONE_RATE_LIMIT_EXCEEDED`. A request can also return 400 `CAPTCHA_REQUIRED`. This route reads no [CAPTCHA](/topics/captcha/) solution header, so the attempt cannot be retried with a solution. Every other refusal returns 400 `SMS_VERIFICATION_UNAVAILABLE`, as does an instance with no phone verification service.
### JSON body
@@ -224,16 +178,16 @@ Further controls bound outbound delivery to 3 sends per 6 hours for each account
| phone | string | The number in canonical E.164 form, matching `^\+[1-9]\d{1,14}$` |
| channel?<sup>1</sup> | string | The preferred [verification channel](#phone-verification-channel-values) |
-<sup>1</sup> Omitting the field requests outbound SMS. Requesting `inbound_challenge` always yields a challenge reported with the `expensive_destination` reason, unless the account flag independently forces the channel and the reason becomes `account_forced`
+<sup>1</sup> Omitting the field requests outbound SMS. Requesting `inbound_challenge` always yields a challenge
### Response
| Status | Body | Condition |
| --- | --- | --- |
| 200 | [SMS delivery](#sms-delivery-object) object \| [inbound challenge](#inbound-challenge-object) object | Verification was started on the channel named by the response |
-| 400 | [error response](/http-api/#error-response) | The number is refused with `INVALID_PHONE_NUMBER`, was verified twice already and returns `PHONE_ALREADY_USED`, risk controls demand `CAPTCHA_REQUIRED`, or the send could not start and returns `SMS_VERIFICATION_UNAVAILABLE` |
+| 400 | [error response](/http-api/#error-response) | The number is refused with `INVALID_PHONE_NUMBER`, has reached its verification limit and returns `PHONE_ALREADY_USED`, the attempt returns `CAPTCHA_REQUIRED`, or the send could not start and returns `SMS_VERIFICATION_UNAVAILABLE` |
| 403 | [error response](/http-api/#error-response) | The account is not eligible and the request returns `PHONE_ADD_NOT_ELIGIBLE` |
-| 429<sup>1</sup> | [rate limit response](/topics/rate-limits/#rate-limit-response-object) | Risk controls, a provider throttle, or an account or per-number send control denies the request, which returns `PHONE_RATE_LIMIT_EXCEEDED` |
+| 429<sup>1</sup> | [rate limit response](/topics/rate-limits/#rate-limit-response-object) | A send limit or a provider throttle denies the request, which returns `PHONE_RATE_LIMIT_EXCEEDED` |
<sup>1</sup> A phone denial uses the rate limit envelope with `code` set to `PHONE_RATE_LIMIT_EXCEEDED`. An ordinary route denial returns `RATE_LIMITED`
@@ -260,11 +214,11 @@ The [eligibility](#eligibility) check does not apply here. The challenge code is
| Status | Body | Condition |
| --- | --- | --- |
| 200 | [direct inbound challenge](#direct-inbound-challenge-object) object | A challenge was issued |
-| 400 | [error response](/http-api/#error-response) | The instance has no receiving number for the inbound challenge and the request returns `SMS_VERIFICATION_UNAVAILABLE` |
+| 400 | [error response](/http-api/#error-response) | The instance cannot issue an inbound challenge and the request returns `SMS_VERIFICATION_UNAVAILABLE` |
### Side effects
-Fluxer creates a one-use challenge for the current account. The challenge completes out of band when the provider delivers the matching inbound message, and the HTTP response has no part of it. On completion, Fluxer sets the verified phone state, clears the phone requirements from the stored suspicious activity bitfield, and dispatches [User Update](/gateway/events/#user-update). When the sending number has already completed verification twice, Fluxer abandons the completion and produces no observable error.
+Fluxer creates a one-use challenge for the current account. The challenge completes out of band when the provider delivers the matching inbound message, and the HTTP response has no part of it. On completion, Fluxer sets the verified phone state, clears the phone requirements from the stored suspicious activity bitfield, and dispatches [User Update](/gateway/events/#user-update). A completion from a number that has reached its verification limit does not verify the account.
### Rate limit
@@ -276,9 +230,9 @@ Fluxer creates a one-use challenge for the current account. The challenge comple
Verifies an outbound SMS code. Requires an account satisfying [eligibility](#eligibility). Returns a [phone verification result](#phone-verification-result-object) object on success. Emits a [User Update](/gateway/events/#user-update) Gateway event.
-The number is resolved through [provider lookup](#provider-lookup-verdicts) again before the code is checked, so a number that has become ineligible since the code was sent is refused.
+The number passes the [number checks](#number-checks) again before the code is checked, so a number that has become ineligible since the code was sent is refused.
-The configured SMS provider checks the number and the code together, so the provider decides the code lifetime and the attempt allowance. A rejected code returns 400 `INVALID_PHONE_VERIFICATION_CODE`. A provider throttle returns 429 `PHONE_RATE_LIMIT_EXCEEDED` and records a cooldown that also denies [Send phone verification](#send-phone-verification) until it expires. An unreachable provider, or one answering with a server error, returns 400 `SMS_VERIFICATION_UNAVAILABLE`. Once the code has been accepted, an account record that has been deleted or can no longer be read fails with 400 `PHONE_VERIFICATION_REQUIRED`.
+The phone provider checks the number and the code together, so the provider decides the code lifetime and the attempt allowance. A rejected code returns 400 `INVALID_PHONE_VERIFICATION_CODE`. A throttle returns 429 `PHONE_RATE_LIMIT_EXCEEDED`. An unavailable provider returns 400 `SMS_VERIFICATION_UNAVAILABLE`. A number that has reached its verification limit fails with 400 `PHONE_ALREADY_USED`. A deleted account, or one that can no longer be read, fails with 400 `PHONE_VERIFICATION_REQUIRED`.
### JSON body
@@ -289,10 +243,6 @@ The configured SMS provider checks the number and the code together, so the prov
<sup>1</sup> Stripped of control and formatting characters and trimmed before the length check, and the normalised value is what the provider checks
-:::caution[A third verification consumes the code before refusing]
-A number can complete verification twice, and each success restarts a 31-day window in which Fluxer counts successes for that number. A third attempt is refused with 400 `PHONE_ALREADY_USED`, but only after the provider has accepted the code.
-:::
-
### Response
| Status | Body | Condition |
@@ -308,9 +258,9 @@ On the 429, `X-RateLimit-Scope` reports `shared` when a number-scoped provider t
### Side effects
-Fluxer marks the account as holding a verified phone. It then clears every phone requirement from the stored suspicious activity bitfield: `REQUIRE_VERIFIED_PHONE`, `REQUIRE_REVERIFIED_PHONE`, the combined email-or-phone requirements, `REQUIRE_INBOUND_PHONE_VERIFICATION`, and the marker deferring a phone requirement until the account joins a qualifying community guild. Email-only requirements remain, so an account that also owes email verification stays restricted.
+Fluxer marks the account as holding a verified phone. It then clears every phone requirement from the stored suspicious activity bitfield: `REQUIRE_VERIFIED_PHONE`, `REQUIRE_REVERIFIED_PHONE`, the combined email-or-phone requirements, `REQUIRE_INBOUND_PHONE_VERIFICATION`, and the markers of a deferred phone requirement. Email-only requirements remain, so an account that also owes email verification stays restricted.
-Fluxer clears the spammer flag when present and dispatches [User Update](/gateway/events/#user-update). When the spammer flag was cleared, Fluxer also dispatches [Guild Member Update](/gateway/events/#guild-member-update) for the account in every guild it belongs to, before the HTTP response returns.
+Fluxer dispatches [User Update](/gateway/events/#user-update) before the HTTP response returns.
### Rate limit
@@ -336,12 +286,11 @@ Returns a [phone gate escape preview](#phone-gate-escape-preview-object) object
<RouteHeader method="POST" path="/v1/users/@me/required-actions/phone-gate-escape" />
-Leaves the qualifying guilds the account does not own and defers the phone requirement again. Returns the [user](/http-api/users/#user-object) object.
+Defers the phone requirement again without leaving any guild. Returns the [user](/http-api/users/#user-object) object.
### Limitations
- The account is in the state [Deferred phone requirement](#deferred-phone-requirement) defines, and one outside it is rejected with 400 [`PHONE_GATE_ESCAPE_UNAVAILABLE`](/http-api/errors/).
-- One request leaves at most 25 guilds.
### JSON body
@@ -351,14 +300,12 @@ The body is an empty object. Fluxer reads an absent or empty body as an empty ob
| Status | Body | Condition |
| --- | --- | --- |
-| 200 | [user](/http-api/users/#user-object) object | The escape ran, fully or up to the per-request limit |
+| 200 | [user](/http-api/users/#user-object) object | The requirement was deferred again |
| 400 | [error response](/http-api/#error-response) | The escape is unavailable and the request returns `PHONE_GATE_ESCAPE_UNAVAILABLE` |
### Side effects
-Fluxer leaves each qualifying guild the account does not own, at most 25 in one request, with the same effects as [Leave guild](/http-api/guilds/#leave-guild). A qualifying guild the account owns is kept and does not block the escape.
-
-A request that leaves the whole set then defers the requirement again and dispatches [User Update](/gateway/events/#user-update). One that stopped at the limit writes no account field, dispatches nothing, and returns the account with the requirement still due. Repeat the request until the returned `required_actions` has no phone entry.
+Fluxer defers the requirement again and dispatches [User Update](/gateway/events/#user-update). Guild memberships are unchanged.
### Rate limit
diff --git a/fluxer_docs/src/content/docs/http-api/users/relationships.mdx b/fluxer_docs/src/content/docs/http-api/users/relationships.mdx
index f052fc2b7..798836439 100644
--- a/fluxer_docs/src/content/docs/http-api/users/relationships.mdx
+++ b/fluxer_docs/src/content/docs/http-api/users/relationships.mdx
@@ -171,13 +171,13 @@ A target the caller has blocked returns 400 `CANNOT_SEND_FRIEND_REQUEST_TO_BLOCK
<sup>1</sup> The friend source evaluation is skipped when the target has no stored settings, which admits the request as though the target permitted requests from anyone
:::caution[A flagged caller receives an indistinguishable success]
-A caller with the `SPAMMER` [public user flag](/http-api/users/#public-user-flags), or one whose send triggers the deployment's direct contact spam policy, gets a one-sided request. Fluxer writes only the caller's `OUTGOING_REQUEST` record. [Relationship Add](/gateway/events/#relationship-add) reaches the caller alone. The response is an ordinary `OUTGOING_REQUEST` object.
+A caller with the `SPAMMER` [public user flag](/http-api/users/#public-user-flags) gets a one-sided request. Fluxer writes only the caller's `OUTGOING_REQUEST` record. [Relationship Add](/gateway/events/#relationship-add) reaches the caller alone. The response is an ordinary `OUTGOING_REQUEST` object.
:::
-The one-sided request path also skips the rules that follow it: the target's block of the caller, the target's [friend source flags](/http-api/users/#friend-source-flags), the app store reviewer rule, the [relationship limit](#relationship-limit), and friendly bot auto-acceptance. The caller's own block of the target is still enforced and still returns 400 `CANNOT_SEND_FRIEND_REQUEST_TO_BLOCKED_USER`. When the direct contact spam policy suppresses a send and its action is `flag_spammer`, Fluxer also sets the `SPAMMER` flag on the caller, which makes every later send one-sided.
+The one-sided request path also skips the rules that follow it: the target's block of the caller, the target's [friend source flags](/http-api/users/#friend-source-flags), the app store reviewer rule, the [relationship limit](#relationship-limit), and friendly bot auto-acceptance. The caller's own block of the target is still enforced and still returns 400 `CANNOT_SEND_FRIEND_REQUEST_TO_BLOCKED_USER`.
:::note[The suppression entries enter at different points]
-Fluxer checks for the `SPAMMER` flag before it looks for a pending request from the target. A caller that already has the flag gets a one-sided request even when the target has a pending request, so it can hold both an `INCOMING_REQUEST` and an `OUTGOING_REQUEST` record for one account. Fluxer applies the direct contact spam policy after that lookup, so a caller without the flag accepts a pending request from the target normally.
+Fluxer checks for the `SPAMMER` flag before it looks for a pending request from the target. A caller that already has the flag gets a one-sided request even when the target has a pending request, so it can hold both an `INCOMING_REQUEST` and an `OUTGOING_REQUEST` record for one account. A caller without the flag accepts a pending request from the target normally.
:::
### Path parameters
diff --git a/fluxer_docs/src/content/docs/operator/configuration.mdx b/fluxer_docs/src/content/docs/operator/configuration.mdx
index 15cde5c32..a5c12d5ce 100644
--- a/fluxer_docs/src/content/docs/operator/configuration.mdx
+++ b/fluxer_docs/src/content/docs/operator/configuration.mdx
@@ -987,92 +987,20 @@ Default `false`. Behaviour when the scanner is unreachable. With scanning on and
Default `0.7`. The API-side NSFW score cutoff. No range check. Distinct from the Media Proxy threshold, which defaults to `0.85`.
-#### `FLUXER_RISK_INTEGRATION_ENABLED`
+#### `FLUXER_IPINFO_API_KEY`
-Default `false`. IP intelligence. Needs an ipinfo key to do anything.
-
-#### `FLUXER_RISK_IPINFO_API_KEY`
-
-Default empty. The ipinfo key. Paired with `FLUXER_RISK_INTEGRATION_ENABLED`.
-
-#### `FLUXER_ACCOUNT_POLICY_DSL`
-
-No default. The account risk policy. JSON. Malformed JSON fails startup, and an unknown key in a well-formed policy surfaces when the policy runs.
-
-#### `FLUXER_ABUSE_INBOUND_PHONE_COUNTRY_CODES`
-
-Default empty. Allowed inbound phone countries. Comma separated, passed through unvalidated.
-
-#### `FLUXER_ABUSE_PHONE_FLAGGING_ENABLED`
-
-Default `true`. Automatic phone requirements. With this off, registration, setting an email and gateway session start never add a requirement that offers phone verification. An email or phone requirement becomes its email only form. A deferred phone requirement stays dormant on a community join. Requirements already on an account and flags set by an Admin are untouched.
-
-#### `FLUXER_ABUSE_PHONE_FLAGGING_EXEMPT_COUNTRY_CODES`
-
-Default empty. Countries that never get an automatic phone requirement, matched against the request's GeoIP country. An email or phone requirement becomes its email only form. Comma separated, unvalidated.
-
-#### `FLUXER_ABUSE_PHONE_INBOUND_REQUIRED_PREFIXES`
-
-Default empty. Required inbound prefixes. Comma separated.
-
-#### `FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ENABLED`
-
-Default `false`. Direct contact spam detection.
-
-#### `FLUXER_ABUSE_DIRECT_CONTACT_SPAM_COUNTRY_CODES`
-
-Default empty. Countries the rule applies to. Comma separated, unvalidated.
-
-#### `FLUXER_ABUSE_DIRECT_CONTACT_SPAM_DISTINCT_TARGET_THRESHOLD`
-
-Default `25`. Distinct targets before the rule fires. Integer.
-
-#### `FLUXER_ABUSE_DIRECT_CONTACT_SPAM_TARGET_WINDOW_MS`
-
-Default `7200000`. The observation window. Milliseconds, two hours by default.
-
-#### `FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ACTION`
-
-Default `flag_spammer`. What happens when it fires. `flag_spammer` or `suppress_delivery`. Anything else fails startup.
+Default empty. The ipinfo key. Admin and guild IP bans use it to skip carrier-grade NAT and other shared addresses. Without it those checks treat every address as unknown. The previous name `FLUXER_RISK_IPINFO_API_KEY` is still read when this one is unset.
#### `FLUXER_BLOCKLIST_FEEDS_ENABLED`
-Defaults to the inverse of `FLUXER_SELF_HOSTED`. Off by default on a self-hosted instance. With feeds on, the worker downloads disposable email domains and the URLhaus and PhishTank URL lists every six hours, and MalwareBazaar file hashes every twelve hours. Fluxer checks registrations and email changes against the domains, posted links against the URLs, and uploads against the hashes.
-
-With feeds off, Fluxer checks none of this data. The first worker start with feeds off removes every disposable email domain, the URL feed file, and every `malware_bazaar` file-SHA ban that no Admin added. File-SHA bans added through the Admin API stay. Turning feeds back on downloads the disposable domains at the next worker start, the URLs within six hours, and the hashes within twelve.
+Defaults to the inverse of `FLUXER_SELF_HOSTED`. Off by default on a self-hosted instance. With feeds on, the worker downloads the URLhaus and PhishTank URL lists every six hours, and MalwareBazaar file hashes every twelve hours. Fluxer checks posted links against the URLs and uploads against the hashes.
-#### `FLUXER_TOR_EXIT_LIST_ENABLED`
-
-Defaults to the inverse of `FLUXER_SELF_HOSTED`. Tor exit blocking. The API fetches the exit relay list from `onionoo.torproject.org` at startup and every 30 minutes. Off by default on a self-hosted instance.
+With feeds off, Fluxer checks none of this data. The first worker start with feeds off removes the URL feed file and every `malware_bazaar` file-SHA ban that no Admin added. File-SHA bans added through the Admin API stay. Turning feeds back on downloads the URLs within six hours and the hashes within twelve.
#### `FLUXER_BREACHED_PASSWORD_CHECK_ENABLED`
Defaults to the inverse of `FLUXER_SELF_HOSTED`. Breached password rejection. Sends the first five characters of the password's SHA-1 hash to `api.pwnedpasswords.com`. Off by default on a self-hosted instance.
-A second family, unrelated to the rules above, tunes the IP auto-banner: `FLUXER_ABUSE_WINDOW_MS`, the `FLUXER_ABUSE_THRESHOLD_` names, the `FLUXER_ABUSE_TOKEN_DIVERSITY_` names, `FLUXER_ABUSE_BAN_TTL_SEC`, `FLUXER_ABUSE_BATCH_FLUSH_MS`, `FLUXER_ABUSE_MAX_BATCH_TICKS`, `FLUXER_ABUSE_MAX_NEW_TOKENS_PER_TICK`, `FLUXER_ABUSE_MAX_TRACKED_IPS`, `FLUXER_ABUSE_MAX_TOKEN_HASHES_PER_IP`, `FLUXER_ABUSE_MIN_SCORE_FOR_LOOKUP`, `FLUXER_ABUSE_MIN_TOKENS_FOR_LOOKUP`, and `FLUXER_ABUSE_REQUIRED_SCORE_WINDOWS_FOR_AUTO_BAN`. All are read directly from the environment, none are in `.env.example` or the Compose file, and a non-finite value or one at or below zero falls back to the default.
-
-`FLUXER_ABUSE_EXEMPT_ASNS` takes comma-separated ASN numbers that the auto-banner never bans. Non-numeric entries are dropped. Before it buys a classification the auto-banner resolves the IP against the local MaxMind ASN database, and an IP on a listed ASN is neither classified nor banned. With no MaxMind ASN database the list has no effect. It does not change admin or guild IP bans, and `FLUXER_API_IP_BAN_EXEMPT_IPS` remains the way to exempt single addresses and ranges from every kind of IP ban.
-
-Other names in that family limit how often the auto-banner buys an IP classification from ipinfo. A shared claim lets one replica do the lookup for the others. With the claim off, every API replica looks up the same attacking IP at the same moment, so one IP costs one lookup per replica.
-
-- `FLUXER_ABUSE_IP_CLASS_CLAIM_ENABLED` defaults to `1` and gates the shared claim. It is read as a string, and only `0` turns the claim off.
-- `FLUXER_ABUSE_IP_CLASS_CLAIM_TTL_SEC` defaults to `15` seconds and sets how long a replica holds that claim.
-- `FLUXER_ABUSE_IP_CLASS_PENDING_TTL_MS` defaults to `20000` milliseconds and sets how long a replica that lost the claim waits before it tries again.
-- `FLUXER_ABUSE_IP_CLASS_NEGATIVE_TTL_MS` defaults to `300000` milliseconds and sets how long a failed classification is remembered.
-- `FLUXER_ABUSE_IP_CLASS_HINT_TTL_MS` defaults to `600000` milliseconds and sets how long a class sent by another replica stays usable.
-
-For these numeric settings, a non-finite value or one at or below zero falls back to the default.
-
-A `FLUXER_IPINFO_BUDGET_` family caps what the instance spends at ipinfo. `FLUXER_IPINFO_BUDGET_ENABLED` defaults to `1`, and `0` turns off all shedding. `FLUXER_IPINFO_BUDGET_MONTHLY_MAX` defaults to `140000` and is the ceiling for one UTC calendar month. Lookups run at the priorities below, each with a share of that ceiling and a token bucket for bursts refilled once a minute.
-
-- Admin IP bans and scheduled deletion checks are critical. They reach the full ceiling, with a burst of `60` from `FLUXER_IPINFO_BUDGET_CRITICAL_BURST` refilled at `60` a minute by `FLUXER_IPINFO_BUDGET_CRITICAL_REFILL_PER_MIN`.
-- Registration risk is standard. It stops at `FLUXER_IPINFO_BUDGET_STANDARD_MONTHLY_PCT` percent of the ceiling, default `90`, with a burst of `240` from `FLUXER_IPINFO_BUDGET_STANDARD_BURST` refilled at `120` a minute by `FLUXER_IPINFO_BUDGET_STANDARD_REFILL_PER_MIN`.
-- The IP auto-banner is background. It stops at `FLUXER_IPINFO_BUDGET_BACKGROUND_MONTHLY_PCT` percent, default `60`, with a burst of `120` from `FLUXER_IPINFO_BUDGET_BACKGROUND_BURST` refilled at `30` a minute by `FLUXER_IPINFO_BUDGET_BACKGROUND_REFILL_PER_MIN`.
-
-Background lookups stop first and critical lookups stop last. A denied lookup returns an unavailable result. If the key-value store fails, lookups remain allowed at every priority, so an outage can increase usage beyond these budgets.
-
-Local MaxMind data can reduce registration-risk lookups. Set `FLUXER_RISK_IPINFO_PRESCREEN_ENABLED` to `1` or `true`, in any letter case, and fill `FLUXER_RISK_IPINFO_PRESCREEN_ALLOW_ASNS` with comma-separated ASN numbers. Non-numeric entries are dropped. An IP skips ipinfo only when MaxMind supplies its country and an allowed ASN, and the organisation is not a commercial privacy provider, education network or cellular network.
-
## Stored instance policy
Use the [admin dashboard](#runtime-settings-in-the-admin-dashboard) or [Admin instance API](/admin-api/instance/) to change saved settings. Missing settings use their documented defaults. Invalid JSON, field types, identifiers or out-of-range values cause an error instead of silently resetting security or registration policy.
@@ -1149,7 +1077,7 @@ Defaults to `false` at the Gateway's environment layer. Gateway telemetry. Read
#### `HOSTNAME`
-Set by Docker. Node identity in metrics and logs. Also used by the IP auto-banner.
+Set by Docker. Node identity in metrics and logs.
#### `FLUXER_ENV`
@@ -1255,7 +1183,7 @@ Default `10000`. Purge request timeout. Accepts 1000 to 10000. The range is chec
#### `FLUXER_GEOIP_DB_PATH`
-Default empty. The GeoIP database. A filesystem path, or an `s3://bucket/key` URL whose `download_path` query parameter is mandatory and must be absolute. `app-proxy` also accepts `MAXMIND_DB_PATH`. The API also reads an ASN database. On a filesystem path it looks for `GeoLite2-ASN.mmdb` in the same directory. On an `s3://` URL it needs an `asn_key` query parameter, and takes an optional absolute `asn_download_path` next to it. A missing ASN database is not an error, and the API falls back to ipinfo for ASN data.
+Default empty. The GeoIP database. A filesystem path, or an `s3://bucket/key` URL whose `download_path` query parameter is mandatory and must be absolute. `app-proxy` also accepts `MAXMIND_DB_PATH`.
## Instance identity and branding
@@ -1733,7 +1661,7 @@ Branding is otherwise admin-dashboard only.
Supplies the initial setup state on a self-hosted instance, until the first write of the stored `app_public_config` row takes over.
-#### Every `FLUXER_ABUSE_` auto-banner name, every `FLUXER_IPINFO_` budget name, and every Media Proxy performance knob
+#### Every Media Proxy performance knob
No example coverage at all.
diff --git a/fluxer_docs/src/content/docs/topics/captcha.md b/fluxer_docs/src/content/docs/topics/captcha.md
index 3805f6b42..c32313303 100644
--- a/fluxer_docs/src/content/docs/topics/captcha.md
+++ b/fluxer_docs/src/content/docs/topics/captcha.md
@@ -30,7 +30,7 @@ Create private channel is gated only on the group direct message path, where the
## Exemption
-Fluxer skips the check in three cases, and the operation then proceeds with no CAPTCHA header. The instance account policy grants the `captcha_exempt` capability to the authenticated account's email address. The authenticated account holds the [`APP_STORE_REVIEWER`](/admin-api/users/#account-flags) flag. The request body has an `email` that belongs to an account holding that flag. Discovery does not report exemptions, so clients must handle a challenge on every gated operation.
+Fluxer skips the check in three cases, and the operation then proceeds with no CAPTCHA header. The authenticated account's email address is on an exempt domain. The authenticated account holds the [`APP_STORE_REVIEWER`](/admin-api/users/#account-flags) flag. The request body has an `email` that belongs to an account holding that flag. Discovery does not report exemptions, so clients must handle a challenge on every gated operation.
## Request headers
@@ -79,6 +79,6 @@ A rejected solution or unavailable provider returns 400 `INVALID_CAPTCHA`. The r
| CAPTCHA_REQUIRED<sup>1</sup> | 400 | The operation is gated and the request has no solution |
| INVALID_CAPTCHA | 400 | The provider rejected the solution, or verification could not be completed |
-<sup>1</sup> [Send phone verification](/http-api/users/phone-verification/#send-phone-verification) also answers this code when Fluxer's risk check on the phone attempt decides that the request needs a CAPTCHA. That operation is not gated and accepts no solution, so retrying it with `X-Captcha-Token` never helps
+<sup>1</sup> [Send phone verification](/http-api/users/phone-verification/#send-phone-verification) can also answer this code. That operation is not gated and accepts no solution, so retrying it with `X-Captcha-Token` never helps
Both codes are defined in the [API error code registry](/http-api/errors/#api-error-code-registry), and the body of each is the ordinary [error response](/http-api/#error-response) envelope.
diff --git a/knip.json b/knip.json
index 68640c3dd..6b43e08da 100644
--- a/knip.json
+++ b/knip.json
@@ -20,6 +20,7 @@
"fluxer_app/scripts/build/Config.tsx": ["exports"],
"fluxer_app/scripts/build/rspack/static-files.mjs": ["exports"],
"fluxer_app/src/index.tsx": ["unlisted"],
+ "fluxer_api/src/api/infrastructure/activity/Contract.generated.ts": ["exports", "types"],
"fluxer_desktop/native/mac-app-audio/index.test.mjs": ["unlisted"],
"fluxer_desktop/src/common/DesktopConfig.ts": ["types"],
"fluxer_desktop/src/common/Types.ts": ["types"],
diff --git a/packages/config/src/ConfigLoader.ts b/packages/config/src/ConfigLoader.ts
index 1782a1124..65aae31e8 100644
--- a/packages/config/src/ConfigLoader.ts
+++ b/packages/config/src/ConfigLoader.ts
@@ -194,9 +194,6 @@ function defaultConfig(): MasterConfig {
from_name: 'Fluxer',
app_base_url: '',
},
- sms: {
- enabled: false,
- },
captcha: {
enabled: false,
provider: 'none',
@@ -251,12 +248,9 @@ function defaultConfig(): MasterConfig {
},
},
blocklist_feeds: {},
- tor_exit_list: {},
breached_password_check: {},
- risk_integration: {
- enabled: false,
- ipinfo_api_key: '',
- account_policy_dsl: undefined,
+ ipinfo: {
+ api_key: '',
},
push: {
apns: {
@@ -277,23 +271,6 @@ function defaultConfig(): MasterConfig {
setup: {
configured: false,
},
- abuse_policy: {
- inbound_phone_country_codes: [],
- phone_flagging: {
- enabled: true,
- exempt_country_codes: [],
- },
- phone_verification: {
- inbound_required_prefixes: [],
- },
- direct_contact_spam: {
- enabled: false,
- country_codes: [],
- distinct_target_threshold: 25,
- target_window_ms: 2 * 60 * 60 * 1000,
- action: 'flag_spammer',
- },
- },
},
dev: {
relax_registration_rate_limits: false,
@@ -590,11 +567,6 @@ function normalizeConfig(config: MasterConfig): MasterConfig {
assertOneOf(config.integrations.captcha.provider, ['hcaptcha', 'turnstile', 'none'], 'FLUXER_CAPTCHA_PROVIDER');
assertOneOf(config.integrations.search.engine, ['elasticsearch', 'meilisearch'], 'FLUXER_SEARCH_ENGINE');
assertOneOf(config.integrations.cache_purge.adapter, CACHE_PURGE_ADAPTER_NAMES, 'FLUXER_CACHE_PURGE_ADAPTER');
- assertOneOf(
- config.instance.abuse_policy.direct_contact_spam.action,
- ['flag_spammer', 'suppress_delivery'],
- 'FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ACTION',
- );
validatePostgresConfig(config);
validateCaptchaConfig(config);
validateApiWorkerConfig(config);
@@ -656,7 +628,7 @@ function applyPublicPort(config: MasterConfig, endpoints: DerivedEndpoints): Mas
}
const {bluesky, passkeys} = config.auth;
const {branding} = config.instance;
- const {email, sms, voice} = config.integrations;
+ const {email, voice} = config.integrations;
return {
...config,
domain: {
@@ -696,7 +668,6 @@ function applyPublicPort(config: MasterConfig, endpoints: DerivedEndpoints): Mas
integrations: {
...config.integrations,
email: {...email, app_base_url: normalize(email.app_base_url)},
- sms: {...sms, inbound_webhook_public_url: normalizeOptional(sms.inbound_webhook_public_url)},
voice: {...voice, url: normalize(voice.url)},
},
instance: {
diff --git a/packages/config/src/MasterConfig.ts b/packages/config/src/MasterConfig.ts
index 62e8fe97d..30e8ebd3d 100644
--- a/packages/config/src/MasterConfig.ts
+++ b/packages/config/src/MasterConfig.ts
@@ -207,15 +207,6 @@ export interface MasterConfig {
secure: boolean;
};
};
- sms: {
- enabled: boolean;
- account_sid?: string;
- auth_token?: string;
- verify_service_sid?: string;
- inbound_challenge_number?: string;
- inbound_webhook_auth_token?: string;
- inbound_webhook_public_url?: string;
- };
captcha: {
enabled: boolean;
provider: 'hcaptcha' | 'turnstile' | 'none';
@@ -288,16 +279,11 @@ export interface MasterConfig {
blocklist_feeds: {
enabled?: boolean;
};
- tor_exit_list: {
- enabled?: boolean;
- };
breached_password_check: {
enabled?: boolean;
};
- risk_integration: {
- enabled: boolean;
- ipinfo_api_key: string;
- account_policy_dsl?: unknown;
+ ipinfo: {
+ api_key: string;
};
push: {
apns: {
@@ -340,23 +326,6 @@ export interface MasterConfig {
setup: {
configured: boolean;
};
- abuse_policy: {
- inbound_phone_country_codes: Array<string>;
- phone_flagging: {
- enabled: boolean;
- exempt_country_codes: Array<string>;
- };
- phone_verification: {
- inbound_required_prefixes: Array<string>;
- };
- direct_contact_spam: {
- enabled: boolean;
- country_codes: Array<string>;
- distinct_target_threshold: number;
- target_window_ms: number;
- action: 'flag_spammer' | 'suppress_delivery';
- };
- };
};
dev: {
relax_registration_rate_limits: boolean;
diff --git a/packages/config/src/__tests__/ConfigLoader.test.ts b/packages/config/src/__tests__/ConfigLoader.test.ts
index 36c1ce63e..8343fb9be 100644
--- a/packages/config/src/__tests__/ConfigLoader.test.ts
+++ b/packages/config/src/__tests__/ConfigLoader.test.ts
@@ -299,7 +299,6 @@ describe('ConfigLoader', () => {
FLUXER_POSTGRES_PREPARED_STATEMENTS: 'false',
FLUXER_API_WORKER_MODE: 'single_task',
FLUXER_API_WORKER_TASK: 'processStripeWebhook',
- FLUXER_ACCOUNT_POLICY_DSL: '{"version":1,"id":"env_policy","rules":[]}',
FLUXER_LIVEKIT_ENABLED: 'true',
FLUXER_LIVEKIT_DEFAULT_REGION:
'{"id":"local","name":"Local","emoji":"LC","latitude":59.3293,"longitude":18.0686}',
@@ -316,11 +315,6 @@ describe('ConfigLoader', () => {
expect(config.database.postgres.prepared_statements).toBe(false);
expect(config.services.api.worker?.mode).toBe('single_task');
expect(config.services.api.worker?.task).toBe('processStripeWebhook');
- expect(config.integrations.risk_integration.account_policy_dsl).toEqual({
- version: 1,
- id: 'env_policy',
- rules: [],
- });
expect(config.integrations.voice.default_region?.id).toBe('local');
});
@@ -475,7 +469,7 @@ describe('ConfigLoader', () => {
await expect(loadConfig()).rejects.toThrow('FLUXER_POSTGRES_SSL must be true');
});
- test('parses self-host branding, setup, abuse policy, and search engine environment variables', async () => {
+ test('parses self-host branding, setup, and search engine environment variables', async () => {
stubMinimalEnv({
FLUXER_SEARCH_ENGINE: 'meilisearch',
FLUXER_SEARCH_URL: 'http://meilisearch:7700',
@@ -491,15 +485,6 @@ describe('ConfigLoader', () => {
FLUXER_APP_STATUS_PAGE_URL: 'https://status.example',
FLUXER_APP_STATUS_PAGE_INCIDENT_HISTORY_URL: 'https://status.example/history',
FLUXER_INSTANCE_SETUP_CONFIGURED: 'true',
- FLUXER_ABUSE_INBOUND_PHONE_COUNTRY_CODES: 'AA,BB',
- FLUXER_ABUSE_PHONE_FLAGGING_ENABLED: 'false',
- FLUXER_ABUSE_PHONE_FLAGGING_EXEMPT_COUNTRY_CODES: 'CC,DD',
- FLUXER_ABUSE_PHONE_INBOUND_REQUIRED_PREFIXES: '+101,+202',
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ENABLED: 'true',
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_COUNTRY_CODES: 'AA,BB',
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_DISTINCT_TARGET_THRESHOLD: '9',
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_TARGET_WINDOW_MS: '12345',
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ACTION: 'suppress_delivery',
});
const config = await loadConfig();
@@ -520,23 +505,6 @@ describe('ConfigLoader', () => {
status_page_incident_history_url: 'https://status.example/history',
});
expect(config.instance.setup.configured).toBe(true);
- expect(config.instance.abuse_policy).toEqual({
- inbound_phone_country_codes: ['AA', 'BB'],
- phone_flagging: {
- enabled: false,
- exempt_country_codes: ['CC', 'DD'],
- },
- phone_verification: {
- inbound_required_prefixes: ['+101', '+202'],
- },
- direct_contact_spam: {
- enabled: true,
- country_codes: ['AA', 'BB'],
- distinct_target_threshold: 9,
- target_window_ms: 12345,
- action: 'suppress_delivery',
- },
- });
});
test('rejects an enabled captcha with no keys for the selected provider', async () => {
@@ -677,22 +645,27 @@ describe('ConfigLoader', () => {
const config = await loadConfig();
- expect(config.integrations.tor_exit_list.enabled).toBeUndefined();
expect(config.integrations.breached_password_check.enabled).toBeUndefined();
});
test('reads the optional outbound lookup switches from the environment', async () => {
stubMinimalEnv({
- FLUXER_TOR_EXIT_LIST_ENABLED: 'true',
FLUXER_BREACHED_PASSWORD_CHECK_ENABLED: 'false',
});
const config = await loadConfig();
- expect(config.integrations.tor_exit_list.enabled).toBe(true);
expect(config.integrations.breached_password_check.enabled).toBe(false);
});
+ test('reads the IPinfo key from its current name before the previous one', async () => {
+ stubMinimalEnv({FLUXER_RISK_IPINFO_API_KEY: 'previous'});
+ expect((await loadConfig()).integrations.ipinfo.api_key).toBe('previous');
+ resetConfig();
+ stubMinimalEnv({FLUXER_IPINFO_API_KEY: 'current', FLUXER_RISK_IPINFO_API_KEY: 'previous'});
+ expect((await loadConfig()).integrations.ipinfo.api_key).toBe('current');
+ });
+
test('leaves Bluesky login off with no legal URLs by default', async () => {
stubMinimalEnv();
@@ -823,7 +796,6 @@ describe('ConfigLoader', () => {
FLUXER_GATEWAY_MEDIA_PROXY_ENDPOINT: 'http://localhost/media',
FLUXER_S3_PUBLIC_ENDPOINT: 'http://localhost/s3',
FLUXER_EMAIL_APP_BASE_URL: 'http://localhost',
- FLUXER_SMS_INBOUND_WEBHOOK_PUBLIC_URL: 'http://localhost/webhooks/sms',
FLUXER_AUTH_BLUESKY_CLIENT_URI: 'http://localhost',
FLUXER_AUTH_BLUESKY_TOS_URI: 'http://localhost/terms',
FLUXER_APP_ICON_URL: 'http://localhost/icon.png',
@@ -835,7 +807,6 @@ describe('ConfigLoader', () => {
expect(config.services.gateway.media_proxy_endpoint).toBe('http://localhost:8088/media');
expect(config.s3?.presigned_url_base).toBe('http://localhost:8088/s3');
expect(config.integrations.email.app_base_url).toBe('http://localhost:8088');
- expect(config.integrations.sms.inbound_webhook_public_url).toBe('http://localhost:8088/webhooks/sms');
expect(config.auth.bluesky.client_uri).toBe('http://localhost:8088');
expect(config.auth.bluesky.tos_uri).toBe('http://localhost:8088/terms');
expect(config.instance.branding.icon_url).toBe('http://localhost:8088/icon.png');
diff --git a/packages/config/src/config_loader/EnvironmentOverrides.ts b/packages/config/src/config_loader/EnvironmentOverrides.ts
index 3e351bc86..665ccad85 100644
--- a/packages/config/src/config_loader/EnvironmentOverrides.ts
+++ b/packages/config/src/config_loader/EnvironmentOverrides.ts
@@ -233,13 +233,6 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
FLUXER_EMAIL_SMTP_USERNAME: {path: ['integrations', 'email', 'smtp', 'username']},
FLUXER_EMAIL_SMTP_PASSWORD: {path: ['integrations', 'email', 'smtp', 'password']},
FLUXER_EMAIL_SMTP_SECURE: {path: ['integrations', 'email', 'smtp', 'secure'], parse: parseBoolean},
- FLUXER_SMS_ENABLED: {path: ['integrations', 'sms', 'enabled'], parse: parseBoolean},
- FLUXER_SMS_ACCOUNT_SID: {path: ['integrations', 'sms', 'account_sid']},
- FLUXER_SMS_AUTH_TOKEN: {path: ['integrations', 'sms', 'auth_token']},
- FLUXER_SMS_VERIFY_SERVICE_SID: {path: ['integrations', 'sms', 'verify_service_sid']},
- FLUXER_SMS_INBOUND_CHALLENGE_NUMBER: {path: ['integrations', 'sms', 'inbound_challenge_number']},
- FLUXER_SMS_INBOUND_WEBHOOK_AUTH_TOKEN: {path: ['integrations', 'sms', 'inbound_webhook_auth_token']},
- FLUXER_SMS_INBOUND_WEBHOOK_PUBLIC_URL: {path: ['integrations', 'sms', 'inbound_webhook_public_url']},
FLUXER_CAPTCHA_ENABLED: {path: ['integrations', 'captcha', 'enabled'], parse: parseBoolean},
FLUXER_CAPTCHA_PROVIDER: {path: ['integrations', 'captcha', 'provider']},
FLUXER_CAPTCHA_HCAPTCHA_SITE_KEY: {path: ['integrations', 'captcha', 'hcaptcha', 'site_key']},
@@ -326,17 +319,11 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
parse: parseInteger,
},
FLUXER_BLOCKLIST_FEEDS_ENABLED: {path: ['integrations', 'blocklist_feeds', 'enabled'], parse: parseBoolean},
- FLUXER_TOR_EXIT_LIST_ENABLED: {path: ['integrations', 'tor_exit_list', 'enabled'], parse: parseBoolean},
FLUXER_BREACHED_PASSWORD_CHECK_ENABLED: {
path: ['integrations', 'breached_password_check', 'enabled'],
parse: parseBoolean,
},
- FLUXER_RISK_INTEGRATION_ENABLED: {path: ['integrations', 'risk_integration', 'enabled'], parse: parseBoolean},
- FLUXER_RISK_IPINFO_API_KEY: {path: ['integrations', 'risk_integration', 'ipinfo_api_key']},
- FLUXER_ACCOUNT_POLICY_DSL: {
- path: ['integrations', 'risk_integration', 'account_policy_dsl'],
- parse: parseEnvValue,
- },
+ FLUXER_IPINFO_API_KEY: {path: ['integrations', 'ipinfo', 'api_key']},
FLUXER_PUSH_APNS_ENABLED: {path: ['integrations', 'push', 'apns', 'enabled'], parse: parseBoolean},
FLUXER_PUSH_APNS_TEAM_ID: {path: ['integrations', 'push', 'apns', 'team_id']},
FLUXER_PUSH_APNS_KEY_ID: {path: ['integrations', 'push', 'apns', 'key_id']},
@@ -366,41 +353,6 @@ const NAMED_FLUXER_ENV_OVERRIDES: Record<string, NamedEnvOverride> = {
FLUXER_APP_STATUS_PAGE_URL: {path: ['instance', 'branding', 'status_page_url']},
FLUXER_APP_STATUS_PAGE_INCIDENT_HISTORY_URL: {path: ['instance', 'branding', 'status_page_incident_history_url']},
FLUXER_INSTANCE_SETUP_CONFIGURED: {path: ['instance', 'setup', 'configured'], parse: parseBoolean},
- FLUXER_ABUSE_INBOUND_PHONE_COUNTRY_CODES: {
- path: ['instance', 'abuse_policy', 'inbound_phone_country_codes'],
- parse: parseCsv,
- },
- FLUXER_ABUSE_PHONE_FLAGGING_ENABLED: {
- path: ['instance', 'abuse_policy', 'phone_flagging', 'enabled'],
- parse: parseBoolean,
- },
- FLUXER_ABUSE_PHONE_FLAGGING_EXEMPT_COUNTRY_CODES: {
- path: ['instance', 'abuse_policy', 'phone_flagging', 'exempt_country_codes'],
- parse: parseCsv,
- },
- FLUXER_ABUSE_PHONE_INBOUND_REQUIRED_PREFIXES: {
- path: ['instance', 'abuse_policy', 'phone_verification', 'inbound_required_prefixes'],
- parse: parseCsv,
- },
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ENABLED: {
- path: ['instance', 'abuse_policy', 'direct_contact_spam', 'enabled'],
- parse: parseBoolean,
- },
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_COUNTRY_CODES: {
- path: ['instance', 'abuse_policy', 'direct_contact_spam', 'country_codes'],
- parse: parseCsv,
- },
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_DISTINCT_TARGET_THRESHOLD: {
- path: ['instance', 'abuse_policy', 'direct_contact_spam', 'distinct_target_threshold'],
- parse: parseInteger,
- },
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_TARGET_WINDOW_MS: {
- path: ['instance', 'abuse_policy', 'direct_contact_spam', 'target_window_ms'],
- parse: parseInteger,
- },
- FLUXER_ABUSE_DIRECT_CONTACT_SPAM_ACTION: {
- path: ['instance', 'abuse_policy', 'direct_contact_spam', 'action'],
- },
FLUXER_DISCOVERY_ENABLED: {path: ['discovery', 'enabled'], parse: parseBoolean},
FLUXER_DISCOVERY_MIN_MEMBER_COUNT: {path: ['discovery', 'min_member_count'], parse: parseInteger},
FLUXER_DELETION_GRACE_PERIOD_HOURS: {path: ['deletion_grace_period_hours'], parse: parseInteger},
@@ -537,6 +489,7 @@ export function setNestedValue(target: ConfigContainer, keys: Array<ConfigPathKe
const NAMED_FLUXER_ENV_ALIASES: Record<string, string | undefined> = {
FLUXER_INTERNAL_MEDIA_PROXY_ENDPOINT: 'FLUXER_MEDIA_PROXY_ENDPOINT',
FLUXER_NATS_URL: 'FLUXER_NATS_CORE_URL',
+ FLUXER_IPINFO_API_KEY: 'FLUXER_RISK_IPINFO_API_KEY',
};
export function buildNamedFluxerEnvOverrides(env: NodeJS.ProcessEnv): ConfigObject {
diff --git a/packages/constants/src/AdminACLs.ts b/packages/constants/src/AdminACLs.ts
index 6c7c6e786..1baaeb618 100644
--- a/packages/constants/src/AdminACLs.ts
+++ b/packages/constants/src/AdminACLs.ts
@@ -18,9 +18,6 @@ export const AdminACLs = {
BAN_EMAIL_ADD: 'ban:email:add',
BAN_EMAIL_CHECK: 'ban:email:check',
BAN_EMAIL_REMOVE: 'ban:email:remove',
- SUSPICIOUS_EMAIL_DOMAIN_ADD: 'suspicious_email_domain:add',
- SUSPICIOUS_EMAIL_DOMAIN_CHECK: 'suspicious_email_domain:check',
- SUSPICIOUS_EMAIL_DOMAIN_REMOVE: 'suspicious_email_domain:remove',
BAN_PHRASE_ADD: 'ban:phrase:add',
BAN_PHRASE_CHECK: 'ban:phrase:check',
BAN_PHRASE_REMOVE: 'ban:phrase:remove',
diff --git a/packages/constants/src/RegionalMinimumAge.ts b/packages/constants/src/RegionalMinimumAge.ts
new file mode 100644
index 000000000..063507810
--- /dev/null
+++ b/packages/constants/src/RegionalMinimumAge.ts
@@ -0,0 +1,42 @@
+// SPDX-License-Identifier: AGPL-3.0-or-later
+
+export const DEFAULT_MINIMUM_AGE = 13;
+
+const REGIONAL_MINIMUM_AGE: Readonly<Record<string, number>> = {
+ AT: 14,
+ AW: 16,
+ BG: 14,
+ BQ: 16,
+ CL: 14,
+ CO: 14,
+ CW: 16,
+ CY: 14,
+ CZ: 15,
+ DE: 16,
+ ES: 14,
+ FR: 15,
+ GR: 15,
+ HR: 16,
+ HU: 16,
+ IE: 16,
+ IT: 14,
+ KR: 14,
+ LT: 14,
+ LU: 16,
+ NL: 16,
+ PE: 14,
+ PL: 16,
+ RO: 16,
+ RS: 15,
+ SI: 16,
+ SK: 16,
+ SM: 16,
+ SX: 16,
+ VE: 14,
+ VN: 15,
+};
+
+export function getRegionalMinimumAge(countryCode: string | null | undefined): number {
+ const normalized = countryCode?.trim().toUpperCase();
+ return (normalized && REGIONAL_MINIMUM_AGE[normalized]) || DEFAULT_MINIMUM_AGE;
+}
diff --git a/packages/constants/src/SmsVerificationConstants.ts b/packages/constants/src/SmsVerificationConstants.ts
deleted file mode 100644
index 5864dfd6d..000000000
--- a/packages/constants/src/SmsVerificationConstants.ts
+++ /dev/null
@@ -1,6 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-export const SMS_TWILIO_DEFAULT_VERIFY_API_URL = 'https://verify.twilio.com/v2';
-export const SMS_TWILIO_DEFAULT_LOOKUP_API_URL = 'https://lookups.twilio.com/v2';
-export const SMS_MASK_VISIBLE_PREFIX_LENGTH = 6;
-export const SMS_TEST_VERIFICATION_CODE = '123456';
diff --git a/packages/constants/src/UserConstants.ts b/packages/constants/src/UserConstants.ts
index d257b8855..7bb0c6b04 100644
--- a/packages/constants/src/UserConstants.ts
+++ b/packages/constants/src/UserConstants.ts
@@ -89,10 +89,8 @@ export const UserFlagsDescriptions: Record<keyof typeof UserFlags, string> = {
APP_STORE_REVIEWER: 'User is an app store reviewer',
STAFF_HIDDEN: 'User staff status is hidden from public flags',
AGE_VERIFIED_ADULT: 'User has verified their age as an adult via credit card verification',
- FORCE_INBOUND_PHONE_VERIFICATION:
- 'User is forced through inbound (expensive-destination) phone verification regardless of phone prefix, for debugging',
- NOT_SUSPICIOUS:
- 'User is permanently exempt from automatic suspicious-activity flagging on RPC session start (does not require a prior payment)',
+ FORCE_INBOUND_PHONE_VERIFICATION: 'User is forced through inbound phone verification, for debugging',
+ NOT_SUSPICIOUS: 'User is permanently exempt from automatic suspicious-activity flagging',
};
export const PremiumFlags = {
DISCRIMINATOR: 1 << 0,
@@ -200,7 +198,6 @@ export const PHONE_GATE_PROMOTED_FROM_DEFERRAL = 1 << 17;
export const DEFERRABLE_PHONE_FLAGS =
SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE | SuspiciousActivityFlags.REQUIRE_REVERIFIED_PHONE;
export const NEVER_DEFERRABLE_PHONE_FLAGS = SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION;
-export const PHONE_REQUIREMENT_FLAGS = DEFERRABLE_PHONE_FLAGS | NEVER_DEFERRABLE_PHONE_FLAGS;
export function imposePhoneRequirements(currentFlags: number, addedFlags: number): number {
const nextFlags = currentFlags | addedFlags;
if ((addedFlags & DEFERRABLE_PHONE_FLAGS) === 0) {
@@ -213,16 +210,6 @@ export const ADMIN_PHONE_TOGGLE_CLEARABLE_FLAGS =
PHONE_GATE_PROMOTED_FROM_DEFERRAL |
SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE |
SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION;
-export const PHONE_ADD_CLEARABLE_FLAGS =
- DEFERRED_PHONE_ON_COMMUNITY_JOIN |
- PHONE_GATE_PROMOTED_FROM_DEFERRAL |
- SuspiciousActivityFlags.REQUIRE_VERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL_OR_VERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL_OR_VERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_VERIFIED_EMAIL_OR_REVERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_REVERIFIED_EMAIL_OR_REVERIFIED_PHONE |
- SuspiciousActivityFlags.REQUIRE_INBOUND_PHONE_VERIFICATION;
export const ThemeTypes = {
DARK: 'dark',
DARK_LEGACY: 'dark_legacy',
diff --git a/packages/hono/src/middleware/Metrics.ts b/packages/hono/src/middleware/Metrics.ts
index 13ae8cf97..8e4dce9f5 100644
--- a/packages/hono/src/middleware/Metrics.ts
+++ b/packages/hono/src/middleware/Metrics.ts
@@ -101,6 +101,24 @@ class Gauge {
}
}
+const registeredSections = new Set<() => string>();
+
+export function registerMetricsSection(render: () => string): () => void {
+ registeredSections.add(render);
+ return () => {
+ registeredSections.delete(render);
+ };
+}
+
+function renderRegisteredSections(): Array<string> {
+ const rendered: Array<string> = [];
+ for (const render of registeredSections) {
+ const text = render().trim();
+ if (text !== '') rendered.push(text);
+ }
+ return rendered;
+}
+
interface MetricsState {
requestsTotal: Counter;
errorsTotal: Counter;
@@ -156,6 +174,7 @@ export function createMetricsMiddleware(serviceName: string): MetricsResult {
requestDuration.render(`${prefix}_http_request_duration_seconds`, 'HTTP request duration in seconds'),
errorsTotal.render(`${prefix}_http_errors_total`, 'Total HTTP 5xx errors'),
uptime.render(`${prefix}_uptime_seconds`, 'Process uptime in seconds'),
+ ...renderRegisteredSections(),
];
return c.text(`${sections.join('\n\n')}\n`, 200, {
'Content-Type': 'text/plain; version=0.0.4; charset=utf-8',
diff --git a/packages/hono/src/middleware/tests/Metrics.test.ts b/packages/hono/src/middleware/tests/Metrics.test.ts
index abe48c3f6..eb42c5090 100644
--- a/packages/hono/src/middleware/tests/Metrics.test.ts
+++ b/packages/hono/src/middleware/tests/Metrics.test.ts
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: AGPL-3.0-or-later
-import {createMetricsMiddleware} from '@fluxer/hono/src/middleware/Metrics';
+import {createMetricsMiddleware, registerMetricsSection} from '@fluxer/hono/src/middleware/Metrics';
import {Hono} from 'hono';
import {describe, expect, test} from 'vitest';
@@ -255,4 +255,14 @@ describe('Metrics Middleware', () => {
expect(body).toContain('fluxer_gateway_uptime_seconds');
});
});
+
+ describe('registered sections', () => {
+ test('appends registered sections until they are unregistered', async () => {
+ const {app} = createTestApp();
+ const unregister = registerMetricsSection(() => '# TYPE fluxer_test_extra gauge\nfluxer_test_extra 7');
+ expect(await (await requestMetrics(app)).text()).toContain('fluxer_test_extra 7');
+ unregister();
+ expect(await (await requestMetrics(app)).text()).not.toContain('fluxer_test_extra');
+ });
+ });
});
diff --git a/packages/logger/src/mock.ts b/packages/logger/src/mock.ts
deleted file mode 100644
index ada3d5777..000000000
--- a/packages/logger/src/mock.ts
+++ /dev/null
@@ -1,15 +0,0 @@
-// SPDX-License-Identifier: AGPL-3.0-or-later
-
-import type {LoggerInterface} from '@fluxer/logger/src/LoggerInterface';
-
-export function createMockLogger(): LoggerInterface {
- const logger: LoggerInterface = {
- trace: () => {},
- debug: () => {},
- info: () => {},
- warn: () => {},
- error: () => {},
- child: () => logger,
- };
- return logger;
-}
diff --git a/packages/schema/src/domains/admin/AdminBlocklistSchemas.ts b/packages/schema/src/domains/admin/AdminBlocklistSchemas.ts
index cb27128c7..f28fc91e8 100644
--- a/packages/schema/src/domains/admin/AdminBlocklistSchemas.ts
+++ b/packages/schema/src/domains/admin/AdminBlocklistSchemas.ts
@@ -10,24 +10,13 @@ import {
BanUrlDomainRequest,
BanUrlRequest,
CheckAvatarHashRequest,
- SuspiciousEmailDomainRequest,
} from '@fluxer/schema/src/domains/admin/AdminSchemas';
import {createQueryIntegerType} from '@fluxer/schema/src/primitives/QueryValidators';
import {createStringType, Int32Type, SnowflakeStringType} from '@fluxer/schema/src/primitives/SchemaPrimitives';
import {z} from 'zod';
export const AdminBlocklistListType = z
- .enum([
- 'ip',
- 'email',
- 'email-domain-suspicious',
- 'phrase',
- 'url',
- 'url-domain',
- 'file-sha',
- 'avatar-hash',
- 'profile-substring',
- ])
+ .enum(['ip', 'email', 'phrase', 'url', 'url-domain', 'file-sha', 'avatar-hash', 'profile-substring'])
.describe('The blocklist an entry belongs to');
export type AdminBlocklistListType = z.infer<typeof AdminBlocklistListType>;
@@ -119,7 +108,6 @@ export const AdminBlocklistEntryCreateRequest = z
.union([
BanIpRequest,
BanEmailRequest,
- SuspiciousEmailDomainRequest,
BanPhraseRequest,
BanUrlRequest,
BanUrlDomainRequest,
diff --git a/packages/schema/src/domains/admin/AdminSchemas.ts b/packages/schema/src/domains/admin/AdminSchemas.ts
index cfb8e0a08..02ec5e481 100644
--- a/packages/schema/src/domains/admin/AdminSchemas.ts
+++ b/packages/schema/src/domains/admin/AdminSchemas.ts
@@ -309,19 +309,6 @@ export const BanEmailRequest = z.object({
export type BanEmailRequest = z.infer<typeof BanEmailRequest>;
-export const SuspiciousEmailDomainRequest = z.object({
- domain: z
- .string()
- .min(1)
- .max(253)
- .regex(/^[a-zA-Z0-9][a-zA-Z0-9\-.]*\.[a-zA-Z]{2,}$/, 'Must be a valid domain name (e.g. example.com)')
- .describe(
- 'Email domain to flag as suspicious (e.g. mail.ru). Registrants from this domain will be required to verify a phone number.',
- ),
-});
-
-export type SuspiciousEmailDomainRequest = z.infer<typeof SuspiciousEmailDomainRequest>;
-
export const BanPhraseRequest = z.object({
phrase: createStringType(1, 500).describe(
'Phrase to ban. Matching is case-insensitive and also normalizes common bypass tricks such as inserted whitespace, punctuation, invisible characters, and compatibility glyphs.',
@@ -585,11 +572,6 @@ const InstancePolicyResponse = z.object({
youtube: z.boolean(),
bluesky: z.boolean(),
}),
- deferred_phone_gate: z.object({
- enabled: z.boolean(),
- window_hours: z.number(),
- member_threshold: z.number(),
- }),
});
const EmailProviderSchema = z.enum(['smtp', 'none']);
@@ -700,13 +682,6 @@ const InstancePolicyUpdateSchema = z.object({
bluesky_enabled: z.boolean().nullish(),
})
.nullish(),
- deferred_phone_gate: z
- .object({
- enabled: z.boolean().optional(),
- window_hours: z.number().positive().max(8760).optional(),
- member_threshold: z.number().int().positive().max(1_000_000).optional(),
- })
- .nullish(),
});
export const InstanceConfigUpdateRequest = z.object({
diff --git a/packages/schema/src/domains/admin/AdminUserSchemas.ts b/packages/schema/src/domains/admin/AdminUserSchemas.ts
index f3f57c305..d959998a2 100644
--- a/packages/schema/src/domains/admin/AdminUserSchemas.ts
+++ b/packages/schema/src/domains/admin/AdminUserSchemas.ts
@@ -63,14 +63,20 @@ export const UserAdminResponseSchema = z.object({
'Suspicious activity indicators',
'SuspiciousActivityFlags',
),
- phone_verification_deferred: z
- .boolean()
- .describe('Whether a stored phone requirement is deferred until the user joins a discoverable or large community'),
+ phone_verification_deferred: z.boolean().describe('Whether a stored phone requirement is deferred and not enforced'),
temp_banned_until: z.string().nullable(),
pending_deletion_at: z.string().nullable(),
pending_bulk_message_deletion_at: z.string().nullable(),
deletion_reason_code: Int32Type.nullable(),
deletion_public_reason: z.string().nullable(),
+ deletion_audit_log_reason: z
+ .string()
+ .nullable()
+ .describe('Private reason recorded with the pending deletion, null without the audit log view permission'),
+ deletion_scheduled_by: SnowflakeStringType.nullable().describe(
+ 'ID of the account that scheduled the pending deletion, null when it was not recorded',
+ ),
+ deletion_scheduled_at: z.string().nullable().describe('ISO 8601 timestamp when the pending deletion was scheduled'),
acls: z.array(z.string()).max(ADMIN_ACL_COUNT),
traits: z.array(z.string()).max(100),
has_totp: z.boolean(),
@@ -334,6 +340,12 @@ export const ScheduleAccountDeletionRequest = z.object({
.max(365)
.default(60)
.describe('Number of days until the account is deleted'),
+ replace_pending_deletion_at: z.iso
+ .datetime()
+ .optional()
+ .describe(
+ 'pending_deletion_at of the deletion this request replaces. Required when a deletion is already scheduled for the account',
+ ),
});
export type ScheduleAccountDeletionRequest = z.infer<typeof ScheduleAccountDeletionRequest>;
@@ -420,7 +432,10 @@ export const BulkUpdateUserFlagsRequest = z.object({
export type BulkUpdateUserFlagsRequest = z.infer<typeof BulkUpdateUserFlagsRequest>;
-export const BulkScheduleUserDeletionRequest = ScheduleAccountDeletionRequest.omit({user_id: true}).extend({
+export const BulkScheduleUserDeletionRequest = ScheduleAccountDeletionRequest.omit({
+ user_id: true,
+ replace_pending_deletion_at: true,
+}).extend({
user_ids: z.array(SnowflakeType).max(1000).describe('List of user IDs to schedule deletion for'),
days_until_deletion: ScheduleAccountDeletionRequest.shape.days_until_deletion.describe(
'Number of days until the accounts are deleted',
@@ -629,6 +644,22 @@ export const AdminUserDeletionScheduleRequest = ScheduleAccountDeletionRequest.o
export type AdminUserDeletionScheduleRequest = z.infer<typeof AdminUserDeletionScheduleRequest>;
+export const AdminUserDeletionCancelRequest = z.object({
+ expected_pending_deletion_at: z.iso
+ .datetime()
+ .describe('pending_deletion_at of the deletion being cancelled, as shown on the account'),
+ notify_user: z.boolean().default(false).describe('Whether to email the user that the deletion was cancelled'),
+});
+
+export type AdminUserDeletionCancelRequest = z.infer<typeof AdminUserDeletionCancelRequest>;
+
+export const AdminUserBanNoteRequest = z.object({
+ ban_audit_log_id: SnowflakeType.describe('Audit log entry of the current ban that the note refers to'),
+ note: createStringType(1, 512).describe('Note to append to the ban. Recorded as the reason of a new audit log entry'),
+});
+
+export type AdminUserBanNoteRequest = z.infer<typeof AdminUserBanNoteRequest>;
+
export const AdminUserAclsRequest = SetUserAclsRequest.omit({user_id: true});
export type AdminUserAclsRequest = z.infer<typeof AdminUserAclsRequest>;
diff --git a/packages/schema/src/domains/auth/AuthSchemas.ts b/packages/schema/src/domains/auth/AuthSchemas.ts
index 80ef72242..fe2369fbe 100644
--- a/packages/schema/src/domains/auth/AuthSchemas.ts
+++ b/packages/schema/src/domains/auth/AuthSchemas.ts
@@ -441,9 +441,7 @@ const PhoneSendVerificationInboundChallengeResponse = z.object({
challenge_code: createStringType(4, 12).describe('The numeric code the user must text to our number'),
our_number: createStringType(4, 32).describe('The Twilio number the user must text the code to (E.164)'),
expires_at: z.iso.datetime().describe('ISO 8601 timestamp when this inbound challenge expires'),
- reason: z
- .enum(['voip', 'canadian', 'unknown_line_type', 'expensive_destination', 'account_forced', 'behavioural_risk'])
- .describe('Why inbound verification is required'),
+ reason: z.enum(['verification_required']).describe('Always verification_required'),
});
export const PhoneSendVerificationResponse = z.union([
diff --git a/packages/schema/src/domains/user/UserResponseSchemas.ts b/packages/schema/src/domains/user/UserResponseSchemas.ts
index 89326c59e..69f3f8cfd 100644
--- a/packages/schema/src/domains/user/UserResponseSchemas.ts
+++ b/packages/schema/src/domains/user/UserResponseSchemas.ts
@@ -137,9 +137,7 @@ export const UserPrivateResponse = UserPartialResponse.extend({
force_inbound_phone_verification: z
.boolean()
.optional()
- .describe(
- 'Whether this account is forced through the inbound (expensive-destination) phone verification flow regardless of prefix, for debugging',
- ),
+ .describe('Whether this account is forced through the inbound phone verification flow, for debugging'),
password_last_changed_at: z.string().nullable().describe('ISO8601 timestamp of the last password change'),
last_voice_activity_sharing_change_at: z
.string()
@@ -653,13 +651,9 @@ const PhoneGateEscapeGuildResponse = z.object({
});
export const PhoneGateEscapePreviewResponse = z.object({
- available: z.boolean().describe('Whether this account can set the deferred phone verification check aside right now'),
- guilds: z
- .array(PhoneGateEscapeGuildResponse)
- .describe('Communities that trigger the phone check and will be left when the escape runs'),
- owned_guilds: z
- .array(PhoneGateEscapeGuildResponse)
- .describe('Communities that trigger the phone check but are owned by this user, so they are kept'),
+ available: z.boolean().describe('Whether this account can set a due phone verification requirement aside right now'),
+ guilds: z.array(PhoneGateEscapeGuildResponse).describe('Always empty, the escape leaves no community'),
+ owned_guilds: z.array(PhoneGateEscapeGuildResponse).describe('Always empty, the escape leaves no community'),
});
export type PhoneGateEscapePreviewResponse = z.infer<typeof PhoneGateEscapePreviewResponse>;
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 21bf6f874..36388e125 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -635,9 +635,6 @@ importers:
'@pkgs/rate_limit':
specifier: workspace:*
version: link:pkgs/rate_limit
- '@pkgs/sms':
- specifier: workspace:*
- version: link:pkgs/sms
'@pkgs/virus_scan':
specifier: workspace:*
version: link:pkgs/virus_scan
@@ -1017,28 +1014,6 @@ importers:
specifier: catalog:ts7
version: 7.0.2
- fluxer_api/pkgs/sms:
- dependencies:
- '@fluxer/constants':
- specifier: workspace:*
- version: link:../../../packages/constants
- '@fluxer/errors':
- specifier: workspace:*
- version: link:../../../packages/errors
- '@fluxer/logger':
- specifier: workspace:*
- version: link:../../../packages/logger
- devDependencies:
- '@types/node':
- specifier: 'catalog:'
- version: 26.6.1
- typescript:
- specifier: catalog:ts7
- version: 7.0.2
- vitest:
- specifier: 'catalog:'
-
fluxer_api/pkgs/virus_scan:
dependencies:
'@fluxer/logger':
diff --git a/tools/dev/cassandra_target_schema.json b/tools/dev/cassandra_target_schema.json
index 121406e9d..9a7cc54e2 100644
--- a/tools/dev/cassandra_target_schema.json
+++ b/tools/dev/cassandra_target_schema.json
@@ -1502,17 +1502,6 @@
"primary_key": "(ip)",
"options": ""
},
- {
- "name": "banned_phone_prefixes",
- "columns": [
- {
- "name": "prefix",
- "type": "text"
- }
- ],
- "primary_key": "(prefix)",
- "options": ""
- },
{
"name": "banned_phrases",
"columns": [
@@ -3629,17 +3618,6 @@
"primary_key": "((shard_id), index_name)",
"options": ""
},
- {
- "name": "disposable_email_domains",
- "columns": [
- {
- "name": "domain",
- "type": "text"
- }
- ],
- "primary_key": "(domain)",
- "options": ""
- },
{
"name": "dm_states",
"columns": [
@@ -5847,64 +5825,6 @@
"primary_key": "((report_id))",
"options": ""
},
- {
- "name": "inbound_sms_challenges",
- "columns": [
- {
- "name": "challenge_code",
- "type": "text"
- },
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "our_number",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "expires_at",
- "type": "timestamp"
- },
- {
- "name": "consumed_at",
- "type": "timestamp"
- },
- {
- "name": "consumed_from_phone",
- "type": "text"
- }
- ],
- "primary_key": "(challenge_code)",
- "options": "default_time_to_live = 900 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'HOURS', 'compaction_window_size': '1'}"
- },
- {
- "name": "inbound_sms_challenges_by_user",
- "columns": [
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "challenge_code",
- "type": "text"
- },
- {
- "name": "expires_at",
- "type": "timestamp"
- }
- ],
- "primary_key": "(user_id, created_at)",
- "options": "CLUSTERING ORDER BY (created_at DESC) AND default_time_to_live = 900 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'HOURS', 'compaction_window_size': '1'}"
- },
{
"name": "instance_configuration",
"columns": [
@@ -6291,37 +6211,6 @@
"primary_key": "(job_id)",
"options": "default_time_to_live = 7776000"
},
- {
- "name": "latest_risk_context_by_user",
- "columns": [
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "updated_at",
- "type": "timestamp"
- },
- {
- "name": "ip",
- "type": "text"
- },
- {
- "name": "subnet",
- "type": "text"
- },
- {
- "name": "email_domain",
- "type": "text"
- },
- {
- "name": "asn",
- "type": "int"
- }
- ],
- "primary_key": "(user_id)",
- "options": ""
- },
{
"name": "message_reactions",
"columns": [
@@ -7054,107 +6943,6 @@
"primary_key": "((user_id), created_at)",
"options": "CLUSTERING ORDER BY (created_at DESC)"
},
- {
- "name": "phone_lookup_cache",
- "columns": [
- {
- "name": "phone",
- "type": "text"
- },
- {
- "name": "looked_up_at",
- "type": "timestamp"
- },
- {
- "name": "valid",
- "type": "boolean"
- },
- {
- "name": "line_type",
- "type": "text"
- },
- {
- "name": "country_code",
- "type": "text"
- },
- {
- "name": "carrier_name",
- "type": "text"
- },
- {
- "name": "sms_pumping_risk_score",
- "type": "int"
- }
- ],
- "primary_key": "(phone)",
- "options": "default_time_to_live = 604800 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'HOURS', 'compaction_window_size': '6'}"
- },
- {
- "name": "phone_tokens",
- "columns": [
- {
- "name": "token_",
- "type": "text"
- },
- {
- "name": "phone",
- "type": "text"
- },
- {
- "name": "user_id",
- "type": "bigint"
- }
- ],
- "primary_key": "(token_)",
- "options": "default_time_to_live = 2592000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '1'}"
- },
- {
- "name": "phone_verification_attempts",
- "columns": [
- {
- "name": "attempt_id",
- "type": "uuid"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "phone",
- "type": "text"
- },
- {
- "name": "country_code",
- "type": "text"
- },
- {
- "name": "line_type",
- "type": "text"
- },
- {
- "name": "carrier_name",
- "type": "text"
- },
- {
- "name": "sms_pumping_risk_score",
- "type": "int"
- },
- {
- "name": "verdict",
- "type": "text"
- },
- {
- "name": "reject_reason",
- "type": "text"
- },
- {
- "name": "lookup_cache_hit",
- "type": "boolean"
- }
- ],
- "primary_key": "(attempt_id)",
- "options": "default_time_to_live = 7776000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '3'}"
- },
{
"name": "pinned_dms",
"columns": [
@@ -7378,496 +7166,100 @@
"options": "CLUSTERING ORDER BY (message_id DESC) AND default_time_to_live = 604800 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'HOURS', 'compaction_window_size': '6'}"
},
{
- "name": "registration_events_by_email_domain",
+ "name": "relationships",
"columns": [
{
- "name": "email_domain",
- "type": "text"
+ "name": "source_user_id",
+ "type": "bigint"
},
{
- "name": "created_at",
- "type": "timestamp"
+ "name": "target_user_id",
+ "type": "bigint"
},
{
- "name": "user_id",
- "type": "bigint"
+ "name": "type",
+ "type": "int"
},
{
- "name": "ip",
+ "name": "nickname",
"type": "text"
},
{
- "name": "email",
- "type": "text"
+ "name": "since",
+ "type": "timestamp"
},
{
- "name": "locale",
- "type": "text"
+ "name": "version",
+ "type": "int"
+ },
+ {
+ "name": "share_voice_activity",
+ "type": "boolean"
}
],
- "primary_key": "(email_domain, created_at, user_id)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC) AND default_time_to_live = 2592000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '1'}"
+ "primary_key": "((source_user_id), target_user_id, type)",
+ "options": ""
},
{
- "name": "registration_events_by_ip",
+ "name": "relationships_by_target",
"columns": [
{
- "name": "ip",
- "type": "text"
+ "name": "target_user_id",
+ "type": "bigint"
},
{
- "name": "created_at",
- "type": "timestamp"
+ "name": "source_user_id",
+ "type": "bigint"
},
{
- "name": "user_id",
- "type": "bigint"
+ "name": "type",
+ "type": "int"
},
{
- "name": "email",
+ "name": "nickname",
"type": "text"
},
{
- "name": "email_domain",
- "type": "text"
+ "name": "since",
+ "type": "timestamp"
},
{
- "name": "locale",
- "type": "text"
+ "name": "version",
+ "type": "int"
+ },
+ {
+ "name": "share_voice_activity",
+ "type": "boolean"
}
],
- "primary_key": "(ip, created_at, user_id)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC) AND default_time_to_live = 2592000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '1'}"
+ "primary_key": "((target_user_id), source_user_id, type)",
+ "options": "CLUSTERING ORDER BY (source_user_id ASC, type ASC)"
},
{
- "name": "registration_events_by_plus_address_base",
+ "name": "saved_messages",
"columns": [
- {
- "name": "plus_address_base",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
{
"name": "user_id",
"type": "bigint"
},
{
- "name": "ip",
- "type": "text"
+ "name": "channel_id",
+ "type": "bigint"
},
{
- "name": "email",
- "type": "text"
+ "name": "message_id",
+ "type": "bigint"
},
{
- "name": "locale",
- "type": "text"
+ "name": "saved_at",
+ "type": "timestamp"
}
],
- "primary_key": "(plus_address_base, created_at, user_id)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC) AND default_time_to_live = 2592000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '1'}"
+ "primary_key": "((user_id), message_id)",
+ "options": "CLUSTERING ORDER BY (message_id DESC)"
},
{
- "name": "registration_events_by_subnet",
- "columns": [
- {
- "name": "subnet",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "ip",
- "type": "text"
- },
- {
- "name": "email",
- "type": "text"
- },
- {
- "name": "email_domain",
- "type": "text"
- },
- {
- "name": "locale",
- "type": "text"
- }
- ],
- "primary_key": "(subnet, created_at, user_id)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC) AND default_time_to_live = 2592000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '1'}"
- },
- {
- "name": "relationships",
- "columns": [
- {
- "name": "source_user_id",
- "type": "bigint"
- },
- {
- "name": "target_user_id",
- "type": "bigint"
- },
- {
- "name": "type",
- "type": "int"
- },
- {
- "name": "nickname",
- "type": "text"
- },
- {
- "name": "since",
- "type": "timestamp"
- },
- {
- "name": "version",
- "type": "int"
- },
- {
- "name": "share_voice_activity",
- "type": "boolean"
- }
- ],
- "primary_key": "((source_user_id), target_user_id, type)",
- "options": ""
- },
- {
- "name": "relationships_by_target",
- "columns": [
- {
- "name": "target_user_id",
- "type": "bigint"
- },
- {
- "name": "source_user_id",
- "type": "bigint"
- },
- {
- "name": "type",
- "type": "int"
- },
- {
- "name": "nickname",
- "type": "text"
- },
- {
- "name": "since",
- "type": "timestamp"
- },
- {
- "name": "version",
- "type": "int"
- },
- {
- "name": "share_voice_activity",
- "type": "boolean"
- }
- ],
- "primary_key": "((target_user_id), source_user_id, type)",
- "options": "CLUSTERING ORDER BY (source_user_id ASC, type ASC)"
- },
- {
- "name": "risk_assessments",
- "columns": [
- {
- "name": "assessment_id",
- "type": "uuid"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "ip",
- "type": "text"
- },
- {
- "name": "email",
- "type": "text"
- },
- {
- "name": "locale",
- "type": "text"
- },
- {
- "name": "risk_level",
- "type": "text"
- },
- {
- "name": "risk_score",
- "type": "int"
- },
- {
- "name": "suspicious",
- "type": "boolean"
- },
- {
- "name": "method",
- "type": "text"
- },
- {
- "name": "recommended_action",
- "type": "text"
- },
- {
- "name": "reasoning",
- "type": "text"
- },
- {
- "name": "signals_json",
- "type": "text"
- },
- {
- "name": "model_used",
- "type": "text"
- }
- ],
- "primary_key": "(assessment_id)",
- "options": ""
- },
- {
- "name": "risk_assessments_by_user",
- "columns": [
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "assessment_id",
- "type": "uuid"
- },
- {
- "name": "risk_level",
- "type": "text"
- },
- {
- "name": "risk_score",
- "type": "int"
- }
- ],
- "primary_key": "(user_id, created_at)",
- "options": "CLUSTERING ORDER BY (created_at DESC)"
- },
- {
- "name": "risk_outcomes_by_asn",
- "columns": [
- {
- "name": "asn",
- "type": "int"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "outcome_code",
- "type": "text"
- },
- {
- "name": "source",
- "type": "text"
- }
- ],
- "primary_key": "(asn, created_at, user_id, outcome_code)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC, outcome_code ASC) AND default_time_to_live = 15552000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '7'}"
- },
- {
- "name": "risk_outcomes_by_email_domain",
- "columns": [
- {
- "name": "email_domain",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "outcome_code",
- "type": "text"
- },
- {
- "name": "source",
- "type": "text"
- }
- ],
- "primary_key": "(email_domain, created_at, user_id, outcome_code)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC, outcome_code ASC) AND default_time_to_live = 15552000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '7'}"
- },
- {
- "name": "risk_outcomes_by_ip",
- "columns": [
- {
- "name": "ip",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "outcome_code",
- "type": "text"
- },
- {
- "name": "source",
- "type": "text"
- }
- ],
- "primary_key": "(ip, created_at, user_id, outcome_code)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC, outcome_code ASC) AND default_time_to_live = 15552000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '7'}"
- },
- {
- "name": "risk_outcomes_by_subnet",
- "columns": [
- {
- "name": "subnet",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "outcome_code",
- "type": "text"
- },
- {
- "name": "source",
- "type": "text"
- }
- ],
- "primary_key": "(subnet, created_at, user_id, outcome_code)",
- "options": "CLUSTERING ORDER BY (created_at DESC, user_id ASC, outcome_code ASC) AND default_time_to_live = 15552000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '7'}"
- },
- {
- "name": "saved_messages",
- "columns": [
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "channel_id",
- "type": "bigint"
- },
- {
- "name": "message_id",
- "type": "bigint"
- },
- {
- "name": "saved_at",
- "type": "timestamp"
- }
- ],
- "primary_key": "((user_id), message_id)",
- "options": "CLUSTERING ORDER BY (message_id DESC)"
- },
- {
- "name": "suspicious_email_domains",
- "columns": [
- {
- "name": "domain",
- "type": "text"
- }
- ],
- "primary_key": "(domain)",
- "options": ""
- },
- {
- "name": "suspicious_ips",
- "columns": [
- {
- "name": "ip",
- "type": "text"
- },
- {
- "name": "created_at",
- "type": "timestamp"
- },
- {
- "name": "updated_at",
- "type": "timestamp"
- },
- {
- "name": "expires_at",
- "type": "timestamp"
- },
- {
- "name": "source",
- "type": "text"
- },
- {
- "name": "reason",
- "type": "text"
- },
- {
- "name": "source_user_id",
- "type": "bigint"
- },
- {
- "name": "deletion_reason_code",
- "type": "int"
- },
- {
- "name": "provider_name",
- "type": "text"
- },
- {
- "name": "asn",
- "type": "int"
- },
- {
- "name": "asn_name",
- "type": "text"
- },
- {
- "name": "asn_type",
- "type": "text"
- },
- {
- "name": "risk_note",
- "type": "text"
- }
- ],
- "primary_key": "(ip)",
- "options": "default_time_to_live = 15552000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '7'}"
- },
- {
- "name": "user_connections",
+ "name": "user_connections",
"columns": [
{
"name": "user_id",
@@ -7984,29 +7376,6 @@
"primary_key": "((user_id), event_id)",
"options": "CLUSTERING ORDER BY (event_id DESC)"
},
- {
- "name": "user_country_history",
- "columns": [
- {
- "name": "user_id",
- "type": "bigint"
- },
- {
- "name": "country",
- "type": "text"
- },
- {
- "name": "first_seen_at",
- "type": "timestamp"
- },
- {
- "name": "last_seen_at",
- "type": "timestamp"
- }
- ],
- "primary_key": "(user_id, country)",
- "options": "default_time_to_live = 31536000 AND gc_grace_seconds = 864000 AND compaction = {'class': 'TimeWindowCompactionStrategy', 'compaction_window_unit': 'DAYS', 'compaction_window_size': '14'}"
- },
{
"name": "user_dm_history",
"columns": [
@@ -8638,6 +8007,14 @@
"name": "deletion_audit_log_reason",
"type": "text"
},
+ {
+ "name": "deletion_scheduled_by",
+ "type": "bigint"
+ },
+ {
+ "name": "deletion_scheduled_at",
+ "type": "timestamp"
+ },
{
"name": "first_refund_at",
"type": "timestamp"