File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -416,6 +416,7 @@ const loginWithOAuthDevice = async ({
416416 }
417417
418418 globalConfig . setEmail ( account . email ) ;
419+ globalConfig . removeCookie ( ) ;
419420
420421 const { removed : removedLegacySessions , failed : failedLegacySessions } =
421422 await removeLegacySessionsExcept ( id ) ;
Original file line number Diff line number Diff line change @@ -1345,6 +1345,10 @@ class Global extends Config<GlobalConfigData> {
13451345 this . setTo ( Global . PREFERENCE_COOKIE , cookie ) ;
13461346 }
13471347
1348+ removeCookie ( ) : void {
1349+ this . deleteFrom ( Global . PREFERENCE_COOKIE ) ;
1350+ }
1351+
13481352 getProject ( ) : string {
13491353 if ( ! this . hasFrom ( Global . PREFERENCE_PROJECT ) ) {
13501354 return "" ;
@@ -1442,6 +1446,19 @@ class Global extends Config<GlobalConfigData> {
14421446 this . write ( ) ;
14431447 }
14441448 }
1449+
1450+ deleteFrom ( key : string ) : void {
1451+ const current = this . getCurrentSession ( ) ;
1452+
1453+ if ( current ) {
1454+ const config = this . get ( current as any ) ;
1455+
1456+ if ( config && ( config as any ) [ key ] !== undefined ) {
1457+ delete ( config as any ) [ key ] ;
1458+ this . write ( ) ;
1459+ }
1460+ }
1461+ }
14451462}
14461463
14471464export const localConfig = new Local ( ) ;
You can’t perform that action at this time.
0 commit comments