diff --git a/src/main/java/org/cryptomator/ui/keyloading/hub/ReceiveKeyController.java b/src/main/java/org/cryptomator/ui/keyloading/hub/ReceiveKeyController.java index d00041640..c5832a3ac 100644 --- a/src/main/java/org/cryptomator/ui/keyloading/hub/ReceiveKeyController.java +++ b/src/main/java/org/cryptomator/ui/keyloading/hub/ReceiveKeyController.java @@ -49,7 +49,7 @@ public class ReceiveKeyController implements FxController { private final String deviceId; private final String bearerToken; private final CompletableFuture result; - private final Lazy setupDeviceScene; + private final Lazy registerDeviceScreen; private final Lazy legacyRegisterDeviceScene; private final Lazy unauthorizedScene; private final Lazy accountInitializationScene; @@ -58,13 +58,13 @@ public class ReceiveKeyController implements FxController { private final HttpClient httpClient; @Inject - public ReceiveKeyController(@KeyLoading Vault vault, ExecutorService executor, @KeyLoading Stage window, HubConfig hubConfig, @Named("deviceId") String deviceId, @Named("bearerToken") AtomicReference tokenRef, CompletableFuture result, @FxmlScene(FxmlFile.HUB_REGISTER_DEVICE) Lazy setupDeviceScene, @FxmlScene(FxmlFile.HUB_LEGACY_REGISTER_DEVICE) Lazy legacyRegisterDeviceScene, @FxmlScene(FxmlFile.HUB_UNAUTHORIZED_DEVICE) Lazy unauthorizedScene, @FxmlScene(FxmlFile.HUB_REQUIRE_ACCOUNT_INIT) Lazy accountInitializationScene, @FxmlScene(FxmlFile.HUB_INVALID_LICENSE) Lazy invalidLicenseScene) { + public ReceiveKeyController(@KeyLoading Vault vault, ExecutorService executor, @KeyLoading Stage window, HubConfig hubConfig, @Named("deviceId") String deviceId, @Named("bearerToken") AtomicReference tokenRef, CompletableFuture result, @FxmlScene(FxmlFile.HUB_REGISTER_DEVICE) Lazy registerDeviceScreen, @FxmlScene(FxmlFile.HUB_LEGACY_REGISTER_DEVICE) Lazy legacyRegisterDeviceScene, @FxmlScene(FxmlFile.HUB_UNAUTHORIZED_DEVICE) Lazy unauthorizedScene, @FxmlScene(FxmlFile.HUB_REQUIRE_ACCOUNT_INIT) Lazy accountInitializationScene, @FxmlScene(FxmlFile.HUB_INVALID_LICENSE) Lazy invalidLicenseScene) { this.window = window; this.hubConfig = hubConfig; this.deviceId = deviceId; this.bearerToken = Objects.requireNonNull(tokenRef.get()); this.result = result; - this.setupDeviceScene = setupDeviceScene; + this.registerDeviceScreen = registerDeviceScreen; this.legacyRegisterDeviceScene = legacyRegisterDeviceScene; this.unauthorizedScene = unauthorizedScene; this.accountInitializationScene = accountInitializationScene; @@ -139,7 +139,7 @@ public class ReceiveKeyController implements FxController { var device = JSON.reader().readValue(response.body(), DeviceDto.class); receivedBothEncryptedKeys(encryptedVaultKey, device.userPrivateKey); } - case 404 -> needsDeviceSetup(); // TODO: using the setup code, we can theoretically immediately unlock + case 404 -> needsDeviceRegistration(); // TODO: using the setup code, we can theoretically immediately unlock default -> throw new IllegalStateException("Unexpected response " + response.statusCode()); } } catch (IOException e) { @@ -147,8 +147,8 @@ public class ReceiveKeyController implements FxController { } } - private void needsDeviceSetup() { - window.setScene(setupDeviceScene.get()); + private void needsDeviceRegistration() { + window.setScene(registerDeviceScreen.get()); } private void receivedBothEncryptedKeys(String encryptedVaultKey, String encryptedUserKey) throws IOException {