You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using your library in a visual studio code extension to do authentication via device code flow. I am displaying a progress bar containing the user code. If a user decides they do not want to authenticate and cancels the progress bar, I would like to cancel the polling.
The relevant code looks like this:
awaitvscode.window.withProgress({location: vscode.ProgressLocation.Notification,title: `Sign in: Your pairing code is ${handle.user_code}`,cancellable: true,},async(progress,token)=>{vscode.commands.executeCommand('vscode.open',vscode.Uri.parse(handle.verification_uri_complete));consttokenSet=awaithandle.poll();awaitkeytar.setPassword(SECRET_KEY_SERVICE_NAME,'token_set',JSON.stringify(tokenSet));authStatusEventEmitter.fire(tokenSet);});
Notice that I get a cancelation token in the async handler. It would be awesome if I could either pass that token into the poll method or a continue function that lets me use it to tell the polling to stop.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am using your library in a visual studio code extension to do authentication via device code flow. I am displaying a progress bar containing the user code. If a user decides they do not want to authenticate and cancels the progress bar, I would like to cancel the polling.
The relevant code looks like this:
Notice that I get a cancelation token in the async handler. It would be awesome if I could either pass that token into the poll method or a continue function that lets me use it to tell the polling to stop.
Something like:
Beta Was this translation helpful? Give feedback.
All reactions