File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -475,11 +475,14 @@ export class BtrixClient {
475
475
static async login ( { url, username, password, orgName } ) {
476
476
const loginUrl = url + "/api/auth/jwt/login" ;
477
477
478
- const form = new FormData ( ) ;
478
+ const form = new URLSearchParams ( ) ;
479
479
form . append ( "username" , username ) ;
480
480
form . append ( "password" , password ) ;
481
481
482
- const res = await fetch ( loginUrl , { method : "POST" , body : form } ) ;
482
+ 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 } ) ;
483
486
const auth = await res . json ( ) ;
484
487
const { token_type, access_token } = auth ;
485
488
if ( ! access_token || ! token_type ) {
You can’t perform that action at this time.
0 commit comments