Skip to content

Commit

Permalink
Update MultiUserClient to handle additional parameter in beginConnection
Browse files Browse the repository at this point in the history
  • Loading branch information
kochie committed Sep 20, 2024
1 parent 10a8089 commit 343402c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion sdks/node/src/multiUserClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ describe("MultiUserClient", () => {
const result = await multiUserClient.getBeginConnectionUrl(userId, provider);

expect(result).toBe(url);
expect(mockAuthClient.beginConnection).toHaveBeenCalledWith(provider, "http://callback.uri", undefined, state);
expect(mockAuthClient.beginConnection).toHaveBeenCalledWith(
provider,
"http://callback.uri",
undefined,
undefined,
state
);
expect(writeUserData).toHaveBeenCalledWith(userId, { signInState: state });
});

Expand Down
2 changes: 1 addition & 1 deletion sdks/node/src/multiUserClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export class MultiUserClient {

async getBeginConnectionUrl(userId: string, provider: string): Promise<string> {
const state = randomUUID();
const url = await this.authClient.beginConnection(provider, this.callbackUri, undefined, state);
const url = await this.authClient.beginConnection(provider, this.callbackUri, undefined, undefined, state);

const userData = await this.readUserData(userId);
await this.writeUserData(userId, {
Expand Down

0 comments on commit 343402c

Please sign in to comment.