Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logout functionality not working as expected #2984

Closed
AurangAsif opened this issue Mar 26, 2021 · 10 comments · Fixed by #3277
Closed

Logout functionality not working as expected #2984

AurangAsif opened this issue Mar 26, 2021 · 10 comments · Fixed by #3277
Assignees
Labels
bug Something isn't working
Projects
Milestone

Comments

@AurangAsif
Copy link

AurangAsif commented Mar 26, 2021

OS/Web Information

  • Web Browser: Chrome@86.0.4240.199 (chrome:version)
  • Local OS: Chrome OS (Chromebook)
  • Remote Host: https://railway.app
  • Remote OS: Debian
  • Remote Architecture: dpkg --print-architecture: amd64
  • code-server --version: 3.9.2

Steps to Reproduce

  1. Navigate to url where code-server is running
  2. Sign in
  3. Choose File > Log out

Expected

The page should refresh and you should be on the login page once again

Actual

Page refreshes but you are still logged in

Screenshot

THE EXACT SAME AS AFTER A LOGIN

Notes

This issue can be reproduced in VS Code: Yes/NoCannot test

@jsjoeio jsjoeio added the needs-investigation This issue needs to be further investigated label Mar 26, 2021
@jsjoeio jsjoeio added this to Triage in code-server via automation Mar 26, 2021
@jsjoeio jsjoeio added this to the v3.9.3 milestone Mar 26, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 26, 2021

Hmm...I'm not able to reproduce when running code-server locally off main.

Screen.Recording.2021-03-26.at.1.08.10.PM.mov

I will investigate further.

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 26, 2021

I installed 3.9.2 using yarn global add code-server and could not reproduce.

Screen.Recording.2021-03-26.at.4.01.42.PM.mov

