make
This commit is contained in:
@@ -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
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user