File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -260,9 +260,24 @@ export class CredentialStore implements vscode.Disposable {
260
260
261
261
private async getSession ( authProviderId : AuthProvider , getAuthSessionOptions : vscode . AuthenticationGetSessionOptions ) {
262
262
let session : vscode . AuthenticationSession | undefined = await vscode . authentication . getSession ( authProviderId , SCOPES , { silent : true } ) ;
263
- if ( ! session ) {
263
+ if ( session ) {
264
+ return session ;
265
+ }
266
+
267
+ if ( getAuthSessionOptions . createIfNone ) {
268
+ const silent = getAuthSessionOptions . silent ;
269
+ getAuthSessionOptions . createIfNone = false ;
270
+ getAuthSessionOptions . silent = true ;
271
+ session = await vscode . authentication . getSession ( authProviderId , SCOPES_OLD , getAuthSessionOptions ) ;
272
+ if ( ! session ) {
273
+ getAuthSessionOptions . createIfNone = true ;
274
+ getAuthSessionOptions . silent = silent ;
275
+ session = await vscode . authentication . getSession ( authProviderId , SCOPES , getAuthSessionOptions ) ;
276
+ }
277
+ } else {
264
278
session = await vscode . authentication . getSession ( authProviderId , SCOPES_OLD , getAuthSessionOptions ) ;
265
279
}
280
+
266
281
return session ;
267
282
}
268
283
You can’t perform that action at this time.
0 commit comments