Skip to content

Commit 2d02e13

Browse files
Merge pull request #1032 from appwrite/fix-duped-auth-config
fix(web): duped auth config
2 parents 612b2e0 + 1b8ab10 commit 2d02e13

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

templates/web/src/services/template.ts.twig

+2-9
Original file line numberDiff line numberDiff line change
@@ -70,14 +70,13 @@ export class {{ service.name | caseUcfirst }} {
7070
{%~ endfor %}
7171
}
7272

73-
{%~ if method.type == 'location' or method.type == 'webAuth' %}
74-
{%~ if method.auth|length > 0 %}
7573
{%~ for node in method.auth %}
7674
{%~ for key,header in node|keys %}
7775
payload['{{header|caseLower}}'] = this.client.config.{{header|caseLower}};
7876
{%~ endfor %}
7977
{%~ endfor %}
80-
{%~ endif %}
78+
79+
{%~ if method.type == 'location' or method.type == 'webAuth' %}
8180
for (const [key, value] of Object.entries(Service.flatten(payload))) {
8281
uri.searchParams.append(key, value);
8382
}
@@ -91,12 +90,6 @@ export class {{ service.name | caseUcfirst }} {
9190
return uri.toString();
9291
}
9392
{%~ elseif method.type == 'location' %}
94-
{%~ for node in method.auth %}
95-
{%~ for key, header in node|keys %}
96-
payload['{{ header|caseLower }}'] = this.client.config.{{ header|caseLower }};
97-
{%~ endfor %}
98-
{%~ endfor %}
99-
10093
return uri.toString();
10194
{%~ elseif 'multipart/form-data' in method.consumes %}
10295
return await this.client.chunkedUpload(

0 commit comments

Comments
 (0)