+
-
@@ -87,6 +91,26 @@
+
+
+
Nostr Identity
+
+
+
+ Lightning Address:
+ {{ lightningAddress }}
+
+
+
+ NIP-05:
+ {{ nip05Preview }}
+
+
+
+ These identifiers are automatically derived from your username
+
+
+
{{ updateError }}
@@ -111,6 +135,34 @@
Your profile is broadcast to Nostr automatically when you save changes.
+
+
+
+
+
+
+
+
+ Log out
+
+
+
+
+ Log out of {{ user?.username || 'your account' }}?
+
+ You'll need to sign in again to access your wallet, post in the
+ forum, place orders, or use any feature that needs your account.
+
+
+
+ Cancel
+
+ Log out
+
+
+
+
+
@@ -121,7 +173,8 @@ import { toTypedSchema } from '@vee-validate/zod'
import * as z from 'zod'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
-import { User } from 'lucide-vue-next'
+import { Separator } from '@/components/ui/separator'
+import { User, Zap, Hash } from 'lucide-vue-next'
import {
FormControl,
FormDescription,
@@ -131,13 +184,27 @@ import {
FormMessage,
} from '@/components/ui/form'
import ImageUpload from './ImageUpload.vue'
+import {
+ AlertDialog,
+ AlertDialogAction,
+ AlertDialogCancel,
+ AlertDialogContent,
+ AlertDialogDescription,
+ AlertDialogFooter,
+ AlertDialogHeader,
+ AlertDialogTitle,
+ AlertDialogTrigger,
+} from '@/components/ui/alert-dialog'
+import { LogOut } from 'lucide-vue-next'
import { useAuth } from '@/composables/useAuthService'
+import { useRouter } from 'vue-router'
import { injectService, SERVICE_TOKENS } from '@/core/di-container'
import type { ImageUploadService } from '../services/ImageUploadService'
import { useToast } from '@/core/composables/useToast'
// Services
-const { user, updateProfile } = useAuth()
+const { user, updateProfile, logout } = useAuth()
+const router = useRouter()
const imageService = injectService
(SERVICE_TOKENS.IMAGE_UPLOAD_SERVICE)
const toast = useToast()
@@ -157,14 +224,14 @@ const lightningDomain = computed(() =>
import.meta.env.VITE_LIGHTNING_DOMAIN || window.location.hostname
)
-// Live preview of the user's NIP-05 / Lightning address — shown in the
-// username field's helper text so the consequence of a future rename is
-// visible inline.
+// Computed previews
const nip05Preview = computed(() => {
const username = form.values.username || currentUsername.value || 'username'
return `${username}@${lightningDomain.value}`
})
+const lightningAddress = computed(() => nip05Preview.value)
+
// Form schema
const profileFormSchema = toTypedSchema(z.object({
username: z.string()
@@ -260,4 +327,17 @@ const updateUserProfile = async (formData: any) => {
isUpdating.value = false
}
}
+
+// Log out + redirect to /login on this app's origin.
+const onLogout = async () => {
+ try {
+ await logout()
+ toast.success('Logged out')
+ router.push('/login')
+ } catch (error) {
+ const errorMessage = error instanceof Error ? error.message : 'Failed to log out'
+ console.error('Error logging out:', error)
+ toast.error(`Logout failed: ${errorMessage}`)
+ }
+}
diff --git a/src/modules/events/components/CreateEventDialog.vue b/src/modules/events/components/CreateEventDialog.vue
index 3f50231..5c9d216 100644
--- a/src/modules/events/components/CreateEventDialog.vue
+++ b/src/modules/events/components/CreateEventDialog.vue
@@ -432,7 +432,7 @@ const handleOpenChange = (open: boolean) => {
-
+
@@ -611,13 +611,9 @@ const handleOpenChange = (open: boolean) => {
fiat amounts convert at checkout using current rates.