feat: Enhance authentication and user management with detailed logging
- Add console logging for authentication initialization, login attempts, and user retrieval to improve debugging and traceability. - Introduce a new getCurrentUser function in useAuth for better user data management. - Update useTicketPurchase to include detailed logging for user wallets and balance checks, enhancing visibility into wallet states. - Refactor LNBits API request and response logging for clearer error handling and debugging.
This commit is contained in:
parent
217ca70334
commit
0cc0bf3555
4 changed files with 75 additions and 44 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import type { Event, Ticket } from '../types/event'
|
||||
import type { Event, EventsApiError, Ticket } from '../types/event'
|
||||
import { config } from '@/lib/config'
|
||||
import { lnbitsAPI } from './lnbits'
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ export async function purchaseTicket(eventId: string): Promise<{ payment_hash: s
|
|||
}
|
||||
}
|
||||
|
||||
export async function payInvoiceWithWallet(paymentRequest: string, _walletId: string, adminKey: string): Promise<{ payment_hash: string; fee_msat: number; preimage: string }> {
|
||||
export async function payInvoiceWithWallet(paymentRequest: string, walletId: string, adminKey: string): Promise<{ payment_hash: string; fee_msat: number; preimage: string }> {
|
||||
try {
|
||||
const response = await fetch(
|
||||
`${API_BASE_URL}/api/v1/payments`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue