Return 0 when no machines exist instead of throwing an error.
This fixes the authentication error on fresh installations where
the machines table is empty.
The GET_USER_DATA query includes restrictionLevel which has @auth directive.
This was causing authentication errors on /register and /login pages where
users are not yet authenticated.
Solution:
- Skip the GraphQL query when on public pages (/register or /login)
- Use useEffect to set loading=false immediately for public pages
- Add onError handler to gracefully handle query failures
Fixes authentication error: 'Message: Authentication failed, Path: restrictionLevel'
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Updates the newFunding function to return the expected interface:
- fundingPendingBalance: BN(0) for Lightning Network
- fundingConfirmedBalance: actual wallet balance as BN object
- fundingAddress: bolt11 invoice for funding
This fixes the TypeError "Cannot read properties of undefined (reading
'minus')"
that occurred when accessing the funding page in the admin UI.
- Changed the response handling in the newAddress function to return the bolt11 invoice instead of the payment request.
- Updated error message to reflect the change in response structure from LNBits.
- Added a new function to handle LNURL payments, allowing users to send payments via LNURL addresses.
- Integrated LNURL payment processing into the existing sendCoins function, enhancing the wallet's capabilities for Lightning Network transactions.
- Added LNBits wallet schema to the admin UI, including validation and input components.
- Updated the services index to include LNBits in the available wallet options.
- Enhanced the wallet selection component to handle LNBits configuration input.
- Replaced SQL statements with a configuration object for LNBits settings, enhancing code clarity and maintainability.
- Simplified the migration process by utilizing the saveConfig function for applying configurations.
- Marked the down migration as a no-op to prevent breaking existing configurations.
- Updated the migration script for LNBits configuration to use an array for SQL statements, improving readability and maintainability.
- Consolidated the insertion and deletion operations for user configuration related to LNBits and Lightning Network wallet options.
- Introduced LNBits as a Lightning Network wallet provider for Lamassu ATMs.
- Added configuration options for LNBits in the environment variables.
- Implemented core functionalities including invoice creation, payment processing, balance monitoring, and payment status tracking.
- Created unit tests for the LNBits plugin to ensure functionality and error handling.
- Updated development environment setup to include LNBits configuration.