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/features/nostrlogin.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/features/nostrlogin.js')
| -rw-r--r-- | src/features/nostrlogin.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/features/nostrlogin.js b/src/features/nostrlogin.js index 503384f..1d78b39 100644 --- a/src/features/nostrlogin.js +++ b/src/features/nostrlogin.js @@ -311,7 +311,7 @@ export function nostrLoginFeature(ctx) { // "Sign in with Google" — pomegranate: the code (and its FROST dealer) // rides in a lazy chunk, so the popup must open HERE, inside the click's // user activation, and the module navigates it once loaded. - async function googleLogin(run) { + async function googleLogin(run, central = null) { const popup = window.open('about:blank', 'OAuth', 'width=600,height=600'); ui.nostrLoginError = ''; // no status narration — a quiet spinner on the button itself is the whole @@ -320,7 +320,7 @@ export function nostrLoginFeature(ctx) { busy(true); try { const pome = await import('../pomegranate.js'); - const { uri } = await pome.loginWithGoogle(popup); + const { uri } = await pome.loginWithGoogle(popup, { central }); await run(() => bunkerSigner(uri, { onAuth: (url) => { ui.nostrLoginAuthUrl = url; render(); } })); } catch (e) { try { popup && popup.close(); } catch {} @@ -375,6 +375,12 @@ export function nostrLoginFeature(ctx) { // Google + passkey, with their transient status rows — shared between the // collapsed front-door card and the expanded signer list. + // Google accounts live per pomegranate central. coinos runs its own + // (auth.coinos.io); whoever signed in while auth.njump.me was the default + // still has a door to it. Mirrors pomegranate.js's CENTRALS (that module + // is a lazy chunk, so the two strings live here too). + const GOOGLE_CENTRAL = 'https://auth.njump.me'; // flip to auth.coinos.io with pomegranate.js DEFAULT_CENTRAL + const GOOGLE_LEGACY = 'https://auth.njump.me'; function externalButtons(run, big = false) { const hasPasskey = typeof window !== 'undefined' && !!window.PublicKeyCredential && !!navigator.credentials; const pad = big ? 'padding:14px' : ''; @@ -382,6 +388,9 @@ export function nostrLoginFeature(ctx) { h('button', { class: 'btn-block', style: pad, disabled: ui.nostrLoginBusy, onClick: () => googleLogin(run) }, markedLabel(GOOGLE_MARK, t('nlGoogle'), ui.nostrLoginVia === 'google')), + GOOGLE_CENTRAL !== GOOGLE_LEGACY + ? h('button', { class: 'linklike small', style: 'align-self:center', disabled: ui.nostrLoginBusy, onClick: () => googleLogin(run, GOOGLE_LEGACY) }, t('nlGooglePrev')) + : null, hasPasskey ? h('button', { class: 'btn-block', style: pad, disabled: ui.nostrLoginBusy, onClick: () => passkeyLogin(run) }, markedLabel(PASSKEY_MARK, t('nlPasskey'), ui.nostrLoginVia === 'passkey')) |
