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 {
260260
261261 private async getSession ( authProviderId : AuthProvider , getAuthSessionOptions : vscode . AuthenticationGetSessionOptions ) {
262262 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 {
264278 session = await vscode . authentication . getSession ( authProviderId , SCOPES_OLD , getAuthSessionOptions ) ;
265279 }
280+
266281 return session ;
267282 }
268283
You can’t perform that action at this time.
0 commit comments