File tree Expand file tree Collapse file tree
code/extensions/che-github-authentication/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,6 +50,8 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
5050 await authenticationProvider . hydrateFromK8sToken ( ) ;
5151
5252 vscode . authentication . registerAuthenticationProvider ( 'github' , 'GitHub' , authenticationProvider ) ;
53+
54+ await authenticationProvider . notifyExistingSessions ( ) ;
5355}
5456
5557export function deactivate ( ) : void {
Original file line number Diff line number Diff line change @@ -60,6 +60,14 @@ export class GitHubAuthProvider implements vscode.AuthenticationProvider {
6060 this . deviceAuthentication = deviceAuthentication ;
6161 }
6262
63+ async notifyExistingSessions ( ) : Promise < void > {
64+ const sessions = await this . sessionsPromise ;
65+ if ( sessions . length > 0 ) {
66+ this . logger . info ( `GitHubAuthProvider: notifying about ${ sessions . length } existing session(s)` ) ;
67+ this . sessionChangeEmitter . fire ( { added : sessions , removed : [ ] , changed : [ ] } ) ;
68+ }
69+ }
70+
6371 async hydrateFromK8sToken ( ) : Promise < void > {
6472 let sessions = await this . sessionsPromise ;
6573 if ( sessions . length > 0 ) {
You can’t perform that action at this time.
0 commit comments