Skip to content

Commit 3f3c6ec

Browse files
committed
HW-48364: Update SDKs to use authentication-token instead of client-token
1 parent f0e3a62 commit 3f3c6ec

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

src/Hyperwallet.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,22 +559,22 @@ export default class Hyperwallet {
559559
}
560560

561561
//--------------------------------------
562-
// Client Token
562+
// Authentication Token
563563
//--------------------------------------
564564

565565
/**
566-
* Get client token
566+
* Get authentication token
567567
*
568568
* @param {string} userToken - The user token
569569
* @param {api-callback} callback - The callback for this call
570570
*
571571
* @throws Will throw an error if userToken is not provided
572572
*/
573-
getClientToken(userToken, callback) {
573+
getAuthenticationToken(userToken, callback) {
574574
if (!userToken) {
575575
throw new Error("userToken is required");
576576
}
577-
this.client.doPost(`users/${encodeURIComponent(userToken)}/client-token`, {}, {}, callback);
577+
this.client.doPost(`users/${encodeURIComponent(userToken)}/authentication-token`, {}, {}, callback);
578578
}
579579

580580
//--------------------------------------

test/Hyperwallet.spec.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -762,11 +762,11 @@ describe("Hyperwallet", () => {
762762
});
763763

764764
//--------------------------------------
765-
// Client Token
765+
// Authentication Token
766766
//--------------------------------------
767767

768-
/** @test {Hyperwallet#getClientToken} */
769-
describe("getClientToken()", () => {
768+
/** @test {Hyperwallet#getAuthenticationToken} */
769+
describe("getAuthenticationToken()", () => {
770770
let client;
771771
let apiClientSpy;
772772

@@ -781,19 +781,19 @@ describe("Hyperwallet", () => {
781781
};
782782
});
783783

784-
/** @test {Hyperwallet#getClientToken} */
784+
/** @test {Hyperwallet#getAuthenticationToken} */
785785
it("should throw error if userToken is missing", () => {
786786
const callback = () => null;
787-
expect(() => client.getClientToken(undefined, callback)).to.throw("userToken is required");
787+
expect(() => client.getAuthenticationToken(undefined, callback)).to.throw("userToken is required");
788788
});
789789

790-
/** @test {Hyperwallet#getClientToken} */
791-
it("should do post call to client token endpoint", () => {
790+
/** @test {Hyperwallet#getAuthenticationToken} */
791+
it("should do post call to authentication token endpoint", () => {
792792
const callback = () => null;
793-
client.getClientToken("test-user-token", callback);
793+
client.getAuthenticationToken("test-user-token", callback);
794794

795795
apiClientSpy.should.have.been.calledOnce();
796-
apiClientSpy.should.have.been.calledWith("users/test-user-token/client-token", {}, {}, callback);
796+
apiClientSpy.should.have.been.calledWith("users/test-user-token/authentication-token", {}, {}, callback);
797797
});
798798
});
799799

0 commit comments

Comments
 (0)