fix: use check_admin for approval endpoints, not require_admin_key
Some checks failed
lint.yml / fix: use check_admin for approval endpoints, not require_admin_key (pull_request) Failing after 0s

require_admin_key only checks that the API key is a wallet admin key,
which ANY user has. check_admin verifies the user is a LNbits admin
(super_user or lnbits_admin_users). JS updated to omit API key on
admin endpoints, relying on session cookie auth instead.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-04-27 11:27:21 +02:00
commit c1e66fbf7f
2 changed files with 14 additions and 17 deletions

View file

@ -122,8 +122,7 @@ window.app = Vue.createApp({
LNbits.api
.request(
'PUT',
'/events/api/v1/events/' + eventId + '/approve',
this.g.user.wallets[0].adminkey
'/events/api/v1/events/' + eventId + '/approve'
)
.then(() => {
this.$q.notify({
@ -145,8 +144,7 @@ window.app = Vue.createApp({
LNbits.api
.request(
'PUT',
'/events/api/v1/events/' + eventId + '/reject',
this.g.user.wallets[0].adminkey
'/events/api/v1/events/' + eventId + '/reject'
)
.then(() => {
this.$q.notify({
@ -207,8 +205,7 @@ window.app = Vue.createApp({
LNbits.api
.request(
'GET',
'/events/api/v1/events/all',
this.g.user.wallets[0].adminkey
'/events/api/v1/events/all'
)
.then(response => {
this.events = response.data.map(obj => {
@ -236,8 +233,7 @@ window.app = Vue.createApp({
LNbits.api
.request(
'GET',
'/events/api/v1/events/pending',
this.g.user.wallets[0].adminkey
'/events/api/v1/events/pending'
)
.then(response => {
this.pendingEvents = response.data.map(obj => {