Skip to content

Commit 676edaa

Browse files
authored
Fix GitHub authentication (#47)
* Restore auth relay patch Fixes coder/code-server#4795. * Fix callback URIs behind a sub-path
1 parent 74c1604 commit 676edaa

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

extensions/github-authentication/src/githubServer.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ import { Log } from './common/logger';
1515
const localize = nls.loadMessageBundle();
1616

1717
const NETWORK_ERROR = 'network error';
18-
const AUTH_RELAY_SERVER = 'vscode-auth.github.com';
18+
/**
19+
* Change the auth relay server to our own as Microsoft's does not support
20+
* self-hosted instances.
21+
* @author coder
22+
*/
23+
const AUTH_RELAY_SERVER = 'auth.code-server.dev';
1924
// const AUTH_RELAY_STAGING_SERVER = 'client-auth-staging-14a768b.herokuapp.com';
2025

2126
class UriEventHandler extends vscode.EventEmitter<vscode.Uri> implements vscode.UriHandler {

src/vs/code/browser/workbench/workbench.ts

+6
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ function doCreateUri(path: string, queryValues: Map<string, string>): URI {
3434
});
3535
}
3636

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

0 commit comments

Comments
 (0)