Browse Source

bug-fixes

master
Silberengel 1 month ago
parent
commit
186f9b95d5
  1. 4
      public/healthz.json
  2. 5
      src/lib/services/auth/session-manager.ts
  3. 2
      src/routes/login/+page.svelte

4
public/healthz.json

@ -2,7 +2,7 @@ @@ -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
}

5
src/lib/services/auth/session-manager.ts

@ -5,8 +5,6 @@ @@ -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 { @@ -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 { @@ -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');

2
src/routes/login/+page.svelte

@ -4,7 +4,6 @@ @@ -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 @@ @@ -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();

Loading…
Cancel
Save