mirror of
https://github.com/cryptomator/cryptomator.git
synced 2026-04-18 08:36:52 -04:00
cleanup
This commit is contained in:
@@ -115,7 +115,7 @@ public abstract class HubKeyLoadingModule {
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.HUB_LEGACY_REGISTER_DEVICE)
|
||||
@KeyLoadingScoped
|
||||
static Scene provideHubRegisterDeviceScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) {
|
||||
static Scene provideHubLegacyRegisterDeviceScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) {
|
||||
return fxmlLoaders.createScene(FxmlFile.HUB_LEGACY_REGISTER_DEVICE);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ public abstract class HubKeyLoadingModule {
|
||||
@Provides
|
||||
@FxmlScene(FxmlFile.HUB_SETUP_DEVICE)
|
||||
@KeyLoadingScoped
|
||||
static Scene provideHubSetupDeviceScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) {
|
||||
static Scene provideHubRegisterDeviceScene(@KeyLoading FxmlLoaderFactory fxmlLoaders) {
|
||||
return fxmlLoaders.createScene(FxmlFile.HUB_SETUP_DEVICE);
|
||||
}
|
||||
|
||||
@@ -170,7 +170,7 @@ public abstract class HubKeyLoadingModule {
|
||||
@Binds
|
||||
@IntoMap
|
||||
@FxControllerKey(RegisterDeviceController.class)
|
||||
abstract FxController bindSetupDeviceController(RegisterDeviceController controller);
|
||||
abstract FxController bindRegisterDeviceController(RegisterDeviceController controller);
|
||||
|
||||
@Binds
|
||||
@IntoMap
|
||||
|
||||
@@ -109,7 +109,6 @@ public class RegisterDeviceController implements FxController {
|
||||
workInProgress.set(true);
|
||||
|
||||
var apiRootUrl = hubConfig.getApiBaseUrl();
|
||||
var deviceKey = deviceKeyPair.getPublic().getEncoded();
|
||||
|
||||
var userReq = HttpRequest.newBuilder(apiRootUrl.resolve("users/me")) //
|
||||
.GET() //
|
||||
@@ -135,7 +134,7 @@ public class RegisterDeviceController implements FxController {
|
||||
}
|
||||
}).thenCompose(jwe -> {
|
||||
var now = Instant.now().toString();
|
||||
var dto = new CreateDeviceDto(deviceId, deviceNameField.getText(), BaseEncoding.base64().encode(deviceKey), "DESKTOP", jwe.serialize(), now);
|
||||
var dto = new CreateDeviceDto(deviceId, deviceNameField.getText(), BaseEncoding.base64().encode(deviceKeyPair.getPublic().getEncoded()), "DESKTOP", jwe.serialize(), now);
|
||||
var json = toJson(dto);
|
||||
var deviceUri = apiRootUrl.resolve("devices/" + deviceId);
|
||||
var putDeviceReq = HttpRequest.newBuilder(deviceUri) //
|
||||
|
||||
Reference in New Issue
Block a user