diff --git a/src/app/components/KeyDownload.svelte b/src/app/components/KeyDownload.svelte new file mode 100644 index 00000000..f42d6203 --- /dev/null +++ b/src/app/components/KeyDownload.svelte @@ -0,0 +1,165 @@ + + +
+ + {#snippet title()} +
Your Keys are Ready!
+ {/snippet} +
+

+ A cryptographic key pair has two parts: your public key identifies your + account, while your private key acts sort of like a master password. +

+

+ Securing your private key is very important, so make sure to take the time to save your key in a + secure place (like a password manager). +

+ {#if usePassword} + + {#snippet label()} + Password* + {/snippet} + {#snippet input()} + + {/snippet} + {#snippet info()} +

Passwords should be at least 12 characters long. Write this down!

+ {/snippet} +
+ {/if} +
+ + +
+ + + + +
diff --git a/src/app/components/KeyRecovery.svelte b/src/app/components/KeyRecovery.svelte new file mode 100644 index 00000000..12bfcaf4 --- /dev/null +++ b/src/app/components/KeyRecovery.svelte @@ -0,0 +1,141 @@ + + +
+ + {#snippet title()} + Recover your Key + {/snippet} + {#snippet info()} + Take control over your cryptographic identity + {/snippet} + + {#if sent} +

+ Your recovery codes have been sent! +

+

+ For security reasons, you may receive three or more emails with recovery codes in them. Please paste all + recovery codes into the text box below, on separate lines. +

+ + {:else} +

+ When you signed up, your Nostr secret key was split into multiple pieces and stored on separate + third-party servers to keep it safe. +

+

+ If you're ready to take control of your cryptographic identity, click below. We'll confirm your + email by sending you some recovery codes. +

+ {/if} + + + {#if sent} + + {:else} + + {/if} + +
diff --git a/src/app/components/LogInEmail.svelte b/src/app/components/LogInEmail.svelte index 8764af55..b1d1f4a4 100644 --- a/src/app/components/LogInEmail.svelte +++ b/src/app/components/LogInEmail.svelte @@ -46,7 +46,7 @@ const {clientOptions, ...res} = await Client.selectLogin(clientSecret, client, peers) if (res.ok && clientOptions) { - loginWithPomade(clientOptions.group.group_pk.slice(2), clientOptions) + loginWithPomade(clientOptions.group.group_pk.slice(2), email, clientOptions) pushToast({message: "Successfully logged in!"}) setChecked("*") clearModals() diff --git a/src/app/components/LogInOTPConfirm.svelte b/src/app/components/LogInOTPConfirm.svelte index 6f7d6838..c73e4cae 100644 --- a/src/app/components/LogInOTPConfirm.svelte +++ b/src/app/components/LogInOTPConfirm.svelte @@ -46,7 +46,7 @@ const {clientOptions, ...res} = await Client.selectLogin(clientSecret, client, peers) if (res.ok && clientOptions) { - loginWithPomade(clientOptions.group.group_pk.slice(2), clientOptions) + loginWithPomade(clientOptions.group.group_pk.slice(2), email, clientOptions) pushToast({message: "Successfully logged in!"}) setChecked("*") clearModals() diff --git a/src/app/components/SignUpEmailConfirm.svelte b/src/app/components/SignUpEmailConfirm.svelte index 4f72860a..c2f484f2 100644 --- a/src/app/components/SignUpEmailConfirm.svelte +++ b/src/app/components/SignUpEmailConfirm.svelte @@ -35,7 +35,7 @@ await sleep(800) try { - loginWithPomade(clientOptions.group.group_pk.slice(2), clientOptions) + loginWithPomade(clientOptions.group.group_pk.slice(2), email, clientOptions) pushToast({message: "Successfully logged in!"}) initProfile(profile) setChecked("*") diff --git a/src/app/components/SignUpKey.svelte b/src/app/components/SignUpKey.svelte index 3b67b1d0..09daded2 100644 --- a/src/app/components/SignUpKey.svelte +++ b/src/app/components/SignUpKey.svelte @@ -1,168 +1,17 @@ -
- - {#snippet title()} -
Your Keys are Ready!
- {/snippet} -
-

- A cryptographic key pair has two parts: your public key identifies your - account, while your private key acts sort of like a master password. -

-

- Securing your private key is very important, so make sure to take the time to save your key in a - secure place (like a password manager). -

- {#if usePassword} - - {#snippet label()} - Password* - {/snippet} - {#snippet input()} - - {/snippet} - {#snippet info()} -

Passwords should be at least 12 characters long. Write this down!

- {/snippet} -
- {/if} -
- - -
- - - - -
+ diff --git a/src/app/components/SignerStatus.svelte b/src/app/components/SignerStatus.svelte index 626051f9..cb9b22a8 100644 --- a/src/app/components/SignerStatus.svelte +++ b/src/app/components/SignerStatus.svelte @@ -60,6 +60,8 @@ {$session.signer} {:else if $session.method === SessionMethod.Pubkey} public key (readonly) + {:else if $session.method === SessionMethod.Pomade} + email and password {/if}

@@ -69,7 +71,7 @@ {#if isDisconnected} - {:else if $session?.method === SessionMethod.Pomade} + {:else} {/if} diff --git a/src/app/core/sync.ts b/src/app/core/sync.ts index 8adc6998..c0c7f733 100644 --- a/src/app/core/sync.ts +++ b/src/app/core/sync.ts @@ -1,7 +1,7 @@ import {page} from "$app/stores" import type {Unsubscriber} from "svelte/store" import {derived, get} from "svelte/store" -import {partition, call, sortBy, assoc, chunk, sleep, identity, WEEK, ago} from "@welshman/lib" +import {partition, call, sortBy, assoc, dissoc, chunk, sleep, identity, WEEK, ago} from "@welshman/lib" import { getListTags, getRelayTagValues, @@ -94,7 +94,7 @@ const pullAndListen = ({relays, filters, signal}: PullOpts) => { request({ relays, signal, - filters: unionFilters(filters).map(assoc("limit", 0)), + filters: unionFilters(filters.map(dissoc('limit'))).map(assoc("limit", 0)), }) } diff --git a/src/routes/settings/profile/+page.svelte b/src/routes/settings/profile/+page.svelte index 32b36899..28f84905 100644 --- a/src/routes/settings/profile/+page.svelte +++ b/src/routes/settings/profile/+page.svelte @@ -2,7 +2,7 @@ import * as nip19 from "nostr-tools/nip19" import {hexToBytes} from "@welshman/lib" import {displayPubkey, displayProfile} from "@welshman/util" - import {pubkey, session, displayNip05, deriveProfile} from "@welshman/app" + import {pubkey, session, displayNip05, deriveProfile, SessionMethod} from "@welshman/app" import {slideAndFade} from "@lib/transition" import PenNewSquare from "@assets/icons/pen-new-square.svg?dataurl" import UserRounded from "@assets/icons/user-rounded.svg?dataurl" @@ -20,6 +20,7 @@ import ContentMinimal from "@app/components/ContentMinimal.svelte" import ProfileEdit from "@app/components/ProfileEdit.svelte" import ProfileDelete from "@app/components/ProfileDelete.svelte" + import KeyRecovery from "@app/components/KeyRecovery.svelte" import SignerStatus from "@app/components/SignerStatus.svelte" import InfoKeys from "@app/components/InfoKeys.svelte" import {PLATFORM_NAME} from "@app/core/state" @@ -40,6 +41,8 @@ const startDelete = () => pushModal(ProfileDelete) + const startRecovery = () => pushModal(KeyRecovery) + let showAdvanced = false @@ -156,7 +159,13 @@ {#if showAdvanced}

- + {/if} +