Skip to content

Commit 7131661

Browse files
committed
Merge branch 'master' into feat-cli-changes-for-sites
2 parents a067587 + af98284 commit 7131661

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

templates/flutter/lib/src/client_browser.dart.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ class ClientBrowser extends ClientBase with ClientMixin {
224224
return FlutterWebAuth2.authenticate(
225225
url: url.toString(),
226226
callbackUrlScheme: "{{spec.title | caseLower}}-callback-" + config['project']!,
227+
options: const FlutterWebAuth2Options(useWebview: false),
227228
);
228229
}
229230
}

templates/flutter/lib/src/client_io.dart.twig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ class ClientIO extends ClientBase with ClientMixin {
325325
: "{{spec.title | caseLower}}-callback-" + config['project']!,
326326
options: const FlutterWebAuth2Options(
327327
intentFlags: ephemeralIntentFlags,
328+
useWebview: false,
328329
),
329330
).then((value) async {
330331
Uri url = Uri.parse(value);

templates/flutter/pubspec.yaml.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies:
2020
sdk: flutter
2121
cookie_jar: ^4.0.8
2222
device_info_plus: ^10.1.2
23-
flutter_web_auth_2: ^3.1.2
23+
flutter_web_auth_2: ^4.1.0
2424
http: '>=0.13.6 <2.0.0'
2525
package_info_plus: ^8.0.2
2626
path_provider: ^2.1.4

templates/node/src/client.ts.twig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,9 +201,9 @@ class Client {
201201
}
202202

203203
async chunkedUpload(method: string, url: URL, headers: Headers = {}, originalPayload: Payload = {}, onProgress: (progress: UploadProgress) => void) {
204-
const file = Object.values(originalPayload).find((value) => value instanceof File);
204+
const [fileParam, file] = Object.entries(originalPayload).find(([_, value]) => value instanceof File) ?? [];
205205

206-
if (!file) {
206+
if (!file || !fileParam) {
207207
throw new Error('File not found in payload');
208208
}
209209

@@ -223,7 +223,8 @@ class Client {
223223
headers['content-range'] = `bytes ${start}-${end-1}/${file.size}`;
224224
const chunk = file.slice(start, end);
225225

226-
let payload = { ...originalPayload, file: new File([chunk], file.name)};
226+
let payload = { ...originalPayload };
227+
payload[fileParam] = new File([chunk], file.name);
227228

228229
response = await this.call(method, url, headers, payload);
229230

templates/web/src/client.ts.twig

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -629,9 +629,9 @@ class Client {
629629
}
630630

631631
async chunkedUpload(method: string, url: URL, headers: Headers = {}, originalPayload: Payload = {}, onProgress: (progress: UploadProgress) => void) {
632-
const file = Object.values(originalPayload).find((value) => value instanceof File);
632+
const [fileParam, file] = Object.entries(originalPayload).find(([_, value]) => value instanceof File) ?? [];
633633

634-
if (!file) {
634+
if (!file || !fileParam) {
635635
throw new Error('File not found in payload');
636636
}
637637

@@ -651,7 +651,8 @@ class Client {
651651
headers['content-range'] = `bytes ${start}-${end-1}/${file.size}`;
652652
const chunk = file.slice(start, end);
653653

654-
let payload = { ...originalPayload, file: new File([chunk], file.name)};
654+
let payload = { ...originalPayload };
655+
payload[fileParam] = new File([chunk], file.name);
655656

656657
response = await this.call(method, url, headers, payload);
657658

0 commit comments

Comments
 (0)