Skip to content

feat: add a server region setting for region-locked Cloud accounts - #25

Open
pgebheim wants to merge 1 commit into
raaneem:mainfrom
lilco-dev:pr/region-setting
Open

pgebheim wants to merge 1 commit into
raaneem:mainfrom
lilco-dev:pr/region-setting

Conversation

@pgebheim

Copy link
Copy Markdown

Server region setting for region-locked Cloud accounts

Supernote Cloud runs regional deployments and accounts are locked to one. This
adds a Server region setting (International / China) so users on
region-locked accounts can point the plugin at their region's servers.

  • Cloud client: CLOUD_REGION_BASE_URLS + setRegion() repoints the base URL
    and drops the per-host CSRF token.
  • Switching region signs out (a Cloud token belongs to one deployment).
  • A region dropdown in the setup flow, shown before sign-in.

Test plan: pnpm test — default + China request-URL tests added; full suite
green.


Extracted from the
Supernote Sync & Transcribe
fork.

Supernote Cloud runs regional deployments and accounts are locked to one.
Add a cloudRegion setting (international or China) so users can point the
plugin at their region's servers.

- cloud client: CLOUD_REGION_BASE_URLS + setRegion() repoints the base URL
  and drops the per-host CSRF token
- main: cloudRegion setting (default international, validated on load);
  switching region signs out, since a token belongs to one deployment
- setup flow: Server region dropdown shown before sign-in
- tests: default + China request URLs; settings factory gains cloudRegion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant