File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/main/kotlin/io/snyk/plugin/ui/jcef Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,17 @@ class SaveConfigHandler(
4646 JBCefJSQuery .Response (" success" )
4747 }
4848
49- loginQuery.addHandler {
49+ loginQuery.addHandler { jsonConfig ->
50+ // Save config first (like the old dialog does before authentication)
51+ try {
52+ if (jsonConfig.isNotBlank() && jsonConfig != " login" ) {
53+ parseAndSaveConfig(jsonConfig)
54+ }
55+ } catch (e: Exception ) {
56+ logger.warn(" Error saving config before login" , e)
57+ }
5058 runInBackground(" Snyk: authenticating..." ) {
59+ LanguageServerWrapper .getInstance(project).updateConfiguration(true )
5160 getSnykCliAuthenticationService(project)?.authenticate()
5261 }
5362 JBCefJSQuery .Response (" success" )
@@ -70,7 +79,7 @@ class SaveConfigHandler(
7079 }
7180 window.__ideSaveConfig__ = function(value) { ${saveConfigQuery.inject(" value" )} };
7281 window.__ideNotifyModified__ = function() { ${notifyModifiedQuery.inject(" 'modified'" )} };
73- window.__ideLogin__ = function() { ${loginQuery.inject(" 'login'" )} };
82+ window.__ideLogin__ = function(configJson ) { ${loginQuery.inject(" configJson || 'login'" )} };
7483 window.__ideLogout__ = function() { ${logoutQuery.inject(" 'logout'" )} };
7584 })();
7685 """
You can’t perform that action at this time.
0 commit comments