diff --git a/lib/configStorageTypes.ts b/lib/configStorageTypes.ts index e04fc9a..ce072cb 100644 --- a/lib/configStorageTypes.ts +++ b/lib/configStorageTypes.ts @@ -42,7 +42,7 @@ export const DEFAULT_NIP95_APIS: Nip95Config[] = [ { id: 'nostrimg', url: 'https://nostrimg.com/api/upload', - enabled: true, + enabled: false, // Disabled by default due to server errors (500) priority: 1, createdAt: Date.now(), }, diff --git a/lib/nip95.ts b/lib/nip95.ts index eace907..e9b7a2f 100644 --- a/lib/nip95.ts +++ b/lib/nip95.ts @@ -1,6 +1,8 @@ import type { MediaRef } from '@/types/nostr' import { getEnabledNip95Apis } from './config' import { generateNip98Token, isNip98Available } from './nip98' +import { nostrService } from './nostr' +import { nostrAuthService } from './nostrAuth' const MAX_IMAGE_BYTES = 5 * 1024 * 1024 const MAX_VIDEO_BYTES = 45 * 1024 * 1024 @@ -131,7 +133,15 @@ export async function uploadNip95Media(file: File): Promise { if (needsAuth) { if (!isNip98Available()) { - console.warn('NIP-98 authentication required for nostrcheck.me but not available. Skipping endpoint.') + const pubkey = nostrService.getPublicKey() + const isUnlocked = nostrAuthService.isUnlocked() + if (!pubkey) { + console.warn('NIP-98 authentication required for nostrcheck.me but no account found. Please create or import an account.') + } else if (!isUnlocked) { + console.warn('NIP-98 authentication required for nostrcheck.me but account is not unlocked. Please unlock your account with your recovery phrase to use this endpoint.') + } else { + console.warn('NIP-98 authentication required for nostrcheck.me but not available. Skipping endpoint.') + } continue } try {