Skip to content

Fix GitHub authentication #47

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
merged 2 commits into from
Feb 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion extensions/github-authentication/src/githubServer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ import { Log } from './common/logger';
const localize = nls.loadMessageBundle();

const NETWORK_ERROR = 'network error';
const AUTH_RELAY_SERVER = 'vscode-auth.github.com';
/**
* Change the auth relay server to our own as Microsoft's does not support
* self-hosted instances.
* @author coder
*/
const AUTH_RELAY_SERVER = 'auth.code-server.dev';
Copy link

Choose a reason for hiding this comment

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

❓How did you know to use this? Is this documented somewhere in code-server or somewhere else?

Copy link
Member Author

@code-asher code-asher Feb 24, 2022

Choose a reason for hiding this comment

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

I do not think it is documented anywhere, I only know about it because I wrote the relay server. 😛

// const AUTH_RELAY_STAGING_SERVER = 'client-auth-staging-14a768b.herokuapp.com';

class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {
Expand Down
6 changes: 6 additions & 0 deletions src/vs/code/browser/workbench/workbench.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function doCreateUri(path: string, queryValues: Map<string, string>): URI {
});
}

/**
* Preserve the current path so it works with reverse proxies serving behind a
* sub-path.
* @author coder
*/
path = (window.location.pathname + "/" + path).replace(/\/\/+/g, "/")
return URI.parse(window.location.href).with({ path, query });
}

Expand Down