From 186f9b95d5ed46627d717b469fd6debd411d92f8 Mon Sep 17 00:00:00 2001 From: Silberengel Date: Thu, 12 Feb 2026 18:27:36 +0100 Subject: [PATCH] bug-fixes --- public/healthz.json | 4 ++-- src/lib/services/auth/session-manager.ts | 5 +++-- src/routes/login/+page.svelte | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/public/healthz.json b/public/healthz.json index 17d6fcd..c7033d0 100644 --- a/public/healthz.json +++ b/public/healthz.json @@ -2,7 +2,7 @@ "status": "ok", "service": "aitherboard", "version": "0.3.1", - "buildTime": "2026-02-12T12:55:08.903Z", + "buildTime": "2026-02-12T17:17:48.963Z", "gitCommit": "unknown", - "timestamp": 1770900908903 + "timestamp": 1770916668963 } \ No newline at end of file diff --git a/src/lib/services/auth/session-manager.ts b/src/lib/services/auth/session-manager.ts index 32143ae..5027ce0 100644 --- a/src/lib/services/auth/session-manager.ts +++ b/src/lib/services/auth/session-manager.ts @@ -5,8 +5,6 @@ import type { NostrEvent } from '../../types/nostr.js'; import { getAnonymousKey } from '../cache/anonymous-key-store.js'; import { signEventWithAnonymous } from './anonymous-signer.js'; -import { hasNsecKey, getNcryptsec } from '../cache/nsec-key-store.js'; -import { signEventWithNsec } from './nsec-signer.js'; export type AuthMethod = 'nip07' | 'nsec' | 'anonymous'; @@ -335,6 +333,7 @@ class SessionManager { // The encrypted key is stored in IndexedDB, and password is in sessionStorage if (pubkey) { try { + const { hasNsecKey } = await import('../cache/nsec-key-store.js'); const keyExists = await hasNsecKey(pubkey); if (keyExists) { // Try to get password from sessionStorage @@ -360,6 +359,8 @@ class SessionManager { if (!session || !session.password) { throw new Error('Session password not available'); } + const { getNcryptsec } = await import('../cache/nsec-key-store.js'); + const { signEventWithNsec } = await import('./nsec-signer.js'); const ncryptsec = await getNcryptsec(pubkey); if (!ncryptsec) { throw new Error('Stored nsec key not found'); diff --git a/src/routes/login/+page.svelte b/src/routes/login/+page.svelte index cce93b8..4d21a27 100644 --- a/src/routes/login/+page.svelte +++ b/src/routes/login/+page.svelte @@ -4,7 +4,6 @@ import { onMount } from 'svelte'; import { nostrClient } from '../../lib/services/nostr/nostr-client.js'; import { nip19 } from 'nostr-tools'; - import { listNsecKeys } from '../../lib/services/cache/nsec-key-store.js'; import { sessionManager } from '../../lib/services/auth/session-manager.js'; import { page } from '$app/stores'; import Icon from '../../lib/components/ui/Icon.svelte'; @@ -74,6 +73,7 @@ async function loadStoredKeys() { try { + const { listNsecKeys } = await import('../../lib/services/cache/nsec-key-store.js'); storedNsecKeys = await listNsecKeys(); const { listAnonymousKeys } = await import('../../lib/services/cache/anonymous-key-store.js'); storedAnonymousKeys = await listAnonymousKeys();