diff options
| author | Adam Soltys <[email protected]> | 2026-09-21 12:16:17 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-21 12:16:17 -0700 |
| commit | 8dbbe74b2bf9714370197816928c93fe3a34cbd4 (patch) | |
| tree | d87182c0c85d2cbdc08215c99d1ad676ecfd37f1 /src/pomegranate.js | |
| parent | 5c84bced9f4577352f9377551991747f529193c2 (diff) | |
| download | coinosv3-8dbbe74b2bf9714370197816928c93fe3a34cbd4.tar.gz coinosv3-8dbbe74b2bf9714370197816928c93fe3a34cbd4.zip | |
Seed words read down each column; the Google central is a parameter with a door to the previous one.
Word grids flow down a column then the next, with the row count from the
word count — on a phone the first column is 1–6, the way a hand copies a
list. pomegranate.js takes the central as an option (CENTRALS.coinos is
auth.coinos.io, now deployed; the default stays auth.njump.me until its
Google client is live), and the sign-in card grows a "previous server"
line once the default moves, so accounts made under njump keep working.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Tmfg8k5f3TbNJS34qiqHAp
Diffstat (limited to 'src/pomegranate.js')
| -rw-r--r-- | src/pomegranate.js | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/pomegranate.js b/src/pomegranate.js index 59a1d3b..e86b650 100644 --- a/src/pomegranate.js +++ b/src/pomegranate.js @@ -19,7 +19,13 @@ import { hex } from '@scure/base'; import { finalizeEvent, generateSecretKey } from 'nostr-tools/pure'; import { hexPubShard, hexShard, trustedKeyDeal } from '@jsr/fiatjaf__promenade-trusted-dealer'; -export const CENTRAL = 'https://auth.njump.me'; +// Which central: coinos runs its own (auth.coinos.io — the Google consent +// screen and the bunker relay carry our name), but accounts live PER +// central, so anyone who signed in while auth.njump.me was the default +// keeps a door to it (see nostrlogin's "previous server" line). +export const CENTRALS = { coinos: 'https://auth.coinos.io', legacy: 'https://auth.njump.me' }; +export const DEFAULT_CENTRAL = CENTRALS.legacy; // flip to CENTRALS.coinos once its Google client is live +let CENTRAL = DEFAULT_CENTRAL; const OPERATORS = [ 'https://po.f7z.io', 'https://po.coracle.social', @@ -147,8 +153,10 @@ async function bunkerUri(token) { } // The whole flow: authenticate, find-or-create the sharded account, hand back -// a bunker URI. `popup` must come from the caller's click handler. -export async function loginWithGoogle(popup, { onStatus } = {}) { +// a bunker URI. `popup` must come from the caller's click handler; `central` +// picks the server (default: DEFAULT_CENTRAL). +export async function loginWithGoogle(popup, { onStatus, central } = {}) { + CENTRAL = central || DEFAULT_CENTRAL; const token = await authenticate(popup); const email = emailOf(token); if (!email) throw new Error('Google login returned no email'); |
