diff --git a/src/main/kotlin/com/semgrep/idea/actions/LoginAction.kt b/src/main/kotlin/com/semgrep/idea/actions/LoginAction.kt index 5057da0..af4283f 100644 --- a/src/main/kotlin/com/semgrep/idea/actions/LoginAction.kt +++ b/src/main/kotlin/com/semgrep/idea/actions/LoginAction.kt @@ -9,11 +9,13 @@ import com.semgrep.idea.lsp.custom_requests.LoginRequest class LoginAction(private val notification: Notification? = null) : LspAction("Sign In with Semgrep") { override fun actionPerformed(e: AnActionEvent, servers: List) { val loginRequest = LoginRequest(servers.first()) - val response = loginRequest.sendRequest().join() ?: return - BrowserUtil.browse(response.url) - servers.forEach { - LoginFinishRequest(it, response).sendNotification() + loginRequest.sendRequest().thenApply { response -> + BrowserUtil.browse(response.url) + servers.forEach { + LoginFinishRequest(it, response).sendNotification() + } + notification?.expire() } - notification?.expire() + } } \ No newline at end of file