File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,13 @@ export class Client {
2222
2323 /**
2424 * @param login The login to use for authentication, pass empty string for JWT
25- * @param passwordOrToken The password or JWT to use for authentication
25+ * @param password The password or JWT to use for authentication
2626 * @param httpClient The HTTP client to use for requests
2727 * @param baseUrl The base URL to use for requests. Defaults to {@link BASE_URL}.
2828 */
2929 constructor (
3030 login : string ,
31- passwordOrToken : string ,
31+ password : string ,
3232 httpClient ?: HttpClient ,
3333 baseUrl = BASE_URL
3434 ) {
@@ -39,15 +39,15 @@ export class Client {
3939 } ;
4040
4141 if ( login === "" ) {
42- if ( passwordOrToken === "" ) {
42+ if ( password === "" ) {
4343 throw new Error ( "Token is required for JWT authentication" ) ;
4444 }
45- this . defaultHeaders [ "Authorization" ] = `Bearer ${ passwordOrToken } ` ;
45+ this . defaultHeaders [ "Authorization" ] = `Bearer ${ password } ` ;
4646 } else {
47- if ( passwordOrToken === "" ) {
47+ if ( password === "" ) {
4848 throw new Error ( "Password is required when using Basic Auth with login" ) ;
4949 }
50- this . defaultHeaders [ "Authorization" ] = `Basic ${ Buffer . from ( `${ login } :${ passwordOrToken } ` ) . toString ( "base64" ) } ` ;
50+ this . defaultHeaders [ "Authorization" ] = `Basic ${ Buffer . from ( `${ login } :${ password } ` ) . toString ( "base64" ) } ` ;
5151 }
5252 }
5353
You can’t perform that action at this time.
0 commit comments