Skip to content

Commit 91221d5

Browse files
code-asherAkash Satheesan
authored and
Akash Satheesan
committed
Revert old logout code
This reverts commit 947dd85, reversing changes made to 24dc208.
1 parent c2fa1be commit 91221d5

File tree

2 files changed

+3
-31
lines changed

2 files changed

+3
-31
lines changed

lib/vscode/src/vs/server/common/cookie.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

lib/vscode/src/vs/workbench/browser/parts/titlebar/menubarControl.ts

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { registerThemingParticipant, IThemeService } from 'vs/platform/theme/com
99
import { MenuBarVisibility, getTitleBarStyle, IWindowOpenable, getMenuBarVisibility } from 'vs/platform/windows/common/windows';
1010
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
1111
import { IAction, Action, SubmenuAction, Separator } from 'vs/base/common/actions';
12-
import { addDisposableListener, Dimension, EventType, getCookieValue } from 'vs/base/browser/dom';
12+
import { addDisposableListener, Dimension, EventType } from 'vs/base/browser/dom';
1313
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
1414
import { isMacintosh, isWeb, isIOS, isNative } from 'vs/base/common/platform';
1515
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
@@ -38,8 +38,6 @@ import { KeyCode } from 'vs/base/common/keyCodes';
3838
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
3939
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys';
4040
import { ICommandService } from 'vs/platform/commands/common/commands';
41-
import { ILogService } from 'vs/platform/log/common/log';
42-
import { Cookie } from 'vs/server/common/cookie';
4341

4442
export type IOpenRecentAction = IAction & { uri: URI, remoteAuthority?: string };
4543

@@ -319,9 +317,8 @@ export class CustomMenubarControl extends MenubarControl {
319317
@IAccessibilityService accessibilityService: IAccessibilityService,
320318
@IThemeService private readonly themeService: IThemeService,
321319
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
322-
@IHostService hostService: IHostService,
323-
@ICommandService commandService: ICommandService,
324-
@ILogService private readonly logService: ILogService
320+
@IHostService protected readonly hostService: IHostService,
321+
@ICommandService commandService: ICommandService
325322
) {
326323
super(menuService, workspacesService, contextKeyService, keybindingService, configurationService, labelService, updateService, storageService, notificationService, preferencesService, environmentService, accessibilityService, hostService, commandService);
327324

@@ -723,28 +720,6 @@ export class CustomMenubarControl extends MenubarControl {
723720
webNavigationActions.pop();
724721
}
725722

726-
webNavigationActions.push(new Action('logout', localize('logout', "Log out"), undefined, true,
727-
async (_event?: any) => {
728-
const COOKIE_KEY = Cookie.Key;
729-
const loginCookie = getCookieValue(COOKIE_KEY);
730-
731-
this.logService.info('Logging out of code-server');
732-
733-
if(loginCookie) {
734-
this.logService.info(`Removing cookie under ${COOKIE_KEY}`);
735-
736-
if (document && document.cookie) {
737-
// We delete the cookie by setting the expiration to a date/time in the past
738-
document.cookie = COOKIE_KEY +'=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;';
739-
window.location.href = '/login';
740-
} else {
741-
this.logService.warn('Could not delete cookie because document and/or document.cookie is undefined');
742-
}
743-
} else {
744-
this.logService.warn('Could not log out because we could not find cookie');
745-
}
746-
}));
747-
748723
return webNavigationActions;
749724
}
750725

0 commit comments

Comments
 (0)