@@ -404,14 +404,16 @@ export async function loginIDPUser(options: {
404404 ...( parameters . dnt !== undefined && { dnt : parameters . dnt . toString ( ) } ) ,
405405 ...( parameters . usid && { usid : parameters . usid } ) ,
406406 } ;
407- const opts : Parameters < typeof slasClient . getAccessToken > [ 0 ] = { body : tokenBody } ;
408- if ( credentials . clientSecret ) {
409- opts . headers = {
410- Authorization : `Basic ${ stringToBase64 (
411- `${ slasClient . clientConfig . parameters . clientId } :${ credentials . clientSecret } `
412- ) } `,
413- } ;
414- }
407+ const opts = {
408+ body : tokenBody ,
409+ ...( credentials . clientSecret && {
410+ headers : {
411+ Authorization : `Basic ${ stringToBase64 (
412+ `${ slasClient . clientConfig . parameters . clientId } :${ credentials . clientSecret } `
413+ ) } `,
414+ } ,
415+ } ) ,
416+ } ;
415417
416418 if ( enableHttpOnlySessionCookies ) {
417419 return getAccessTokenHttpOnly ( slasClient , opts ) ;
@@ -643,14 +645,16 @@ export async function loginRegisteredUserB2C(options: {
643645 usid : authResponse . usid ,
644646 ...( dnt !== undefined && { dnt : dnt . toString ( ) } ) ,
645647 } ;
646- const opts : Parameters < typeof slasClient . getAccessToken > [ 0 ] = { body : tokenBody } ;
647- if ( credentials . clientSecret ) {
648- opts . headers = {
649- Authorization : `Basic ${ stringToBase64 (
650- `${ slasClient . clientConfig . parameters . clientId } :${ credentials . clientSecret } `
651- ) } `,
652- } ;
653- }
648+ const opts = {
649+ body : tokenBody ,
650+ ...( credentials . clientSecret && {
651+ headers : {
652+ Authorization : `Basic ${ stringToBase64 (
653+ `${ slasClient . clientConfig . parameters . clientId } :${ credentials . clientSecret } `
654+ ) } `,
655+ } ,
656+ } ) ,
657+ } ;
654658
655659 if ( enableHttpOnlySessionCookies ) {
656660 return getAccessTokenHttpOnly ( slasClient , opts ) ;
@@ -877,14 +881,16 @@ export async function refreshAccessToken(options: {
877881 ...( parameters . dnt !== undefined && { dnt : parameters . dnt . toString ( ) } ) ,
878882 } ;
879883
880- const opts : Parameters < typeof slasClient . getAccessToken > [ 0 ] = { body} ;
881- if ( credentials ?. clientSecret ) {
882- opts . headers = {
883- Authorization : `Basic ${ stringToBase64 (
884- `${ slasClient . clientConfig . parameters . clientId } :${ credentials . clientSecret } `
885- ) } `,
886- } ;
887- }
884+ const opts = {
885+ body,
886+ ...( credentials ?. clientSecret && {
887+ headers : {
888+ Authorization : `Basic ${ stringToBase64 (
889+ `${ slasClient . clientConfig . parameters . clientId } :${ credentials . clientSecret } `
890+ ) } `,
891+ } ,
892+ } ) ,
893+ } ;
888894
889895 if ( enableHttpOnlySessionCookies ) {
890896 return getAccessTokenHttpOnly ( slasClient , opts ) ;
0 commit comments