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

feat(lib/vscode): add log out to application menu #2922

Merged
merged 4 commits into from
Mar 23, 2021
Merged

Conversation

jsjoeio
Copy link
Contributor

@jsjoeio jsjoeio commented Mar 17, 2021

This adds a new option to the Application Menu called Log out. It deletes the code-server cookie and logs a user out.

Screenshot

2021-03-17 15 31 46

TODOs

  • use vscode logger
  • refactor Cookie to be in lib/vscode so we can use it
  • write e2e test
  • refactor Cookie and don't share between lib/vscode

Fixes #778

@jsjoeio jsjoeio added this to the v3.9.2 milestone Mar 17, 2021
@jsjoeio jsjoeio self-assigned this Mar 17, 2021
@jsjoeio jsjoeio marked this pull request as ready for review March 17, 2021 23:23
@jsjoeio jsjoeio requested a review from a team as a code owner March 17, 2021 23:23
@jsjoeio jsjoeio force-pushed the jsjoeio/add-logout branch 2 times, most recently from d77243a to 6a05889 Compare March 17, 2021 23:39
Copy link

@oxy oxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a newline at the end of lib/vscode/src/vs/server/common/cookie.ts should be all that's needed.

lib/vscode/src/vs/server/common/cookie.ts Outdated Show resolved Hide resolved
@oxy
Copy link

oxy commented Mar 18, 2021

So I was wondering why tsc was "failing" to use outDir...

Turns out it was, but since we import from lib/vscode in src now, what used to be out/node/entry.js has now become out/src/node/entry.js (and there's an out/lib/vscode/.../cookie.js).

Since our build script, ./ci/steps/build-code-server.sh looks for out/node/entry.js, it fails.

I think it might be best to just duplicate the key cookie.

test/unit/util.test.ts Outdated Show resolved Hide resolved
@jsjoeio
Copy link
Contributor Author

jsjoeio commented Mar 18, 2021

I think it might be best to just duplicate the key cookie.

Ah okay. Yeah it doesn't seem worth it to have to fix everything else for one thing to not be duplicated 😂 thanks for looking into this! I'll convert to draft and fix!

@jsjoeio jsjoeio marked this pull request as draft March 18, 2021 15:16
@jsjoeio jsjoeio marked this pull request as ready for review March 22, 2021 18:40
@jsjoeio jsjoeio requested a review from oxy March 22, 2021 18:40
Copy link

@oxy oxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jsjoeio jsjoeio force-pushed the jsjoeio/add-logout branch 2 times, most recently from d80bcdf to 7958d52 Compare March 22, 2021 21:10
@jsjoeio jsjoeio enabled auto-merge March 22, 2021 21:12
@bpmct
Copy link
Member

bpmct commented Mar 22, 2021

Love this!

This adds a new option to the Application Menu called Log out.

It deletes the code-server cookie and logs a user out.
@jsjoeio jsjoeio merged commit 947dd85 into main Mar 23, 2021
@jsjoeio jsjoeio deleted the jsjoeio/add-logout branch March 23, 2021 19:44
@binaryfire
Copy link

Nice! Just a thought - can you also add it to the profile icon at the bottom of the left sidebar? That seems like the most intuitive place to look for it.

@jsjoeio
Copy link
Contributor Author

jsjoeio commented Mar 24, 2021

@binaryfire thanks for the suggestion! There's some issues with the profile icon (see #2913) but when we work on that, we can consider it! Feel free to leave more thoughts there

code-asher added a commit to code-asher/code-server that referenced this pull request Apr 16, 2021
The tests have been kept.

This reverts commit 947dd85, reversing
changes made to 24dc208.
@Dual-0
Copy link

Dual-0 commented May 10, 2021

nice feature! Hope it is okay to put this in here...
At my new installed code-server instance this button isn't working right.
When I click on the button the site is reloading but I'm still logged in.
Cookie is still present.

thanks

@jsjoeio
Copy link
Contributor Author

jsjoeio commented May 10, 2021

@dual-oo there were a couple bugs fixed in #3277

We're cutting a new release this week so make sure to upgrade and if you have issues, please open a bug report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Log out button
5 participants