chore: update LNBits API configuration in environment and documentation

- Added VITE_LNBITS_API_URL to .env.example for LNBits API integration.
- Updated AUTHENTICATION.md to reflect changes in LNBits base URL configuration.
- Refactored ProfileDialog.vue and config files to use VITE_LNBITS_BASE_URL instead of VITE_API_BASE_URL for API calls.
This commit is contained in:
padreug 2025-08-10 10:43:01 +02:00
parent 7bee629e6b
commit c2f11f3d96
4 changed files with 8 additions and 8 deletions

View file

@ -18,10 +18,10 @@ The authentication system has been completely replaced with a traditional userna
Create a `.env` file in the `web-app` directory with the following variables:
```env
# LNBits API Configuration
# Set this to your LNBits instance API URL
# Example: http://localhost:5000/api/v1 or https://your-lnbits-instance.com/api/v1
VITE_LNBITS_API_URL=/api/v1
# LNBits Base URL Configuration
# Set this to your LNBits instance base URL
# Example: http://localhost:5000 or https://your-lnbits-instance.com
VITE_LNBITS_BASE_URL=http://localhost:5000
# Enable debug logging for LNBits API calls
VITE_LNBITS_DEBUG=false
@ -102,7 +102,7 @@ To run the application with the new authentication system:
1. **CORS Errors**: Ensure your LNBits instance allows requests from your frontend domain
2. **Authentication Failures**: Check that username/password auth is enabled in LNBits
3. **API Connection**: Verify the `VITE_LNBITS_API_URL` is correct
3. **API Connection**: Verify the `VITE_LNBITS_BASE_URL` is correct and points to your LNBits instance (without /api/v1)
### Debug Mode

View file

@ -22,7 +22,7 @@ const emit = defineEmits<Emits>()
const userDisplay = computed(() => auth.userDisplay.value)
// Get the API base URL from environment variables
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL || ''
const apiBaseUrl = import.meta.env.VITE_LNBITS_BASE_URL || ''
function handleLogout() {
auth.logout()

View file

@ -52,7 +52,7 @@ export const config: AppConfig = {
adminPubkeys: parseJsonEnv(import.meta.env.VITE_ADMIN_PUBKEYS, [])
},
api: {
baseUrl: import.meta.env.VITE_API_BASE_URL || '',
baseUrl: import.meta.env.VITE_LNBITS_BASE_URL || '',
key: import.meta.env.VITE_API_KEY || ''
},
push: {

View file

@ -2,7 +2,7 @@
export const LNBITS_CONFIG = {
// Base URL for the LNBits API
// This should point to your LNBits instance
API_BASE_URL: import.meta.env.VITE_LNBITS_API_URL || '/api/v1',
API_BASE_URL: `${import.meta.env.VITE_LNBITS_BASE_URL || ''}/api/v1`,
// Whether to enable debug logging
DEBUG: import.meta.env.VITE_LNBITS_DEBUG === 'true',