Skip to content

Commit 51c5bec

Browse files
authored
Fix redirect URL creation for leading slashes in OAuth endpoint
Signed-off-by: Dawa Ometto <[email protected]>
1 parent 5702bd4 commit 51c5bec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/open-collaboration-server/src/auth-endpoints/oauth-endpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export abstract class OAuthEndpoint implements AuthEndpoint {
125125

126126
protected createRedirectUrl(host: string, port: number, path: string): string {
127127
const baseURL = this.baseURL ?? `http://${host === '0.0.0.0' ? 'localhost' : host}:${port}`;
128-
return new URL(path, baseURL).toString();
128+
return new URL(path.startsWith('/') ? path.substring(1) : path, baseURL).toString();
129129
}
130130
}
131131

0 commit comments

Comments
 (0)