Skip to content

Commit b568683

Browse files
fix(client): Correctly set access token when instantiating AcquiaDAM (#16)
* fix(client): Correctly set access token when instantiating AcquiaDAM class When passing both a custom client and an access token to the AcquiaDAM class, the access token will now be properly set.
1 parent 483fe3a commit b568683

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

.changeset/tame-rockets-help.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'acquia-dam-sdk': patch
3+
---
4+
5+
Access Token will now be set correctly when passing both a custom client and an access token to the AcquiaDAM constructor

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ export default class AcquiaDAM {
4747
* @param params Information for creating the client
4848
*/
4949
public constructor(params?: AcquiaDAMParams) {
50-
this._client = params?.client ?? new ApiClient(params?.accessToken)
50+
this._client = params?.client ?? new ApiClient()
51+
52+
if (params?.accessToken) {
53+
this._client.accessToken = params.accessToken
54+
}
5155
}
5256

5357
/**

0 commit comments

Comments
 (0)