From ba6eb4f64cb2ec8686814f40023a836fffea2031 Mon Sep 17 00:00:00 2001 From: James Ward Date: Wed, 15 Apr 2026 15:15:24 -0400 Subject: [PATCH] fix(kobo): proxy the `/v1/auth/device` endpoint (#511) without this it's impossible to set up a kobo device since we won't have a userkey yet --- .../main/java/org/booklore/controller/KoboController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/booklore-api/src/main/java/org/booklore/controller/KoboController.java b/booklore-api/src/main/java/org/booklore/controller/KoboController.java index dbd4703fb..a094d1ca3 100644 --- a/booklore-api/src/main/java/org/booklore/controller/KoboController.java +++ b/booklore-api/src/main/java/org/booklore/controller/KoboController.java @@ -115,7 +115,11 @@ public class KoboController { @Operation(summary = "Authenticate Kobo device", description = "Authenticate a Kobo device.") @ApiResponse(responseCode = "200", description = "Device authenticated successfully") @PostMapping("/v1/auth/device") - public ResponseEntity authenticateDevice(@Parameter(description = "Authentication request body") @RequestBody JsonNode body) { + public ResponseEntity authenticateDevice(@Parameter(description = "Authentication request body") @RequestBody JsonNode body) { + if (isForwardingToKoboStore()) { + return koboServerProxy.proxyCurrentRequest(body, false); + } + return koboDeviceAuthService.authenticateDevice(body); }