How are you starting code-server? Do you have a password set or are you running with --auth none? (Apologies if that's a silly question)

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 26, 2021

And can you check the browser logs after you hit Log out? There might be something there too

@AurangAsif
Copy link
Author

I installed 3.9.2 using yarn global add code-server and could not reproduce.

Screen.Recording.2021-03-26.at.4.01.42.PM.mov
How are you starting code-server? Do you have a password set or are you running with --auth none? (Apologies if that's a silly question)

I have the HASHED_PASSWORD env var set.
Here are the devtools logs after the refresh:

[Deprecation] ::-webkit-details-marker pseudo element selector is deprecated. Please use ::marker instead. See https://chromestatus.com/feature/6730096436051968 for more details.
register.ts:14 [Service Worker] registered
DevTools failed to load SourceMap: Could not load content for https://MYRAILWAYPROJECTNAME-development.up.railway.app/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/dist/pages/pages/vscode.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
(index):1 Site cannot be installed: Page does not work offline. Starting in Chrome 93, the installability criteria is changing, and this site will not be installable. See https://goo.gle/improved-pwa-offline-detection for more information.
webWorkerExtensionHost.ts:125 The web worker extension host is started without an iframe sandbox!
start @ webWorkerExtensionHost.ts:125
Kn @ extensionHostManager.ts:67
_createInstance @ instantiationService.ts:110
createInstance @ instantiationService.ts:76
(anonymous) @ abstractExtensionService.ts:447
_startExtensionHosts @ abstractExtensionService.ts:446
_initialize @ abstractExtensionService.ts:411
(anonymous) @ extensionService.ts:74
Promise.then (async)
Xs @ extensionService.ts:74
_createInstance @ instantiationService.ts:110
_createServiceInstance @ instantiationService.ts:230
_createServiceInstanceWithOwner @ instantiationService.ts:219
_createAndCacheServiceInstance @ instantiationService.ts:208
_safeCreateAndCacheServiceInstance @ instantiationService.ts:151
_getOrCreateServiceInstance @ instantiationService.ts:135
get @ instantiationService.ts:54
initLayout @ layout.ts:255
(anonymous) @ workbench.ts:137
invokeFunction @ instantiationService.ts:61
startup @ workbench.ts:130
open @ web.main.ts:95
async function (async)
open @ web.main.ts:83
Se @ web.main.ts:359
g @ workbench.web.api.ts:498
(anonymous) @ workbench.ts:498
(anonymous) @ workbench.ts:505
r._invokeFactory @ loader.js:1114
r.complete @ loader.js:1124
r._onModuleComplete @ loader.js:1750
r._onModuleComplete @ loader.js:1762
r._resolve @ loader.js:1710
r.defineModule @ loader.js:1353
o @ loader.js:1638
v @ loader.js:2145
r._invokeFactory @ loader.js:1114
r.complete @ loader.js:1124
r._onModuleComplete @ loader.js:1750
r._onModuleComplete @ loader.js:1762
r._resolve @ loader.js:1710
r.defineModule @ loader.js:1353
p @ loader.js:1800
(anonymous) @ workbench.nls.js:7
abstractExtensionService.ts:846 Extension 'GitHub.vscode-pull-request-github' uses PROPOSED API which is subject to change and removal without notice.
updateEnableProposedApi @ abstractExtensionService.ts:846
_checkEnableProposedApi @ abstractExtensionService.ts:584
_checkEnabledAndProposedAPI @ abstractExtensionService.ts:590
_scanAndHandleExtensions @ extensionService.ts:182
async function (async)
_scanAndHandleExtensions @ extensionService.ts:176
_initialize @ abstractExtensionService.ts:412
(anonymous) @ extensionService.ts:74
Promise.then (async)
Xs @ extensionService.ts:74
_createInstance @ instantiationService.ts:110
_createServiceInstance @ instantiationService.ts:230
_createServiceInstanceWithOwner @ instantiationService.ts:219
_createAndCacheServiceInstance @ instantiationService.ts:208
_safeCreateAndCacheServiceInstance @ instantiationService.ts:151
_getOrCreateServiceInstance @ instantiationService.ts:135
get @ instantiationService.ts:54
initLayout @ layout.ts:255
(anonymous) @ workbench.ts:137
invokeFunction @ instantiationService.ts:61
startup @ workbench.ts:130
open @ web.main.ts:95
async function (async)
open @ web.main.ts:83
Se @ web.main.ts:359
g @ workbench.web.api.ts:498
(anonymous) @ workbench.ts:498
(anonymous) @ workbench.ts:505
r._invokeFactory @ loader.js:1114
r.complete @ loader.js:1124
r._onModuleComplete @ loader.js:1750
r._onModuleComplete @ loader.js:1762
r._resolve @ loader.js:1710
r.defineModule @ loader.js:1353
o @ loader.js:1638
v @ loader.js:2145
r._invokeFactory @ loader.js:1114
r.complete @ loader.js:1124
r._onModuleComplete @ loader.js:1750
r._onModuleComplete @ loader.js:1762
r._resolve @ loader.js:1710
r.defineModule @ loader.js:1353
p @ loader.js:1800
(anonymous) @ workbench.nls.js:7
console.ts:137 [Extension Host] filesize is active

@ismail
Copy link

ismail commented Mar 29, 2021

FWIW I can also reproduce with 3.9.2, also using hashed-password (in config).

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 29, 2021

Interesting... Maybe it's with the way we store/clear the hashed password 🤔

Thanks for reporting as well @ismail! @AurangAsif sorry, I should have been more specific. Can you post the browser logs? Wondering if we're seeing any errors there related to Log out

@AurangAsif
Copy link
Author

Interesting... Maybe it's with the way we store/clear the hashed password 🤔

Thanks for reporting as well @ismail! @AurangAsif sorry, I should have been more specific. Can you post the browser logs? Wondering if we're seeing any errors there related to Log out

By browser logs do you mean Chrome logs, code-server logs or something else?

@jsjoeio
Copy link
Contributor

jsjoeio commented Mar 29, 2021

Chrome logs, exactly! Sorry, I need to work on being more specific as you can see 😅

@ismail
Copy link

ismail commented Mar 29, 2021

Here is what I see in the console just after clicking logout:

   INFO Logging out of code-server log.ts:284
   INFO Removing cookie under key log.ts:284
   INFO [lifecycle] onBeforeUnload triggered
   ERR Method not implemented.: Error: Method not implemented.
    at C.setTerminalLayoutInfo (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:950:18444)
    at w._onWillShutdown (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2741:8425)
    at https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:2741:1969
    at l.fire (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:57:1836)
    at y.doShutdown (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1713:2673)
    at y.onBeforeUnload (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1713:1982)
    at https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1713:1750
    at R._actionCallback (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:1768:5770)
    at R.run (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:171:30024)
    at k.runAction (https://server.url/static/109d2ce3247869eaeab67aa7e5423503ec9eb859/usr/lib/code-server/lib/vscode/out/vs/workbench/workbench.web.api.js:171:30556)
Navigated to https://server.url/

@jsjoeio jsjoeio changed the title Logout functionality does not work Logout functionality does not work with HASHED_PASSWORD Mar 30, 2021
@jsjoeio jsjoeio changed the title Logout functionality does not work with HASHED_PASSWORD Logout functionality not working as expected Apr 2, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Apr 2, 2021

For whoever picks this up, some notes:

  1. re-calculate domain
  2. if cookie is key set again as-is but append expiration
  3. do it from server-side
  4. set path the same as well (probably needs to be sent from browser)

Could possible redirect to ./logout/?path=/bla or do a POST. Then on the logout route we set it just like we do in the login route.

Food for thought.

@jsjoeio jsjoeio modified the milestones: v3.9.3, On Deck Apr 8, 2021
@code-asher code-asher added bug Something isn't working and removed needs-investigation This issue needs to be further investigated labels Apr 16, 2021
@code-asher code-asher self-assigned this Apr 16, 2021
@code-asher code-asher moved this from Triage to In progress in code-server Apr 16, 2021
@code-asher code-asher modified the milestones: On Deck, v3.9.4 Apr 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
code-server
In progress
Development

Successfully merging a pull request may close this issue.

4 participants