Skip to content

KYC onboarding: pre-suggest the user's country from IP geolocation #524

@TaprootFreak

Description

@TaprootFreak

Motivation

During KYC onboarding the user fills the country pickers (CountryField): nationality and residence / address country. Today these start empty — PR #519 deliberately removed the previous hardcoded "Switzerland" auto-select because it silently registered every user as a Swiss national/resident.

A better default than "empty" or "always CH" is the country the user is actually in: derive it from the request IP and pre-suggest it.

Proposal

  • Detect the user's current country via IP geolocation and pre-suggest it in the onboarding country pickers.
  • The suggestion must stay a suggestion the user reviews, never a silent submit — IP is not nationality, and even residence can be wrong (VPN, travel). This keeps the property that made fix(kyc): filter country pickers by allow-flag, harden load states #519 necessary.

Open questions / scope

  • Data source. Prefer backend-provided detection (the API already sees the request IP) over shipping a third-party geo-IP dependency in the app — e.g. /v1/country or /v2/user could return a detected country. To be confirmed against the backend.
  • Nationality vs. residence. IP is a reasonable proxy for residence but a weak one for nationality. Consider applying the suggestion only to the residence/address field, or clearly marking the nationality suggestion as a guess.
  • Allow-flags. The suggested country must satisfy the field's allow-flag (nationalityAllowed / locationAllowed, see fix(kyc): filter country pickers by allow-flag, harden load states #519). If the detected country is not allowed for that purpose, fall back to no pre-selection.
  • Privacy. IP-based geolocation is low-sensitivity but should be noted.

Acceptance criteria

  • In KYC onboarding, the residence country picker is pre-filled with the IP-detected country when that country is allowed for residence.
  • The pre-fill is visible and editable; the user can change it before submitting.
  • If detection fails or the detected country is not allowed, the picker falls back to empty (current fix(kyc): filter country pickers by allow-flag, harden load states #519 behaviour).
  • A decision is documented on whether the nationality picker also gets a (clearly-marked) suggestion.

Related: #519

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions