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 {
475475 static async login ( { url, username, password, orgName } ) {
476476 const loginUrl = url + "/api/auth/jwt/login" ;
477477
478- const form = new FormData ( ) ;
478+ const form = new URLSearchParams ( ) ;
479479 form . append ( "username" , username ) ;
480480 form . append ( "password" , password ) ;
481481
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 } ) ;
483486 const auth = await res . json ( ) ;
484487 const { token_type, access_token } = auth ;
485488 if ( ! access_token || ! token_type ) {
You can’t perform that action at this time.
0 commit comments