Skip to content

Commit

Permalink
enforce admin key
Browse files Browse the repository at this point in the history
  • Loading branch information
talvasconcelos committed Jan 26, 2024
1 parent 1314d54 commit 240de05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions templates/tpos/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -862,11 +862,11 @@ <h6 class="text-subtitle1 q-my-none">
return this.tposs.reduce((acc, tpos) => {
tpos.items.forEach(item => {
item.categories &&
item.categories.forEach(category => {
if (!acc.includes(category)) {
acc.push(category)
}
})
item.categories.forEach(category => {
if (!acc.includes(category)) {
acc.push(category)
}
})
})
return acc
}, [])
Expand Down Expand Up @@ -952,7 +952,7 @@ <h6 class="text-subtitle1 q-my-none">
},
createTPoS(wallet, data) {
LNbits.api
.request('POST', '/tpos/api/v1/tposs', wallet.inkey, data)
.request('POST', '/tpos/api/v1/tposs', wallet.adminkey, data)
.then(response => {
this.tposs.push(mapTPoS(response.data))
this.closeFormDialog()
Expand Down
2 changes: 1 addition & 1 deletion views_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ async def api_tposs(

@tpos_ext.post("/api/v1/tposs", status_code=HTTPStatus.CREATED)
async def api_tpos_create(
data: CreateTposData, wallet: WalletTypeInfo = Depends(get_key_type)
data: CreateTposData, wallet: WalletTypeInfo = Depends(require_admin_key)
):
tpos = await create_tpos(wallet_id=wallet.wallet.id, data=data)
return tpos.dict()
Expand Down

0 comments on commit 240de05

Please sign in to comment.