fix: adminKey ignored

This commit is contained in:
2026-06-09 00:46:14 +02:00
parent 767d7d19cf
commit 2490ea2f75
2 changed files with 37 additions and 28 deletions
@@ -31,14 +31,14 @@ object LNbitsClient {
fun create(secrets: SecretStore): LNbitsApi {
// Auth header interceptor — reads invoice key per-request (unchanged)
val authInterceptor = Interceptor { chain ->
val key = runBlocking { secrets.invoiceKey() }
chain.proceed(
chain.request().newBuilder()
.header("X-Api-Key", key)
.build()
)
}
// val authInterceptor = Interceptor { chain ->
// val key = runBlocking { secrets.invoiceKey() }
// chain.proceed(
// chain.request().newBuilder()
// .header("X-Api-Key", key)
// .build()
// )
// }
// Dynamic base URL interceptor — rewrites the placeholder host to the
// real base URL at request time, not at Retrofit construction time.
@@ -65,7 +65,7 @@ object LNbitsClient {
}
val client = httpClient.newBuilder()
.addInterceptor(authInterceptor)
// .addInterceptor(authInterceptor)
.addInterceptor(dynamicBaseUrlInterceptor)
.apply {
// Logging goes LAST — after URL rewrite — so logs show the real URL