Skip to content
Merged
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
3 changes: 3 additions & 0 deletions tool/protoc-gen-mesh_ts_web/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ function generateConnectClientManually(schema: Schema, file: DescFile) {
let content = "";

// Add file header
content += `// Code generated by protoc-gen-meshts. DO NOT EDIT.\n`;
content += `// @generated by protoc-gen-meshts v1\n`;
content += `// @generated from file ${file.name}.proto (package ${file.proto.package}, syntax proto3)\n`;
content += `/* eslint-disable */\n`;
Expand Down Expand Up @@ -317,9 +318,11 @@ function generateServiceClientString(
content += " }\n";
content += "\n";
content += " // Create the gRPC-Web transport for browser with interceptors\n";
content += " // Custom fetch wrapper to include credentials for cookie-based authentication\n";
content += " const transport = createGrpcWebTransport({\n";
content += " baseUrl: this._config.apiServerURL,\n";
content += " interceptors: this._interceptors,\n";
content += ' fetch: (input, init) => fetch(input, { ...init, credentials: "include" }),\n';
content += " });\n";
content += "\n";
content += " // Construct the Connect-ES client\n";
Expand Down