We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3615d33 commit 7e6967cCopy full SHA for 7e6967c
src/ui/upload.ts
@@ -475,11 +475,14 @@ export class BtrixClient {
475
static async login({ url, username, password, orgName }) {
476
const loginUrl = url + "/api/auth/jwt/login";
477
478
- const form = new FormData();
+ const form = new URLSearchParams();
479
form.append("username", username);
480
form.append("password", password);
481
482
- const res = await fetch(loginUrl, { method: "POST", body: form });
+ const headers = new Headers();
483
+ headers.set("Content-Type", "application/x-www-form-urlencoded");
484
+
485
+ const res = await fetch(loginUrl, { method: "POST", body: form, headers });
486
const auth = await res.json();
487
const { token_type, access_token } = auth;
488
if (!access_token || !token_type) {
0 commit comments