Refactor API authentication: Replace 'require_invoice_key' with 'require_admin_key' for dashboard endpoints to restrict access to admin users only. Update related frontend API calls to use 'adminkey' instead of 'inkey' for consistency.

This commit is contained in:
padreug 2025-06-26 13:18:17 +02:00
parent 74b7d0f9a3
commit c86d650e5a
2 changed files with 14 additions and 10 deletions

View file

@ -121,7 +121,7 @@ window.app = Vue.createApp({
const { data } = await LNbits.api.request(
'GET',
'/satmachineclient/api/v1/dashboard/summary',
this.g.user.wallets[0].inkey
this.g.user.wallets[0].adminkey
)
this.dashboardData = data
} catch (error) {
@ -135,7 +135,7 @@ window.app = Vue.createApp({
const { data } = await LNbits.api.request(
'GET',
'/satmachineclient/api/v1/dashboard/transactions?limit=50',
this.g.user.wallets[0].inkey
this.g.user.wallets[0].adminkey
)
// Debug: Log the first transaction to see date format
@ -232,7 +232,7 @@ window.app = Vue.createApp({
const {data} = await LNbits.api.request(
'GET',
`/satmachineclient/api/v1/dashboard/analytics?time_range=${this.chartTimeRange}`,
this.g.user.wallets[0].inkey
this.g.user.wallets[0].adminkey
)
// Debug: Log analytics data