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 @@ -47,17 +47,21 @@ export class GitHubAuthProvider implements vscode.AuthenticationProvider {
4747
4848 private deviceAuthentication ?: DeviceAuthentication ;
4949
50+ private readonly storageKey : string ;
51+
5052 constructor (
5153 @inject ( Logger ) private logger : Logger ,
5254 @inject ( ErrorHandler ) private errorHandler : ErrorHandler ,
5355 @inject ( ExtensionContext ) private extensionContext : ExtensionContext ,
5456 @inject ( Symbol . for ( 'GithubServiceInstance' ) ) private githubService : GithubService
5557 ) {
58+ const workspaceId = process . env . DEVWORKSPACE_ID || 'default' ;
59+ this . storageKey = `sessions:${ workspaceId } ` ;
5660 this . sessionsPromise = this . readSessions ( ) ;
5761 }
5862
5963 private async readSessions ( ) : Promise < vscode . AuthenticationSession [ ] > {
60- const raw = await this . extensionContext . getContext ( ) . secrets . get ( 'sessions' ) ;
64+ const raw = await this . extensionContext . getContext ( ) . secrets . get ( this . storageKey ) ;
6165 if ( raw ) {
6266 try {
6367 return JSON . parse ( raw ) ;
@@ -288,7 +292,7 @@ export class GitHubAuthProvider implements vscode.AuthenticationProvider {
288292
289293 private async storeSessions ( sessions : vscode . AuthenticationSession [ ] ) : Promise < void > {
290294 this . sessionsPromise = Promise . resolve ( sessions ) ;
291- await this . extensionContext . getContext ( ) . secrets . store ( 'sessions' , JSON . stringify ( sessions ) ) ;
295+ await this . extensionContext . getContext ( ) . secrets . store ( this . storageKey , JSON . stringify ( sessions ) ) ;
292296 }
293297
294298 async removeSession ( id : string ) {
You can’t perform that action at this time.
0 commit comments