Skip to content

Commit bf09dfb

Browse files
committed
Collaboration: Fix resolving of auth endpoint paths for server urls with Path
Signed-off-by: Jonah Iden <jonah.iden@typefox.io>
1 parent fa6de45 commit bf09dfb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packages/collaboration/src/browser/collaboration-frontend-contribution.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import { CollaborationWorkspaceService } from './collaboration-workspace-service
2929
import { StatusBar, StatusBarAlignment, StatusBarEntry } from '@theia/core/lib/browser/status-bar';
3030
import { codiconArray } from '@theia/core/lib/browser/widgets/widget';
3131
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
32+
import path = require('path');
3233

3334
initializeProtocol({
3435
cryptoModule: window.crypto
@@ -168,8 +169,7 @@ export class CollaborationFrontendContribution implements CommandContribution {
168169
return false;
169170
}
170171
}
171-
172-
const endpointUrl = new URI(serverUrl).withPath(provider.endpoint);
172+
const endpointUrl = new URI(serverUrl).resolve(provider.endpoint);
173173
const response = await fetch(endpointUrl.toString(true), {
174174
method: 'POST',
175175
body: JSON.stringify(values),
@@ -186,7 +186,7 @@ export class CollaborationFrontendContribution implements CommandContribution {
186186
}
187187

188188
protected async handleWebAuth(serverUrl: string, token: string, provider: WebAuthProvider): Promise<boolean> {
189-
const uri = new URI(serverUrl).withPath(provider.endpoint).withQuery('token=' + token);
189+
const uri = new URI(serverUrl).resolve(provider.endpoint).withQuery('token=' + token);
190190
this.windowService.openNewWindow(uri.toString(true), { external: true });
191191
return true;
192192
}

0 commit comments

Comments
 (0)