Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Refactor logout #3277

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

Merged
code-asher merged 8 commits into coder:main from code-asher:logout
May 4, 2021
Merged

Refactor logout #3277

code-asher merged 8 commits into coder:main from code-asher:logout
May 4, 2021

Conversation

Copy link
Member

@code-asher code-asher commented May 3, 2021
edited
Loading

This should fix logging out on non-localhost domains and non-root paths (and some other cases like when using --proxy-domain).

It also moves the logout to a command and registers it from our client entry so we don't need to patch VS Code. This new command redirects to the logout endpoint where we clear the cookie from the server end.

It also only shows the logout when authentication is enabled.

Fixes #2984
Fixes #2985

Should unblock #2245 (reply in thread) as well

jsjoeio reacted with hooray emoji
@code-asher code-asher requested a review from a team as a code owner May 3, 2021 20:26
@code-asher code-asher force-pushed the logout branch 2 times, most recently from 72c3868 to d4e848a Compare May 3, 2021 20:32
@code-asher code-asher marked this pull request as draft May 3, 2021 20:42
Copy link
Member Author

Moving to a draft while I update the tests.

jsjoeio reacted with thumbs up emoji

@code-asher code-asher force-pushed the logout branch 2 times, most recently from 64ba137 to 754f57a Compare May 3, 2021 20:59
Copy link

codecov bot commented May 3, 2021
edited
Loading

Codecov Report

Merging #3277 (8b2c78c) into main (9fe459a) will increase coverage by 7.87%.
The diff coverage is 85.71%.

Impacted file tree graph

@@ Coverage Diff @@
## main #3277 +/- ##
==========================================
+ Coverage 46.90% 54.78% +7.87% 
==========================================
 Files 23 23 
 Lines 1196 1265 +69 
 Branches 237 286 +49 
==========================================
+ Hits 561 693 +132 
- Misses 451 460 +9 
+ Partials 184 112 -72 
Impacted Files Coverage Δ
src/node/app.ts 70.73% <0.00%> (ø)
src/browser/register.ts 100.00% <100.00%> (+7.69%) ⬆️
src/common/util.ts 100.00% <100.00%> (+27.65%) ⬆️
src/node/http.ts 27.86% <0.00%> (-6.18%) ⬇️
src/node/vscode.ts 27.50% <0.00%> (-2.64%) ⬇️
src/node/wrapper.ts 33.12% <0.00%> (-0.43%) ⬇️
src/node/entry.ts 0.00% <0.00%> (ø)
src/common/emitter.ts 100.00% <0.00%> (ø)
src/node/proxy_agent.ts 0.00% <0.00%> (ø)
src/browser/pages/vscode.ts 0.00% <0.00%> (ø)
... and 11 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9fe459a...8b2c78c. Read the comment docs.

@code-asher code-asher marked this pull request as ready for review May 4, 2021 18:57
Copy link
Contributor

jsjoeio commented May 4, 2021

will increase coverage by 7.87%.

DANG! Look at you 👏

code-asher reacted with heart emoji

Copy link
Contributor

@jsjoeio jsjoeio left a comment

Choose a reason for hiding this comment

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

@jsjoeio jsjoeio added this to the v3.9.4 milestone May 4, 2021
@jsjoeio jsjoeio added the enhancement Some improvement that isn't a feature label May 4, 2021
Copy link

oxy commented May 4, 2021
edited
Loading

The one thing I'm slightly concerned about is that we have a 1.56 branch in the pipeline already which makes its own set of changes to menubarControl.ts, etc. - how much of this will we have to reimplement/re-fix in the 1.56 branch?

AFAICT its not too much work inside lib/vscode; but would still like any directions if things need changing.

jsjoeio reacted with thumbs up emoji

Copy link
Member Author

code-asher commented May 4, 2021
edited
Loading

Ah yup actually I initially based this off your branch and switched back to main so I could get it merged in. 😛

All I did to resolve conflicts was to checkout the source (since we want to remove all our changes in that file). We can do that again in the 1.56 branch. Or we could resolve manually, I think the only conflict was the logService line and we'd want to remove the comment added above as well.

jsjoeio reacted with thumbs up emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
1 more reviewer

@jsjoeio jsjoeio jsjoeio approved these changes

Reviewers whose approvals may not affect merge requirements
Labels
enhancement Some improvement that isn't a feature
Projects
None yet
Milestone
v3.10.0
Development

Successfully merging this pull request may close these issues.

Log out button should not appear if not using password Logout functionality not working as expected

AltStyle によって変換されたページ (->オリジナル) /