mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-22 01:25:38 -05:00
Add token expiration handling for AzureMFA auth (#16936)
* refresh azure account token if it's expired before sending query/list requests * fix several connection checks && add more logging * fix async UI glitch during token refreshing * cleanup * minor fix * add test for refreshAzureAccountTokenIfNecessary * address comments * comments * comments * comments * error handling
This commit is contained in:
@@ -206,6 +206,7 @@ export class RunQueryAction extends QueryTaskbarAction {
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
if (!this.editor.isSelectionEmpty()) {
|
||||
await this.connectionManagementService.refreshAzureAccountTokenIfNecessary(this.editor.input.uri);
|
||||
if (this.isConnected(this.editor)) {
|
||||
// If we are already connected, run the query
|
||||
this.runQuery(this.editor);
|
||||
@@ -220,6 +221,7 @@ export class RunQueryAction extends QueryTaskbarAction {
|
||||
|
||||
public async runCurrent(): Promise<void> {
|
||||
if (!this.editor.isSelectionEmpty()) {
|
||||
await this.connectionManagementService.refreshAzureAccountTokenIfNecessary(this.editor.input.uri);
|
||||
if (this.isConnected(this.editor)) {
|
||||
// If we are already connected, run the query
|
||||
this.runQuery(this.editor, true);
|
||||
@@ -307,6 +309,7 @@ export class EstimatedQueryPlanAction extends QueryTaskbarAction {
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
if (!this.editor.isSelectionEmpty()) {
|
||||
await this.connectionManagementService.refreshAzureAccountTokenIfNecessary(this.editor.input.uri);
|
||||
if (this.isConnected(this.editor)) {
|
||||
// If we are already connected, run the query
|
||||
this.runQuery(this.editor);
|
||||
@@ -346,6 +349,7 @@ export class ActualQueryPlanAction extends QueryTaskbarAction {
|
||||
|
||||
public override async run(): Promise<void> {
|
||||
if (!this.editor.isSelectionEmpty()) {
|
||||
await this.connectionManagementService.refreshAzureAccountTokenIfNecessary(this.editor.input.uri);
|
||||
if (this.isConnected(this.editor)) {
|
||||
// If we are already connected, run the query
|
||||
this.runQuery(this.editor);
|
||||
|
||||
Reference in New Issue
Block a user