From 1dc0c4119bc89c4f4767a4701865fb7031fd572d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A2u=20Cao?= Date: Mon, 20 Apr 2026 12:34:44 +0400 Subject: [PATCH] Refactor Nostr auth service --- app/components/nostr-connect.gjs | 4 +- app/components/user-menu.gjs | 2 +- app/services/nostr-auth.js | 223 ++++++++++++++++--------------- 3 files changed, 117 insertions(+), 112 deletions(-) diff --git a/app/components/nostr-connect.gjs b/app/components/nostr-connect.gjs index 818fbf6..19194ee 100644 --- a/app/components/nostr-connect.gjs +++ b/app/components/nostr-connect.gjs @@ -15,7 +15,7 @@ export default class NostrConnectComponent extends Component { @action async connectExtension() { try { - await this.nostrAuth.login('extension'); + await this.nostrAuth.connectWithExtension(); if (this.args.onConnect) { this.args.onConnect(); } @@ -28,7 +28,7 @@ export default class NostrConnectComponent extends Component { @action async connectApp() { try { - await this.nostrAuth.login('connect'); + await this.nostrAuth.connectWithApp(); if (this.args.onConnect) { this.args.onConnect(); } diff --git a/app/components/user-menu.gjs b/app/components/user-menu.gjs index da3fec6..93be100 100644 --- a/app/components/user-menu.gjs +++ b/app/components/user-menu.gjs @@ -48,7 +48,7 @@ export default class UserMenuComponent extends Component { @action disconnectNostr() { - this.nostrAuth.logout(); + this.nostrAuth.disconnect(); }