mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-09-19 13:51:23 +00:00
Handle askpass without platform
This commit is contained in:
parent
d5442e858d
commit
4fdf89b77d
|
@ -1,8 +1,5 @@
|
|||
package io.xpipe.app.exchange;
|
||||
|
||||
import io.xpipe.app.core.AppStyle;
|
||||
import io.xpipe.app.core.AppTheme;
|
||||
import io.xpipe.app.util.PlatformState;
|
||||
import io.xpipe.app.util.SecretManager;
|
||||
import io.xpipe.beacon.BeaconHandler;
|
||||
import io.xpipe.beacon.exchange.AskpassExchange;
|
||||
|
@ -19,13 +16,6 @@ public class AskpassExchangeImpl extends AskpassExchange
|
|||
return Response.builder().build();
|
||||
}
|
||||
|
||||
if (!PlatformState.initPlatformIfNeeded()) {
|
||||
return Response.builder().build();
|
||||
}
|
||||
|
||||
AppStyle.init();
|
||||
AppTheme.init();
|
||||
|
||||
var p = found.get();
|
||||
var secret = p.process(msg.getPrompt());
|
||||
return Response.builder()
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package io.xpipe.app.util;
|
||||
|
||||
import io.xpipe.app.core.AppI18n;
|
||||
import io.xpipe.app.core.AppStyle;
|
||||
import io.xpipe.app.core.AppTheme;
|
||||
import io.xpipe.app.core.AppWindowHelper;
|
||||
import io.xpipe.app.fxcomps.impl.SecretFieldComp;
|
||||
import io.xpipe.core.util.InPlaceSecretValue;
|
||||
|
@ -17,6 +19,13 @@ import javafx.stage.Stage;
|
|||
public class AskpassAlert {
|
||||
|
||||
public static SecretQueryResult queryRaw(String prompt, InPlaceSecretValue secretValue) {
|
||||
if (!PlatformState.initPlatformIfNeeded()) {
|
||||
return new SecretQueryResult(null, true);
|
||||
}
|
||||
|
||||
AppStyle.init();
|
||||
AppTheme.init();
|
||||
|
||||
var prop = new SimpleObjectProperty<>(secretValue);
|
||||
var r = AppWindowHelper.showBlockingAlert(alert -> {
|
||||
alert.setTitle(AppI18n.get("askpassAlertTitle"));
|
||||
|
|
Loading…
Reference in a new issue