Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from "$env/static/public";
import { Hero } from "$lib/fragments";
import { GlobalState } from "$lib/global";
import NotificationService from "$lib/services/NotificationService";
import { pendingRecovery } from "$lib/stores/pendingRecovery";
import { ButtonAction } from "$lib/ui";
import { capitalize, getCanonicalBindingDocString } from "$lib/utils";
Expand All @@ -19,9 +18,6 @@ import { Shadow } from "svelte-loading-spinners";
import { v4 as uuidv4 } from "uuid";
import { provision } from "wallet-sdk";

let pushToken = $state<string | undefined>(undefined);
let pushTokenError = $state<string | undefined>(undefined);
let pushTokenLoading = $state(true);
const ANONYMOUS_VERIFICATION_CODE = "d66b7138-538a-465f-a6ce-f6985854c3f4";
const KEY_ID = "default";

Expand Down Expand Up @@ -735,18 +731,6 @@ const handleEnamePassphraseRecovery = async () => {
};

onMount(async () => {
// Fetch push notification token for display (Android/iOS)
try {
pushToken = await NotificationService.getInstance().getPushToken();
if (!pushToken)
pushTokenError = "No token (desktop or permission denied)";
} catch (e) {
pushTokenError =
e instanceof Error ? e.message : "Failed to get push token";
} finally {
pushTokenLoading = false;
}

// Detect upgrade mode from query param
const url = new URL(window.location.href);
if (url.searchParams.get("upgrade") === "1") {
Expand All @@ -762,16 +746,6 @@ onMount(async () => {
class="min-h-svh px-[5vw] flex flex-col justify-between"
style="padding-top: max(4svh, env(safe-area-inset-top)); padding-bottom: max(16px, env(safe-area-inset-bottom));"
>
<section class="mb-4 p-2 rounded bg-gray-100 text-xs">
<p class="font-medium text-gray-600 mb-1">Push token (FCM/APNs):</p>
{#if pushTokenLoading}
<span class="text-gray-500">Loading...</span>
{:else if pushToken}
<code class="block break-all text-gray-800">{pushToken}</code>
{:else}
<span class="text-amber-600">{pushTokenError ?? "—"}</span>
{/if}
</section>
<article class="flex justify-center mb-4">
<img
class="w-[88vw] h-[39svh]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@ export class BindingDocumentService {
const expectedHash = computeBindingDocumentHash(docToVerify);
const hasLegacyHashSignature = input.ownerSignature.signature === expectedHash;
const isProvisionerSigner = /^https?:\/\//.test(input.ownerSignature.signer);

const hasValidUserSignature =
!hasLegacyHashSignature &&
!isProvisionerSigner &&
Expand All @@ -228,6 +229,7 @@ export class BindingDocumentService {
input.ownerSignature.signature,
docToVerify,
));

if (!hasLegacyHashSignature && !isProvisionerSigner && !hasValidUserSignature) {
throw new ValidationError("Invalid owner signature");
}
Expand Down
Loading