This commit is contained in:
Arc
2026-01-29 18:17:07 +00:00
parent dadff18a9c
commit 92c86eb837
2 changed files with 6 additions and 6 deletions
+3 -1
View File
@@ -309,7 +309,9 @@ def add_route_access_middleware(app: FastAPI):
request, f"Route not whitelisted: {path}", HTTPStatus.FORBIDDEN request, f"Route not whitelisted: {path}", HTTPStatus.FORBIDDEN
) )
if blacklist and any(_route_pattern_matches(route, path) for route in blacklist): if blacklist and any(
_route_pattern_matches(route, path) for route in blacklist
):
return _response_by_accepted_type( return _response_by_accepted_type(
request, f"Route is blacklisted: {path}", HTTPStatus.FORBIDDEN request, f"Route is blacklisted: {path}", HTTPStatus.FORBIDDEN
) )
+3 -5
View File
@@ -73,9 +73,7 @@ window.PageAdmin = {
updateSettings() { updateSettings() {
if (this.shouldConfirmRouteAccess()) { if (this.shouldConfirmRouteAccess()) {
LNbits.utils LNbits.utils
.confirmDialog( .confirmDialog(this.$t('route_access_save_confirm'))
this.$t('route_access_save_confirm')
)
.onOk(() => this.persistSettings()) .onOk(() => this.persistSettings())
return return
} }
@@ -87,8 +85,8 @@ window.PageAdmin = {
'lnbits_route_access_whitelist', 'lnbits_route_access_whitelist',
'lnbits_route_access_blacklist' 'lnbits_route_access_blacklist'
] ]
return fields.some(field => return fields.some(
!_.isEqual(this.settings[field], this.formData[field]) field => !_.isEqual(this.settings[field], this.formData[field])
) )
}, },
persistSettings() { persistSettings() {