logseq / logseq/db-test

CLI custom sync http-base unexpectedly replaces the default OAuth endpoint base

Open
#1,055 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
No language data
Stars
28
Forks
2
PR merge metrics
No merged PRs in 30d

Description

Search first
  • I searched open and closed issues for custom sync OAuth, http-base, and Cognito endpoint behavior.
What happened?

Setting a custom CLI sync http-base also changes the implicit OAuth endpoint base. Without explicit OAuth overrides, logseq login derives authorize and token routes under the custom sync origin, for example:

https://<custom-sync-origin>/oauth2/authorize
https://<custom-sync-origin>/oauth2/token

A standard self-hosted DB Sync worker exposes graph, asset, E2EE, and sync routes, but does not expose these OAuth routes. Login or token refresh therefore fails unless users manually add all Cognito endpoint overrides to cli.edn.

Required workaround:

{:http-base "https://<custom-sync-origin>"
 :ws-url "wss://<custom-sync-origin>/sync/%s"
 :oauth-authorize-endpoint "https://<identity-provider>/oauth2/authorize"
 :oauth-token-endpoint "https://<identity-provider>/oauth2/token"
 :oauth-logout-endpoint "https://<identity-provider>/logout"}

This is especially easy to miss because initial login and later refresh depend on different OAuth routes.

Reproduce
  1. Configure only a custom :http-base and :ws-url for a self-hosted DB Sync worker.
  2. Run logseq login or allow an existing token to require refresh.
  3. Observe the derived authorize or token URL.
Expected behavior

Sync transport endpoints and identity-provider endpoints should have independent defaults. Setting http-base should not replace the built-in OAuth provider unless explicit OAuth endpoint configuration requests that behavior.

Platform
  • Current CLI repository build
  • Self-hosted DB Sync worker
  • Cognito authentication

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the CLI configuration handling for :http-base and the OAuth endpoint defaults used by logseq login and token refresh. Reproduce the issue with the listed http-base and ws-url settings, then verify that sync routes still use the custom origin while authorize, token, and logout routes retain their identity-provider defaults.

Written by the indexing model from the issue text.

Assessment

Tech stack
clojure
Domain
authentication, cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.